Skip to content

Commit

Permalink
chore: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Oct 15, 2024
2 parents cb25538 + afa3104 commit 7a18e38
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sphinx_ape/sphinx_ext/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def builder(self) -> DocumentationBuilder:

def run(self):
userguides = self._get_userguides()

# TODO: DELETE THIS! FORCED TO DEBUG LIKE THIS.
if not userguides:
raise ValueError("DEBUG")

cli_docs = self._get_cli_references()
methoddocs = self._get_methoddocs()

Expand All @@ -85,6 +90,10 @@ def run(self):
# Plugin or regular package.
sections["Python Reference"] = methoddocs

# Ensure TOC is not empty (no docs?).
if not sections or not any(len(x) for x in sections.values()):
raise BuildError("Empty TOC.")

toc_trees = []
for caption, entries in sections.items():
if len(entries) < 1:
Expand All @@ -101,10 +110,6 @@ def run(self):
if toc_tree_rst:
restructured_text = f"{restructured_text}\n\n{toc_tree_rst}"

# Ensure TOC is not empty (no docs?).
if not sections or not any(len(x) for x in sections.values()):
raise BuildError("Empty TOC.")

return self.parse_text_to_nodes(restructured_text)

def _get_userguides(self) -> list[str]:
Expand Down

0 comments on commit 7a18e38

Please sign in to comment.