1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

create readmegen.py script. move jinja2 templates to templates folder

This commit is contained in:
Kelly Brazil
2021-04-04 20:28:54 -07:00
parent 4ff9952938
commit 25410d3316
5 changed files with 973 additions and 70 deletions

16
readmegen.py Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env python3
# Genereate README.md from jc metadata using jinja2 templates
import jc.cli
from jinja2 import Environment, FileSystemLoader
file_loader = FileSystemLoader('templates')
env = Environment(loader=file_loader)
template = env.get_template('readme_template')
# get parser info from jc.cli.about_jc()
# plug it into the man page jinja2 template
output = template.render(jc=jc.cli.about_jc())
# save to man/jc.1
with open('README.md', 'w') as f:
f.write(output)