Skip to content
/ fmt Public
forked from fmtlib/fmt

Commit

Permalink
Fix doc build
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 9, 2024
1 parent 735a613 commit b5c8fd7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
env:
KEY: ${{secrets.KEY}}
run: |
cmake .
cmake $GITHUB_WORKSPACE
make doc
# $GITHUB_WORKSPACE/support/build-docs.py
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ function(add_doc_target)
add_custom_target(
doc
COMMAND
${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/support
${CMAKE_COMMAND}
-E env PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/support/python
${MKDOCS} build -f ${CMAKE_CURRENT_SOURCE_DIR}/support/mkdocs.yml
--site-dir ${CMAKE_CURRENT_BINARY_DIR}/site
--no-directory-urls
Expand Down
7 changes: 5 additions & 2 deletions support/run-mkdocs → support/mkdocs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

import os, subprocess, sys

dirname = os.path.dirname(__file__)
dirname = os.path.join(os.path.dirname(__file__), 'python')

# Set PYTHONPATH for the mkdocstrings handler.
env = os.environ.copy()
path = env.get('PYTHONPATH')
env['PYTHONPATH'] = (path + ':' if path else '') + dirname

config_path = os.path.join(dirname, 'mkdocs.yml')
subprocess.run(['mkdocs'] + sys.argv[1:] + ['-f', config_path], env=env)
args = sys.argv[1:]
if 'build' in args:
args += ['-f', config_path]
subprocess.run(['mkdocs'] + args, env=env)

0 comments on commit b5c8fd7

Please sign in to comment.