1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00
stedolan-jq/docs/build_mantests.py

14 lines
425 B
Python
Raw Normal View History

2019-02-20 20:58:25 -05:00
#!/usr/bin/env python3
import yaml
with open("content/manual/manual.yml") as f:
manual = yaml.load(f)
for section in manual.get('sections', []):
for entry in section.get('entries', []):
for example in entry.get('examples', []):
print(example.get('program', '').replace('\n', ' '))
print(example.get('input', ''))
for s in example.get('output', []):
print(s)
print('')