Skip to content

Commit

Permalink
initial set of help doc
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMillerGIS committed Apr 3, 2024
0 parents commit 3f15d84
Show file tree
Hide file tree
Showing 10 changed files with 2,534 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
30 changes: 30 additions & 0 deletions build_toc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import datetime
import pathlib
import lxml.html

docs = pathlib.Path(__file__).parent / 'docs'


for folder in docs.glob('*'):
if not folder.is_dir():
continue
print(folder.name)

with (folder / 'readme.md').open('w', encoding='utf-8') as writer:
writer.write('| Name | Alias | Description |\n| --- | --- | --- |\n')
for f in folder.glob('*.html'):
print(f'\t{f}')
html: lxml.html.HtmlElement = lxml.html.parse(f).getroot()

name = f'[{f.stem}](./{f.name})'
alias = html.find_class('ContentHeader')[0].getparent().text_content().split('\t')[-1]
description = ''
for h in html.findall('.//h3'):
if h.text == 'Description':
pre = h.getnext().getnext()
if pre is not None:
description = pre.text_content()
break
writer.write(f"| {name} | {alias} | {description} |\n")

writer.write(f'\n`Last built {datetime.date.today()}`\n')
Loading

0 comments on commit 3f15d84

Please sign in to comment.