Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve docgen #2043

Merged
merged 4 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tools/docgen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ channels:
ms.author: authors' Microsoft alias
```

## Run the tool

```bash
cd tools/docgen
pip install -e .

python -m docgen --manifest docgen-manifest.yaml
```

## Modify input file

### Image alt text
Expand Down
2 changes: 2 additions & 0 deletions tools/docgen/docgen/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
def instantiate_channel(channel_yml):
name = channel_yml["name"]
module_name, class_name = name.rsplit(".", 1)

module_name = f"{module_name}"
eisber marked this conversation as resolved.
Show resolved Hide resolved
print(f"Instantiating {class_name} from module {module_name}")
clazz = getattr(importlib.import_module(module_name), class_name)
channel_yml.pop("name")
Expand Down
2 changes: 1 addition & 1 deletion tools/docgen/docgen/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def convert_soup_to_md(soup, **options):
"markdown.extensions.fenced_code",
],
)
parsed_html = BeautifulSoup(parsed_html)
parsed_html = BeautifulSoup(parsed_html, features="html.parser")
parsed_html = self._download_and_replace_images(
parsed_html,
None,
Expand Down
1 change: 1 addition & 0 deletions tools/docgen/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"argparse",
"pypandoc",
"markdownify",
"markdown",
"traitlets",
],
)
Loading