Skip to content

Commit

Permalink
Update conf.py
Browse files Browse the repository at this point in the history
Signed-off-by: KonanAI <[email protected]>
  • Loading branch information
konan-ai authored Jul 24, 2023
1 parent a76bb97 commit b75d8d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# All the existing imports here
import os
import subprocess
import packaging.version
from pallets_sphinx_themes import get_version
from pallets_sphinx_themes import ProjectLink
Expand Down Expand Up @@ -96,3 +97,13 @@ def github_link(name, rawtext, text, lineno, inliner, options=None, content=None

def setup(app: Sphinx):
app.add_role("gh", github_link)

app.connect('build-finished', run_postprocess)

def run_postprocess(app, exception):
# The script and html directory paths
script_path = os.path.join(os.path.dirname(__file__), "postprocess.py")
html_dir_path = os.path.join(app.outdir)

# Call the postprocess script on the html directory
subprocess.check_call([sys.executable, script_path, html_dir_path])

0 comments on commit b75d8d4

Please sign in to comment.