diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0a768f3..6315df9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,27 +14,25 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Display Python version run: python -c "import sys; print(sys.version)" - - name: Install sphinx, pytest, pytest plugins + - name: Install deps run: | - python -m pip install wheel - python -m pip install pytest pytest-cov pytest-pep8 pytest-mock codecov - python -m pip install sphinx sphinx-sitemap sphinx-rtd-theme + python -m pip install "mdanalysis-sphinx-theme>=1.0.1" sphinx-sitemap - name: Install main dependencies run: | - python -m pip install six setuptools tqdm + python -m pip install tqdm - name: install package run: | @@ -42,12 +40,13 @@ jobs: - name: build docs run: | - python setup.py build_sphinx + cd docs + make html - name: deploy docs uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build/sphinx/html + publish_dir: ./docs/_build/html user_name: 'github-actions' user_email: 'github-action@users.noreply.github.com' diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..7b8d9a6 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,26 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in with Sphinx +sphinx: + configuration: docs/conf.py + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "mambaforge-4.10" + +# install the repo +python: + install: + - method: setuptools + path: . + +# Optionally set the version of Python and requirements required to build your docs +conda: + environment: environment.yaml diff --git a/docs/_static/custom.css b/docs/_static/custom.css deleted file mode 100644 index c069992..0000000 --- a/docs/_static/custom.css +++ /dev/null @@ -1,206 +0,0 @@ -/* custom MDAnalysis styling (User Guide theme) */ - -/* See https://github.com/MDAnalysis/mdanalysis/wiki/MDAnalysis-theme-colours */ -/* MDAnalysis orange: #FF9200 */ -/* MDAnalysis gray: #808080 */ -/* MDAnalysis white: #FFFFFF */ -/* MDAnalysis black: #000000 */ -/* Darker orange: e76900 */ -/* Even darker orange: #a24900 */ -/* RTD dark grey: #343131 */ -/* RTD light grey: #e6e6e6 */ - -/* -- page layout --------------------------------------------------------- */ - -body { - font-family: 'PT Sans', Helvetica, Arial, 'sans-serif'; - font-size: 17px; -} - -div.body { - color: #000000; -} - -div.sphinxsidebar a:hover { - text-decoration: none !important; -} - -div.sphinxsidebar p { - color: #808080; -} - -/* Home MDAnalysis colour */ -.wy-side-nav-search > a { - color: #343131; -} - -/* Side MDAnalysis version colour */ -.wy-side-nav-search > div.version { - color: #808080; -} - -/* Menubar caption colour */ -div.wy-menu-vertical span.caption-text { - color: #FF9200; -} - -/* Mobile layout menubar option */ -nav.wy-nav-top { - background: #343131; -} - -/* Menu search bar outline (default blue) */ -.wy-side-nav-search input[type="text"] { - border-color: #808080; -} - - -/* -- body styles --------------------------------------------------------- */ - -/* Different coloured links for sidebar vs body) */ -div.rst-content a { - color: #FF9200; - text-decoration: none; -} - -div.rst-content a:visited { - color: #FF9200; -} - -a:hover { - color: #FF9200 !important; - text-decoration: underline; -} - - -pre, tt, code { - font-family: Menlo, Monaco, 'Courier New', monospace -} - - -div.body h1 { - font-weight: bolder; -} - -a.headerlink { - color: #808080; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #808080; - color: #fff; -} - -/* ------- admonition boxes ------- */ - -div.admonition { - margin: 10px 0px; - padding: 10px 10px; -} - -div.admonition p.admonition-title { - font-size: 100%; - font-weight: bolder; -} - -/* ----- Tables ----- */ - -/* override table width restrictions */ -/* wrap tables instead of scrolling */ -@media screen and (min-width: 767px) { - - .wy-table-responsive table td, .wy-table-responsive table th { - /* !important prevents the common CSS stylesheets from overriding - this as on RTD they are loaded after this stylesheet */ - white-space: normal !important; - } - - .wy-table-responsive { - overflow: visible !important; - max-width: 100% !important; - } - } - -/* ----- Field lists ------ */ - -.section > dl.field-list { - display: flex; - flex-wrap: wrap; - margin: 0; - padding: 0; -} - -dl.field-list > dt::after { - content: ":"; -} - -.rst-content dl:not(.docutils) dt { - background: none; - color: #000000; - border-top: none; -} - -.section > dl.field-list dt { - margin: 0; - padding: 0; - flex-basis: 20%; - display: block; -} - -.section > dl.field-list > dd { - flex-basis: 70%; - margin: 0; -} - -.section > dl.field-list > dd p { - margin: 0; -} - -/* ----- MDAnalysis coloured elements ------ */ - -.rst-content dl.class dt, .rst-content dl.function dt { - color: #ca6500; - background: #FFEBD0; - border-top: solid 3px #FF9200; -} - -.rst-content .viewcode-link, .rst-content .viewcode-back { - color: #808080; -} - -.rst-content .guilabel { - background: #efefef; - border: 1px solid #808080; -} - - -.rst-content .seealso p.admonition-title { - background: #808080; -} - -.rst-content .seealso { - background: #e3e3e3; -} - -.rst-content .error p.admonition-title, .rst-content .warning p.admonition-title { - background: #F45F4B; -} - -.rst-content .error, .rst-content .warning { - background: #FFEEED; -} - -.rst-content .caution p.admonition-title, .rst-content .note p.admonition-title, .rst-content .important p.admonition-title { - background: #FF9200; -} - -.rst-content .caution, .rst-content .note, .rst-content .important { - background: #FFEBD0; -} - -.rst-content code:not(.xref).literal { - color: #ca6500; -} diff --git a/docs/_static/logos/mdanalysis-logo-200x150.png b/docs/_static/logos/mdanalysis-logo-200x150.png deleted file mode 100644 index 4246d67..0000000 Binary files a/docs/_static/logos/mdanalysis-logo-200x150.png and /dev/null differ diff --git a/docs/_static/logos/mdanalysis-logo.ico b/docs/_static/logos/mdanalysis-logo.ico deleted file mode 100644 index 3c102d0..0000000 Binary files a/docs/_static/logos/mdanalysis-logo.ico and /dev/null differ diff --git a/docs/conf.py b/docs/conf.py index 7bcbed7..5f69231 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,8 +14,6 @@ import sys, os import datetime -import sphinx_rtd_theme - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -39,8 +37,7 @@ 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext.autosummary', - 'sphinx_sitemap', - 'sphinx_rtd_theme'] + 'sphinx_sitemap'] mathjax_path = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML' @@ -123,11 +120,9 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'sphinx_rtd_theme' +html_theme = 'mdanalysis_sphinx_theme' -html_theme_path = [ - sphinx_rtd_theme.get_html_theme_path() -] +# html_theme_path = [] # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -141,20 +136,7 @@ # /* MDAnalysis white: #FFFFFF */ # /* MDAnalysis black: #000000 */ -html_theme_options = { - 'canonical_url': '', - 'logo_only': True, - 'display_version': True, - 'prev_next_buttons_location': 'bottom', - 'style_external_links': False, - 'style_nav_header_background': 'white', - # Toc options - 'collapse_navigation': True, - 'sticky_navigation': True, - 'navigation_depth': 4, - 'includehidden': True, - 'titles_only': False, -} +html_theme_options = {"mda_official": True} # options common to RTD and MDAnalysis theme @@ -164,7 +146,7 @@ # so a file named "default.css" will overwrite the builtin "default.css". # For RTD theme: custom.css to override theme defaults. html_static_path = ['_static'] -html_css_files = ['custom.css'] +# html_css_files = [] # The name of an image file (relative to this directory) to place at the top @@ -174,7 +156,7 @@ # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -html_favicon = "_static/logos/mdanalysis-logo.ico" +# html_favicon = "_static/logos/mdanalysis-logo.ico" # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, @@ -305,6 +287,7 @@ # Configuration for intersphinx: refer to the Python standard library # and other packages used by MDAnalysis -intersphinx_mapping = {'https://docs.python.org/': None, - 'https://docs.mdanalysis.org/stable': None, - } +intersphinx_mapping = { + "python": ('https://docs.python.org/3/', None), + "mdanalysis": ('https://docs.mdanalysis.org/stable', None), +} diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 0000000..38a19b1 --- /dev/null +++ b/environment.yaml @@ -0,0 +1,10 @@ +name: mdanalysisdata +channels: + - conda-forge + - defaults +dependencies: + - tqdm + - pip + - mdanalysis-sphinx-theme >=1.0.1 + - pip: + - sphinx-sitemap