From 1c6974108e5bc035c5dc76a0916d86c8a961f98f Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Thu, 21 Nov 2024 07:32:59 -0600 Subject: [PATCH 01/15] Started an RTD config. --- .readthedocs.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..54ade6ad --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,28 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/source/conf.py + fail_on_warning: true + +# Optionally build your docs in additional formats such as PDF and ePub +formats: + - pdf + - epub + +python: + install: + - method: pip + path: . + extra_requirements: + - docs From 415d7dbcda29826cee938e7b8f26bd66f3c351b9 Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Thu, 21 Nov 2024 07:40:32 -0600 Subject: [PATCH 02/15] Fixed conf path. --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 54ade6ad..d498bf54 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,7 +12,7 @@ build: # Build documentation in the "docs/" directory with Sphinx sphinx: - configuration: docs/source/conf.py + configuration: doc/source/conf.py fail_on_warning: true # Optionally build your docs in additional formats such as PDF and ePub From 817e646e99874eed793c13de0feb7307ea9bb41c Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Thu, 21 Nov 2024 07:45:40 -0600 Subject: [PATCH 03/15] Fixed dependency. --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d498bf54..8857e2b8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -25,4 +25,4 @@ python: - method: pip path: . extra_requirements: - - docs + - doc From 11c43039987e815e8fddffcc6a7b8dd0debfafdc Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Thu, 21 Nov 2024 07:55:09 -0600 Subject: [PATCH 04/15] Ignore downloads issues with epubs. --- doc/source/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 4adf71f5..d63df807 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -105,6 +105,8 @@ apidoc_module_first = True apidoc_separate_modules = True +suppress_warnings = ["epub.unknown_project_files"] + # 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, From 6c3aea754a68778755ce6bc5857ca9a0454c1269 Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Thu, 21 Nov 2024 08:44:26 -0600 Subject: [PATCH 05/15] ensure RTD has full git history. --- .readthedocs.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 8857e2b8..da6b4f5a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,6 +9,11 @@ build: os: ubuntu-22.04 tools: python: "3.12" + jobs: + post_checkout: + - git fetch --unshallow || true + - git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' || true + - git fetch --all --tags || true # Build documentation in the "docs/" directory with Sphinx sphinx: From fce9e9e56043e23902a70a4ad9e34bbb2acc355d Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 07:29:53 -0600 Subject: [PATCH 06/15] Added ethical ads --- doc/source/conf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index d63df807..c7ddf889 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -101,6 +101,9 @@ }, ], } +html_sidebars = { + "**": ["search-field.html", "sidebar-nav-bs.html", "sidebar-ethical-ads.html"] +} apidoc_module_dir = "../../montepy" apidoc_module_first = True apidoc_separate_modules = True From 814a29c5f13c468e31e02573a9f7dd90a79e6640 Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 07:43:13 -0600 Subject: [PATCH 07/15] Added Project name to header --- doc/source/_templates/project.html | 1 + doc/source/conf.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 doc/source/_templates/project.html diff --git a/doc/source/_templates/project.html b/doc/source/_templates/project.html new file mode 100644 index 00000000..b27cc236 --- /dev/null +++ b/doc/source/_templates/project.html @@ -0,0 +1 @@ +{{ project }} diff --git a/doc/source/conf.py b/doc/source/conf.py index c7ddf889..5e5e64ca 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -89,9 +89,10 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # +github_url = "https://github.com/idaholab/MontePy" html_theme = "pydata_sphinx_theme" html_theme_options = { - "navbar_start": ["navbar-logo", "version"], + "navbar_start": ["navbar-logo", "project", "version"], "icon_links": [ { "name": "GitHub", From a6032caac622307ce9619ef9b9991ba16af5dfdb Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 07:59:35 -0600 Subject: [PATCH 08/15] Added some high level meta descriptions. --- doc/source/dev_tree.rst | 5 +++++ doc/source/developing.rst | 6 ++++++ doc/source/index.rst | 12 +++++++----- doc/source/starting.rst | 6 ++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/doc/source/dev_tree.rst b/doc/source/dev_tree.rst index df91c14d..95097dba 100644 --- a/doc/source/dev_tree.rst +++ b/doc/source/dev_tree.rst @@ -1,3 +1,8 @@ +.. meta:: + :description lang=en: + MontePy is the most user-friendly Python library for reading, editing, and writing MCNP input files. + This guide provides many resources for how make contributions to MontePy. + Developer's Resources ===================== diff --git a/doc/source/developing.rst b/doc/source/developing.rst index 1af832ad..b9a646f4 100644 --- a/doc/source/developing.rst +++ b/doc/source/developing.rst @@ -1,3 +1,9 @@ +.. meta:: + :description lang=en: + This guide provides details on how MontePy works, + and guidance on how to make contributions. + MontePy is the most user-friendly Python library for reading, editing, and writing MCNP input files. + Developer's Guide ================= diff --git a/doc/source/index.rst b/doc/source/index.rst index 3fd427d2..511b6303 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,12 +1,14 @@ -.. MontePy documentation master file, created by - sphinx-quickstart on Thu Apr 21 15:29:53 2022. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +.. meta:: + :description lang=en: + MontePy is a Python library for reading, editing, and writing MCNP input files. + MontePy provides an object-oriented interface for MCNP input files. + This allows for easy automation of many different tasks for working with MCNP input files. + MontePy: a Python library for MCNP input files. =============================================== -MontePy is a Python library for reading, editing, and writing MCNP input files. +MontePy is the most user-friendly Python library for reading, editing, and writing MCNP input files. MontePy provides an object-oriented interface for MCNP input files. This allows for easy automation of many different tasks for working with MCNP input files. diff --git a/doc/source/starting.rst b/doc/source/starting.rst index ec413b6b..5d0cafbc 100644 --- a/doc/source/starting.rst +++ b/doc/source/starting.rst @@ -1,3 +1,9 @@ +.. meta:: + :description lang=en: + Montepy is the most user-friendly Python library for reading, editing, and writing MCNP input files. + It can be easily installed using pip. + This tutorial covers the basics of getting started with MontePy. + Getting Started with MontePy ============================ From faa18c689f750fdc5ebc69d8063ecc08d012c2fa Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 07:59:55 -0600 Subject: [PATCH 09/15] Moved back to multi-version URLs. --- doc/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5e5e64ca..4d273d5f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -53,7 +53,6 @@ html_logo = "monty.svg" html_baseurl = "https://www.montepy.org/" -sitemap_url_scheme = "{link}" html_extra_path = ["robots.txt", "foo.imcnp"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. From 179d7b4c53bf47f325df9ce5900dc694d7fc8afc Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 08:01:03 -0600 Subject: [PATCH 10/15] Update robots for RTD. --- doc/source/robots.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/robots.txt b/doc/source/robots.txt index d2a4758d..cb1651c0 100644 --- a/doc/source/robots.txt +++ b/doc/source/robots.txt @@ -1,4 +1,5 @@ User-agent: * -Allow: / + +Disallow: /en/latest/ # Hidden version Sitemap: https://www.montepy.org/sitemap.xml From ad9e641538eb6ccd50ed1a55864b16a3c81e802a Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 08:11:38 -0600 Subject: [PATCH 11/15] Added version switcher. --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 4d273d5f..c7c5689a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -91,7 +91,7 @@ github_url = "https://github.com/idaholab/MontePy" html_theme = "pydata_sphinx_theme" html_theme_options = { - "navbar_start": ["navbar-logo", "project", "version"], + "navbar_start": ["navbar-logo", "project", "version-switcher"], "icon_links": [ { "name": "GitHub", From fa3754e2e01c5bee83328754570f60c231ae142c Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 08:15:23 -0600 Subject: [PATCH 12/15] Revert "Added version switcher." This reverts commit ad9e641538eb6ccd50ed1a55864b16a3c81e802a. --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c7c5689a..4d273d5f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -91,7 +91,7 @@ github_url = "https://github.com/idaholab/MontePy" html_theme = "pydata_sphinx_theme" html_theme_options = { - "navbar_start": ["navbar-logo", "project", "version-switcher"], + "navbar_start": ["navbar-logo", "project", "version"], "icon_links": [ { "name": "GitHub", From 801b2a29259c5315120e6b338b9861de95c335f9 Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 08:48:54 -0600 Subject: [PATCH 13/15] Removed sphinx sitemap. --- doc/source/conf.py | 1 - pyproject.toml | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 4d273d5f..c0752d7b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -37,7 +37,6 @@ "sphinx.ext.intersphinx", "sphinx.ext.extlinks", "sphinx.ext.doctest", - "sphinx_sitemap", "sphinx_favicon", "sphinx_copybutton" ] diff --git a/pyproject.toml b/pyproject.toml index 0ad39002..e6583f19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,9 +53,8 @@ doc = [ "sphinx>=7.4.0", "sphinxcontrib-apidoc", "pydata_sphinx_theme", - "sphinx-sitemap", "sphinx-favicon", - "sphinx-copybutton" + "sphinx-copybutton" ] format = ["black>=23.3.0"] build = [ From 19e47a0023341b79e2299750f1bae4cd35accd79 Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 08:50:05 -0600 Subject: [PATCH 14/15] Removed sitemap checking step in CI. --- .github/scripts/check_sitemap.py | 31 ------------------------------- .github/workflows/main.yml | 2 -- 2 files changed, 33 deletions(-) delete mode 100644 .github/scripts/check_sitemap.py diff --git a/.github/scripts/check_sitemap.py b/.github/scripts/check_sitemap.py deleted file mode 100644 index 26474827..00000000 --- a/.github/scripts/check_sitemap.py +++ /dev/null @@ -1,31 +0,0 @@ -import xml.etree.ElementTree as ET -import urllib.request - -NS = {"a": "http://www.sitemaps.org/schemas/sitemap/0.9"} -TOLERANCE = 0.8 - - -def discover_urls(): - tree = ET.parse("doc/build/html/sitemap.xml") - root = tree.getroot() - return [node.find("a:loc", NS).text for node in root.findall("a:url", NS)] - - -def test_urls(urls): - passed = 0 - for url in urls: - code = 404 - try: - code = urllib.request.urlopen(url).getcode() - except urllib.error.HTTPError as e: - print(url, e) - if code == 200: - passed += 1 - else: - print(url, code) - if passed / len(urls) < TOLERANCE: - raise ValueError(f"Too many URLs failed") - - -if __name__ == "__main__": - test_urls(discover_urls()) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c7f7ee9..ca008677 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -124,8 +124,6 @@ jobs: run: | cd doc make linkcheck - - name: test sitemap - run: python .github/scripts/check_sitemap.py doc-test: runs-on: ubuntu-latest From 1d5990989c6391c3cea72995721bdebb2982c769 Mon Sep 17 00:00:00 2001 From: "Micah D. Gale" Date: Tue, 3 Dec 2024 08:52:54 -0600 Subject: [PATCH 15/15] Removed all references to github pages. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e6583f19..6bf2b1e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ demo-test = ["montepy[demos]", "papermill"] [project.urls] -Homepage = "https://idaholab.github.io/MontePy/index.html" +Homepage = "https://www.montepy.org/" Repository = "https://github.com/idaholab/MontePy.git" Documentation = "https://www.montepy.org/" "Bug Tracker" = "https://github.com/idaholab/MontePy/issues"