diff --git a/tools/docgen/README.md b/tools/docgen/README.md index 866914fbc3..fad893969b 100644 --- a/tools/docgen/README.md +++ b/tools/docgen/README.md @@ -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 diff --git a/tools/docgen/docgen/__main__.py b/tools/docgen/docgen/__main__.py index 103594a297..a7f1166142 100644 --- a/tools/docgen/docgen/__main__.py +++ b/tools/docgen/docgen/__main__.py @@ -7,6 +7,7 @@ def instantiate_channel(channel_yml): name = channel_yml["name"] module_name, class_name = name.rsplit(".", 1) + print(f"Instantiating {class_name} from module {module_name}") clazz = getattr(importlib.import_module(module_name), class_name) channel_yml.pop("name") diff --git a/tools/docgen/docgen/channels.py b/tools/docgen/docgen/channels.py index a1b4b9fb2f..de1b79e02c 100644 --- a/tools/docgen/docgen/channels.py +++ b/tools/docgen/docgen/channels.py @@ -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, diff --git a/tools/docgen/setup.py b/tools/docgen/setup.py index 865ecc6dca..7d1fe844fc 100644 --- a/tools/docgen/setup.py +++ b/tools/docgen/setup.py @@ -34,6 +34,7 @@ "argparse", "pypandoc", "markdownify", + "markdown", "traitlets", ], )