mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
This works with a new `indent` and `unindent` filters respectively. There are a few things to consider, but I have understood how it works and can handle it. There is some overhead just to give me nicer visuals ... might choose a different route, like annotations.
33 lines
954 B
Mako
33 lines
954 B
Mako
<%! import util %>\
|
|
|
|
## source should be ${self.uri}
|
|
## you need to escape the output, using a filter for example
|
|
<%def name="gen_info(source)">\
|
|
DO NOT EDIT !
|
|
This file was generated automatically from '${source}'
|
|
DO NOT EDIT !\
|
|
</%def>
|
|
|
|
## This will only work within a substitution, not within python code
|
|
<%def name="to_api_version(v)" buffered="True">\
|
|
<% assert len(v) >= 2 and v[0] == 'v'%>\
|
|
## convert it once to int, just to be sure it is an int
|
|
${v[1:]}\
|
|
</%def>
|
|
|
|
<%def name="repository_url()" buffered="True">\
|
|
${cargo.repo_base_url}/${OUTPUT_DIR}\
|
|
</%def>
|
|
|
|
<%def name="library_name()" buffered="True">\
|
|
${util.library_name(name, version)}\
|
|
</%def>
|
|
|
|
## All crates and standard `use` declaration, required for all examples
|
|
## Must be outside of a test function
|
|
<%def name="test_prelude()">\
|
|
extern crate hyper;
|
|
extern crate "yup-oauth2" as oauth2;
|
|
extern crate "rustc-serialize" as rustc_serialize;
|
|
extern crate ${self.library_name()};
|
|
</%def> |