From a0bf73a9b331e8b97a71344ddba4a4d3a4c349ac Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 27 Sep 2023 15:09:52 -0600 Subject: [PATCH 1/7] updated Sphinx docs with myst_parser extension, https://github.com/InstituteforDiseaseModeling/idm-content/issues/30 --- docs/conf.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index f887a2cf..3aca0a1b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,7 +55,8 @@ 'sphinx.ext.todo', 'sphinx.ext.viewcode', # Add a link to the Python source code for classes, functions etc. 'nbsphinx', - 'IPython.sphinxext.ipython_console_highlighting' # Temporary fix for https://github.com/spatialaudio/nbsphinx/issues/687 + 'IPython.sphinxext.ipython_console_highlighting', # Temporary fix for https://github.com/spatialaudio/nbsphinx/issues/687 + 'sphinx_search.extension', # search across multiple docsets in domain ] autodoc_default_options = { @@ -159,6 +160,21 @@ # base URL from which the finished HTML is served. html_use_opensearch = 'docs.idmod.org/projects/hpvsim/en/latest' +# -- RTD Sphinx search for searching across the entire domain, default child ------------- + +if os.environ.get('READTHEDOCS') == 'True': + + search_project_parent = "institute-for-disease-modeling-idm" + search_project = os.environ["READTHEDOCS_PROJECT"] + search_version = os.environ["READTHEDOCS_VERSION"] + + rtd_sphinx_search_default_filter = f"subprojects:{search_project}/{search_version}" + + rtd_sphinx_search_filters = { + "Search this project": f"project:{search_project}/{search_version}", + "Search all IDM docs": f"subprojects:{search_project_parent}/{search_version}", + } + # Output file base name for HTML help builder. htmlhelp_basename = 'HPVsim' From 33e4f4a3ad532cf8bb3dc5e446270d86a5676551 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 27 Sep 2023 17:18:53 -0600 Subject: [PATCH 2/7] updated Sphinx docs with myst_parser extension, https://github.com/InstituteforDiseaseModeling/idm-content/issues/30 --- .gitignore | 2 +- docs/conf.py | 24 ++++++++++++++++++++++++ docs/requirements.txt | 3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 34a00e22..2cda986e 100644 --- a/.gitignore +++ b/.gitignore @@ -83,7 +83,7 @@ instance/ # Sphinx documentation docs/_build/ docs/modules.rst -docs/hpvsim.*.rst +docs/hpvsim*.rst # PyBuilder target/ diff --git a/docs/conf.py b/docs/conf.py index 3aca0a1b..2d783d01 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,6 +57,25 @@ 'nbsphinx', 'IPython.sphinxext.ipython_console_highlighting', # Temporary fix for https://github.com/spatialaudio/nbsphinx/issues/687 'sphinx_search.extension', # search across multiple docsets in domain + 'myst_parser', # source files written in MD or RST +] + +myst_enable_extensions = [ + "amsmath", + "attrs_inline", + "colon_fence", + "deflist", + "dollarmath", + "fieldlist", + "html_admonition", + "html_image", + "inv_link", + "linkify", + "replacements", + "smartquotes", + "strikethrough", + "substitution", + "tasklist", ] autodoc_default_options = { @@ -132,8 +151,13 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". + html_static_path = ['_static'] +html_css_files = ['theme_overrides.css'] + +html_js_files = ['show_block_by_os.js'] + html_context = { 'rtd_url': 'https://docs.idmod.org/projects/hpvsim/en/latest', 'theme_vcs_pageview_mode': 'edit' diff --git a/docs/requirements.txt b/docs/requirements.txt index 34c5b4ef..4f810341 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -8,3 +8,6 @@ pandoc pypandoc optuna seaborn +myst-parser +readthedocs-sphinx-search +jupyterlab \ No newline at end of file From 43d4571acee10a1b2af33d5f87320f4df39e02bd Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Thu, 28 Sep 2023 16:46:53 -0600 Subject: [PATCH 3/7] doc configuration fixes --- docs/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 2d783d01..9260c9d3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -69,7 +69,6 @@ "fieldlist", "html_admonition", "html_image", - "inv_link", "linkify", "replacements", "smartquotes", From 75ed516a74729c132fdd20c55e4ed5a4d83fe826 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Fri, 6 Oct 2023 15:21:48 -0600 Subject: [PATCH 4/7] Update conf.py Added Markdown to source_suffix --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 9260c9d3..04c79630 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -100,7 +100,7 @@ # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: -source_suffix = '.rst' +source_suffix = ['.rst', '.md'] master_doc = 'index' # General information about the project. From 95f98d3061d85aa9024931041de40c4dfe178213 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Fri, 6 Oct 2023 15:28:26 -0600 Subject: [PATCH 5/7] Update requirements.txt Added linkify for the myst_parser extensions. --- docs/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 4f810341..eecdbb89 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -10,4 +10,5 @@ optuna seaborn myst-parser readthedocs-sphinx-search -jupyterlab \ No newline at end of file +jupyterlab +linkify From 9ba19199f932b1d4c9a2c8978ce9b7356a8fda97 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Fri, 6 Oct 2023 15:36:18 -0600 Subject: [PATCH 6/7] Update requirements.txt Fixed typo in linkify package name. --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index eecdbb89..5af5ca33 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -11,4 +11,4 @@ seaborn myst-parser readthedocs-sphinx-search jupyterlab -linkify +linkify-it-py From aa72f6143ebd8ab7002830e56a76b2ab4e5faa4e Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Fri, 8 Dec 2023 17:16:59 -0700 Subject: [PATCH 7/7] removed README.md from doc build to resolve build issue --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 9260c9d3..7eeae31e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -120,7 +120,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'README.md'] # suppress warnings for multiple possible Python references in the namespace # suppress_warnings = ['ref.python']