| Crates.io | hippo |
| lib.rs | hippo |
| version | 0.1.1 |
| created_at | 2021-04-11 13:07:07.499563+00 |
| updated_at | 2021-04-11 13:07:07.499563+00 |
| description | A compile-time preprocessor for web assets. |
| homepage | |
| repository | https://github.com/pfk/hippo |
| max_upload_size | |
| id | 382014 |
| size | 4,029 |
Hippo is an experimental compile-time asset preprocessor; its intended usage is to preprocess web assets with existing toolchains.
:warning: The scope of the project and its programming interfaces are very likely to change.
A struct or enum may derive from Preprocess to embed the output of a command. The
processed output can be accessed via Self::HIPPO_DATA, Self::preprocessed_data() or
its Display implementation.
use hippo::Preprocess;
#[derive(Preprocess)]
#[hippo("sass", "css/main.scss")]
pub struct MainCSS;
[sass]
command = "sassc"
flags = ["-t", "compressed"]
prefix = "static/"
format = "utf-8"
Hippo will look for a Hippo.conf in the crate root; this file defines one or more
preprocessors that will be made available to any struct or enum that derives from
Preprocess.
A preprocessor is identified by its TOML section and its behavior is controlled by its key-value pairs. The following key-value pairs are recognized:
| Key | Type | Description |
|---|---|---|
| command | String | The command to be executed. Mandatory. |
| flags | String Array | A collection of command options. Optional. |
| prefix | String | A path prefix to be prepended to input arguments. Optional. |
| format | String | The output format. Must be "bytes" (default) or "utf-8". |