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

17 lines
485 B
Python
Raw Normal View History

#!/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)