-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3f15d84
Showing
10 changed files
with
2,534 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
Oops, something went wrong.