Skip to content

Commit

Permalink
Speed up documentation build (#1525)
Browse files Browse the repository at this point in the history
* Remove sphinx-build link check from docs build

* Remove force option from sphinx-apidoc command in docs build

* Remove -E option default (fresh env) to sphinx-build command in docs build

* Remove sphinx viewcode extension

* Don't include last updated date in footer

* Default to smaller max resource file size before using placeholder
  • Loading branch information
matt-graham authored Nov 22, 2024
1 parent 2c8de38 commit 5eb5775
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'rawfiles'
]

Expand Down Expand Up @@ -56,7 +55,6 @@
html_theme = 'sphinx_rtd_theme'

html_use_smartypants = True
html_last_updated_fmt = '%b %d, %Y'
html_split_index = False
html_show_copyright = False
html_sidebars = {
Expand Down
2 changes: 1 addition & 1 deletion docs/tlo_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def excel_to_rst_table(input_path: Path, output_path: Path) -> None:
def generate_docs_pages_from_resource_files(
resources_directory: Path,
docs_directory: Path,
max_file_size_bytes: int = 2**20,
max_file_size_bytes: int = 2**15,
) -> None:
root_output_directory = docs_directory / "resources"
root_output_directory.mkdir(exist_ok=True)
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ deps =
; require setuptools_scm for getting version info
setuptools_scm
commands =
sphinx-apidoc -e -f -o {toxinidir}/docs/reference {toxinidir}/src/tlo
sphinx-apidoc -e -o {toxinidir}/docs/reference {toxinidir}/src/tlo
; Generate API documentation for TLO methods
python docs/tlo_methods_rst.py
; Generate data sources page
Expand All @@ -82,8 +82,7 @@ commands =
python src/tlo/analysis/hsi_events.py --output-file docs/hsi_events.csv --output-format csv
; Generate parameters listing
python docs/tlo_parameters.py {toxinidir}{/}resources {toxinidir}{/}docs{/}parameters.rst
sphinx-build {posargs:-E} -b html docs dist/docs
-sphinx-build -b linkcheck docs dist/docs
sphinx-build -b html docs dist/docs

[testenv:check]
deps =
Expand Down

0 comments on commit 5eb5775

Please sign in to comment.