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 diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..da6b4f5a --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,33 @@ +# 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" + 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: + configuration: doc/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: + - doc 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 4adf71f5..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" ] @@ -53,7 +52,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. @@ -89,9 +87,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", @@ -101,10 +100,15 @@ }, ], } +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 +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, 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/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 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 ============================ diff --git a/pyproject.toml b/pyproject.toml index ac7af644..6afab82b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,9 +52,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 = [ @@ -70,7 +69,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"