forked from NHERI-SimCenter/DamageAndLossModelLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57d652a
commit 12db8be
Showing
7 changed files
with
177 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
/doc/build/ | ||
*.pyc | ||
/.ropeproject/ | ||
/doc/cache/ | ||
/doc/source/dl_doc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import os | ||
import subprocess | ||
|
||
from sphinx.application import Sphinx | ||
|
||
|
||
def run_script(app: Sphinx): | ||
""" | ||
Run a custom Python script to generate files before Sphinx builds | ||
the documentation. | ||
Parameters | ||
---------- | ||
app: Sphinx | ||
The Sphinx application instance. | ||
""" | ||
script_path = os.path.join(app.srcdir, '_extensions', 'generate_dl_doc.py') | ||
|
||
result = subprocess.run(['python', script_path], check=True) | ||
|
||
if result.returncode != 0: | ||
raise RuntimeError('Script execution failed') | ||
|
||
|
||
def setup(app: Sphinx): | ||
""" | ||
Set up the custom Sphinx extension. | ||
Parameters | ||
---------- | ||
app: Sphinx | ||
The Sphinx application instance. | ||
""" | ||
app.connect('builder-inited', run_script) | ||
|
||
return { | ||
'version': '1.0', | ||
'parallel_read_safe': True, | ||
'parallel_write_safe': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.