Skip to content

Commit

Permalink
manual_index
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailin Nemui committed Oct 31, 2023
1 parent a332d1d commit 211dcea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _tools/manual_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import myst_parser
from myst_parser.mdit_to_docutils.base import DocutilsRenderer
from myst_parser.parsers.mdit import create_md_parser
from myst_parser.mdit_to_docutils.base import make_document
from myst_parser.config.main import read_topmatter
from myst_parser.config.main import MdParserConfig

Expand Down Expand Up @@ -76,8 +77,9 @@ def __init__(self, fn: str, *sources):
title = meta['title']
elif 'name' in meta:
title = meta['name']
doctree = docutils.utils.new_document(source)
doctree = make_document(source)
parser = create_md_parser(self.mconfig, DocutilsRenderer)
doctree.settings.__dict__["myst_suppress_warnings"] = None
parser.options["document"] = doctree
parser.render(text)
# print({'source': source, 'title': title})
Expand Down

0 comments on commit 211dcea

Please sign in to comment.