examples,tutorial: provide default metadata

This commit is contained in:
Laurier Loiselle 2023-03-29 14:19:33 -04:00
parent 1ea0b9febd
commit f0a6631af5
No known key found for this signature in database
GPG Key ID: 345920CC72089A3F
3 changed files with 56 additions and 1 deletions

24
examples/metadata.yml Normal file
View File

@ -0,0 +1,24 @@
metadata:
title: test
pn: test-01
company: some company
address: 8888 fancy street west
authors:
created:
name: bob ross
date: 2023-03-29
reviewed:
name: n/a
date: n/a
revisions:
a:
name: bob ross
date: 2023-03-29
changelog: initial release
template:
name: din-6771
sheetsize: A3

View File

@ -63,9 +63,16 @@ def build_generated(groupkeys):
with (path / readme).open("w") as out:
out.write(f'# {groups[key]["title"]}\n\n')
# collect and iterate input YAML files
for yaml_file in collect_filenames("Building", key, input_extensions):
try:
res = cli(["--formats", "ghpst", str(yaml_file)])
res = cli([
"--formats",
"ghpst",
str(yaml_file),
"--prepend",
yaml_file.parent / "metadata.yml"
])
except BaseException as e:
if str(e) != "0" and not isinstance(
e, (click.ClickException, SystemExit)

24
tutorial/metadata.yml Normal file
View File

@ -0,0 +1,24 @@
metadata:
title: test
pn: test-01
company: some company
address: 8888 fancy street west
authors:
created:
name: bob ross
date: 2023-03-29
reviewed:
name: n/a
date: n/a
revisions:
a:
name: bob ross
date: 2023-03-29
changelog: initial release
template:
name: din-6771
sheetsize: A4