-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__main__.py
More file actions
33 lines (23 loc) · 889 Bytes
/
__main__.py
File metadata and controls
33 lines (23 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
import json
from src.help_build import qHelpBuild, qGetVersion
from src.doc_build import docBuild
from src.build_nav import buildNav
version = '1.0.0'
def main():
dirname = os.path.dirname(__file__)
# Scrape qlik-cli for help documentation and build JSON object
output = os.path.join(dirname, 'data/qlik-cli-help.json')
qlik = {"qVersion": qGetVersion(), "qHelp": qHelpBuild(["qlik"])}
qJSON = json.dumps(qlik,indent=4)
with open(output,'w') as j:
j.write(qJSON)
# Use JSON object to create relevant markdown documents
input_file = os.path.join(dirname, 'data/qlik-cli-help.json')
with open(input_file,'r') as d:
data = json.load(d)
docBuild(version, data['qVersion'], data['qHelp'])
# Build mkdocs nav tree for qlik-cli markdown documents
buildNav()
if __name__ == '__main__':
main()