1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-15 00:05:11 +02:00
Files
jc/mangen.py

15 lines
455 B
Python
Raw Permalink Normal View History

2021-04-02 17:40:09 -07:00
#!/usr/bin/env python3
# Generate man page from jc metadata using jinja2 templates
2021-04-02 17:40:09 -07:00
from datetime import date
import jc.cli
from jinja2 import Environment, FileSystemLoader
file_loader = FileSystemLoader('templates')
2021-04-02 17:40:09 -07:00
env = Environment(loader=file_loader)
template = env.get_template('manpage_template')
2021-04-02 18:04:55 -07:00
output = template.render(today=date.today(),
2022-10-08 09:04:04 -07:00
jc=jc.cli.JcCli.about_jc())
2021-04-02 17:40:09 -07:00
with open('man/jc.1', 'w') as f:
f.write(output)