doc_infra/parsers/freebsd.py

19 lines
491 B
Python
Raw Normal View History

#!/bin/env python3
def parse_freebsd(content):
current_section = ""
result = {}
for line in content.splitlines():
if line.startswith("#####") and line.endswith("#####"):
current_section = line.replace(" ","").replace("#","").lower()
result[current_section] = ""
else:
if current_section:
result[current_section] += line
from pprint import pprint
#pprint(result)
if __name__ == "__main__":
main()