Skip to content

Commit f1d9582

Browse files
committed
feat(doc): def for DO NOT EDIT comments
A note like that is now added to all files we generated, commented out depending on the file type. Quite neat, except that for filtering, I always have to use blocks.
1 parent e164cf7 commit f1d9582

12 files changed

Lines changed: 77 additions & 6 deletions

File tree

gen/youtube3/LICENSE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!---
2+
DO NOT EDIT !
3+
This file was generated automatically from 'src/mako/LICENSE.md.mako'
4+
DO NOT EDIT !
5+
-->
16
The MIT License (MIT)
27
=====================
38

gen/youtube3/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!---
2+
DO NOT EDIT !
3+
This file was generated automatically from 'src/mako/README.md.mako'
4+
DO NOT EDIT !
5+
-->
16
The `youtube3` library allows access to all features of *YouTube*.
27

38
TODO: Library level fully fledged documentation, incuding **summary** and **usage**.

gen/youtube3/cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DO NOT EDIT !
2-
# This file was generated automatically by 'src/mako/cargo.toml.mako'
2+
# This file was generated automatically from 'src/mako/cargo.toml.mako'
33
# DO NOT EDIT !
44
[package]
55

gen/youtube3/src/cmn.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// COPY OF 'src/rust/cmn.rs'
2+
// DO NOT EDIT
3+
use std::marker::MarkerTrait;
4+
5+
/// Identifies types which can be inserted and deleted.
6+
/// Types with this trait are most commonly used by clients of this API.
7+
pub trait Resource: MarkerTrait {}
8+
9+
/// Identifies types which are used in API responses.
10+
pub trait ResponseResult: MarkerTrait {}
11+
12+
/// Identifies types which are used in API requests.
13+
pub trait RequestResult: MarkerTrait {}
14+
15+
/// Identifies types which are only used as part of other types, which
16+
/// usually are carrying the `Resource` trait.
17+
pub trait Part: MarkerTrait {}
18+
19+
/// Identifies types which are only used by other types internally.
20+
/// They have no special meaning, this trait just marks them for completeness.
21+
pub trait NestedType: MarkerTrait {}

gen/youtube3/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// DO NOT EDIT !
2+
// This file was generated automatically from 'src/mako/lib.rs.mako'
3+
// DO NOT EDIT !
4+
15
//! TODO: Library level fully fledged documentation, incuding **summary** and **usage**.
26
//! And another line, for testing
37
//!

src/mako/LICENSE.md.mako

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## -*- coding: utf-8 -*-
22
<%! import util %>\
3+
<%namespace name="mutil" file="lib/util.mako"/>\
4+
<%block filter="util.markdown_comment">\
5+
<%mutil:gen_info source="${self.uri}" />\
6+
</%block>
37
The MIT License (MIT)
48
=====================
59

src/mako/README.md.mako

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
<%! import util as pyutil %>\
12
<%namespace name="lib" file="lib/lib.mako"/>\
23
<%namespace name="util" file="lib/util.mako"/>\
4+
<%block filter="pyutil.markdown_comment">\
5+
<%util:gen_info source="${self.uri}" />\
6+
</%block>
37
The `${util.library_name()}` library allows access to all features of *${canonicalName}*.
48
59
<%lib:docs />

src/mako/cargo.toml.mako

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%! import util %>\
22
<%namespace name="mutil" file="lib/util.mako"/>\
3-
# DO NOT EDIT !
4-
# This file was generated automatically by '${self.uri}'
5-
# DO NOT EDIT !
3+
<%block filter="util.hash_comment">\
4+
<%mutil:gen_info source="${self.uri}" />\
5+
</%block>
66
[package]
77
88
name = "${mutil.library_name()}"

src/mako/deps.mako

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
api_json_inputs = api_json + " $(API_SHARED_INFO)"
1919
api_info.append((api_name, api_clean, gen_root))
2020
%>\
21-
${api_common}: $(RUST_SRC)/cmn.rs
22-
@cp $< $@
21+
${api_common}: $(RUST_SRC)/cmn.rs $(lastword $(MAKEFILE_LIST))
22+
@ echo "// COPY OF '$<'" > $@
23+
@ echo "// DO NOT EDIT" >> $@
24+
@cat $< >> $@
2325
2426
${gen_root_stamp}: ${' '.join(i[0] for i in sds)} ${api_json_inputs} $(MAKO_LIB_FILES) $(MAKO_RENDER)
2527
PYTHONPATH=$(MAKO_LIB_DIR) $(TPL) --template-dir '.' --var OUTPUT_DIR=$@ -io ${' '.join("%s=%s" % (s, d) for s, d in sds)} --data-files ${api_json_inputs}

src/mako/lib.rs.mako

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<%namespace name="lib" file="lib/lib.mako"/>\
99
<%namespace name="mutil" file="lib/util.mako"/>\
1010
<%namespace name="schema" file="lib/schema.mako"/>\
11+
<%block filter="util.rust_comment">\
12+
<%mutil:gen_info source="${self.uri}" />\
13+
</%block>
14+
1115
<%block filter="util.rust_module_doc_comment">\
1216
<%lib:docs />\
1317
</%block>

0 commit comments

Comments
 (0)