This repository was archived by the owner on Mar 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ def build_init(app):
182182 print ("Successfully retrieved repository metadata." )
183183 app .env .library_shortname = repo_metadata ["name" ]
184184 print ("Running sphinx-build with Markdown first..." )
185- markdown_utils .run_sphinx_markdown ()
185+ markdown_utils .run_sphinx_markdown (app )
186186 print ("Completed running sphinx-build with Markdown files." )
187187
188188 """
Original file line number Diff line number Diff line change @@ -485,9 +485,11 @@ def remove_unused_pages(
485485 print (f"Could not delete { page } ." )
486486
487487
488- def run_sphinx_markdown () -> None :
488+ def run_sphinx_markdown (app : sphinx . application ) -> None :
489489 """Runs sphinx-build with Markdown builder in the plugin."""
490490 cwd = os .getcwd ()
491+ relative_srcdir = app .srcdir .removeprefix (f"{ cwd } /" )
492+ relative_outdir = app .outdir .removeprefix (f"{ cwd } /" ).removesuffix ("/html" )
491493 # Skip running sphinx-build for Markdown for some unit tests.
492494 # Not required other than to output DocFX YAML.
493495 if "docs" in cwd :
@@ -498,8 +500,8 @@ def run_sphinx_markdown() -> None:
498500 "sphinx-build" ,
499501 "-M" ,
500502 "markdown" ,
501- "docs/" ,
502- "docs/_build" ,
503+ relative_srcdir ,
504+ relative_outdir ,
503505 ],
504506 hide_output = False
505507 )
You can’t perform that action at this time.
0 commit comments