python3Packages.xknx: 1.1.0 -> 1.2.0
[NixPkgs.git] / nixos / lib / make-options-doc / generateCommonMark.py
blob404e53b0df9c26d9a438709e40148cb0fd5eaa24
1 import json
2 import sys
4 options = json.load(sys.stdin)
5 for (name, value) in options.items():
6 print('##', name.replace('<', '\\<').replace('>', '\\>'))
7 print(value['description'])
8 print()
9 if 'type' in value:
10 print('*_Type_*:')
11 print(value['type'])
12 print()
13 print()
14 if 'default' in value:
15 print('*_Default_*')
16 print('```')
17 print(json.dumps(value['default'], ensure_ascii=False, separators=(',', ':')))
18 print('```')
19 print()
20 print()
21 if 'example' in value:
22 print('*_Example_*')
23 print('```')
24 print(json.dumps(value['example'], ensure_ascii=False, separators=(',', ':')))
25 print('```')
26 print()
27 print()