From 5bdab8ba1d34321249602d7074e2064d98be79df Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 30 Aug 2023 17:16:46 -0600 Subject: [PATCH 1/8] removed deprecated system_packages from rtd.yml: --- .readthedocs.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 80cdccf5..245e65a9 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -24,5 +24,4 @@ python: install: - requirements: docs/requirements.txt - method: pip - path: . - system_packages: true \ No newline at end of file + path: . \ No newline at end of file From 98b2515937a602c938b78c0981e14099fb9d8869 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 27 Sep 2023 15:01:37 -0600 Subject: [PATCH 2/8] updated Sphinx docs with myst_parser extension, https://github.com/InstituteforDiseaseModeling/idm-content/issues/30 --- docs/conf.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 23448ad9..67ac9929 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,6 +53,7 @@ 'sphinx.ext.todo', 'sphinx.ext.viewcode', # Add a link to the Python source code for classes, functions etc. 'nbsphinx', + 'sphinx_search.extension', # search across multiple docsets in domain ] autodoc_default_options = { @@ -156,6 +157,22 @@ # base URL from which the finished HTML is served. html_use_opensearch = 'docs.idmod.org/projects/covasim/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 = 'Covasim' From 0c0596ac31e9cd1c73abc0701f778a8f7b42ef02 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 27 Sep 2023 15:27:03 -0600 Subject: [PATCH 3/8] updated Sphinx docs with view code extension, https://github.com/InstituteforDiseaseModeling/idm-content/issues/33 --- docs/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 67ac9929..3e9c58fe 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,7 +54,8 @@ 'sphinx.ext.viewcode', # Add a link to the Python source code for classes, functions etc. 'nbsphinx', 'sphinx_search.extension', # search across multiple docsets in domain -] + 'sphinx.ext.viewcode', # link to view source code + ] autodoc_default_options = { 'member-order': 'bysource', From 7ba692c433091d5566d02bd3a70430d03be3568c Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 27 Sep 2023 15:44:53 -0600 Subject: [PATCH 4/8] updated rtd.yml config with new required params, https://github.com/InstituteforDiseaseModeling/idm-content/issues/35 --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 245e65a9..3a7ccf66 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -17,7 +17,7 @@ sphinx: # If using Sphinx, optionally build your docs in additional formats such as PDF formats: - - pdf + - htmlzip # Optionally declare the Python requirements required to build your docs python: From 216c2981a05a966cb67fafbc864ef96c8c3b6968 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 27 Sep 2023 16:44:10 -0600 Subject: [PATCH 5/8] updated docs/requirements.txt with most recent packages, updated CSS, https://github.com/InstituteforDiseaseModeling/idm-content/issues/58 --- docs/conf.py | 3 +++ docs/requirements.txt | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 3e9c58fe..560cb070 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -130,8 +130,11 @@ # 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_context = { 'rtd_url': 'https://docs.idmod.org/projects/covasim/en/latest', 'theme_vcs_pageview_mode': 'edit' diff --git a/docs/requirements.txt b/docs/requirements.txt index 32f9fe40..3025a044 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -8,4 +8,7 @@ nbsphinx pandoc pypandoc optuna -seaborn \ No newline at end of file +seaborn +myst-parser +readthedocs-sphinx-search +jupyterlab \ No newline at end of file From 085ed368f7d1556f19897e1c8139c400aec5f764 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Wed, 27 Sep 2023 17:14:10 -0600 Subject: [PATCH 6/8] updated Sphinx docs with myst_parser extension, https://github.com/InstituteforDiseaseModeling/idm-content/issues/30 --- docs/conf.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 560cb070..39aaadca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,7 +55,26 @@ 'nbsphinx', 'sphinx_search.extension', # search across multiple docsets in domain 'sphinx.ext.viewcode', # link to view source code - ] + '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 = { 'member-order': 'bysource', From af2286eab3aacaf0fbb90a9f0cf4604f6ad64df7 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Fri, 29 Sep 2023 14:54:30 -0600 Subject: [PATCH 7/8] added README.md to the exclude list for building into the HTML docs --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 39aaadca..5349bcc0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -119,7 +119,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'] From 9fcffedd04237bef1dae2c000fda8b55136ab046 Mon Sep 17 00:00:00 2001 From: Jen Schripsema Date: Fri, 6 Oct 2023 17:12:40 -0600 Subject: [PATCH 8/8] Update conf.py Added Markdown to source file types for docs/conf.py. --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 5349bcc0..81059807 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -99,7 +99,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.