Skip to content

Commit 74196a4

Browse files
committed
🔧MAINTAIN: Remove unused sphinx code
1 parent 0d1205e commit 74196a4

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

sphinx_external_toc/events.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from sphinx.config import Config
99
from sphinx.environment import BuildEnvironment
1010
from sphinx.errors import ExtensionError
11-
from sphinx.transforms import SphinxTransform
1211
from sphinx.util import docname_join, logging
1312
from sphinx.util.matching import Matcher, patfilter
1413

@@ -182,34 +181,3 @@ def append_toctrees(app: Sphinx, doctree: nodes.document) -> None:
182181
# since `TocTreeCollector.process_doc` expects it in a section
183182
# TODO check if there is this is always ok
184183
doctree.children[-1].extend(node_list)
185-
186-
187-
# other implementations that can eventually be deleted.
188-
189-
190-
class _AppendToctrees(SphinxTransform):
191-
"""This is not used and would be an alternate route,
192-
to using the 'doctree-read' event, via`app.add_transform(_AppendToctrees)`
193-
"""
194-
195-
default_priority = 100
196-
197-
def apply(self, **kwargs) -> None:
198-
append_toctrees(self.app, self.document)
199-
200-
201-
def _modify_source(app, docname, source):
202-
"""This is not used, but would be the implementation if using:
203-
app.connect("source-read", _modify_source)
204-
"""
205-
site_map = app.env.external_site_map
206-
doc_item = site_map.get(app.env.docname)
207-
208-
if doc_item is None or not doc_item.parts:
209-
return
210-
211-
for toctree in doc_item.parts:
212-
entries = "\n".join(
213-
entry for entry in toctree.sections if isinstance(entry, str)
214-
)
215-
source[0] += f"```{{toctree}}\n{entries}\n```\n"

0 commit comments

Comments
 (0)