This commit is contained in:
Adrian Malacoda 2017-10-26 02:42:35 -05:00
parent 9b1be645ff
commit b488413f96

30
TODO.md
View File

@ -6,20 +6,20 @@ Make an API that actually makes sense. I'm thinking something along the lines of
* ResourceWriter, which just wraps the Generators and spits out the output file
## Sample
let mut routes = RocketRouteGenerator::new();
routes.add(RocketRoute {
source: browserify("foo.js"),
mountpoint: String::from("/foo.js"),
content_type: "JavaScript"
});
let mut routes = RocketRouteGenerator::new();
routes.add(RocketRoute {
source: browserify("foo.js"),
mountpoint: String::from("/foo.js"),
content_type: "JavaScript"
});
let mut templates = HandlebarsGenerator::new();
templates.add(HandlebarsTemplate {
source: PathBuf::from("templates/foo.hbs"),
name: "foo"
});
let mut templates = HandlebarsGenerator::new();
templates.add(HandlebarsTemplate {
source: PathBuf::from("templates/foo.hbs"),
name: "foo"
});
let mut writer = ResourceWriter::new();
writer.add_resources(routes);
writer.add_resources(templates);
writer.write("resources.rs");
let mut writer = ResourceWriter::new();
writer.add_resources(routes);
writer.add_resources(templates);
writer.write("resources.rs");