diff --git a/.circleci/config.yml b/.circleci/config.yml index 0da1df1f1..f0097710d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,24 +31,13 @@ jobs: # Needed to install mplcairo - run: sudo apt install libcairo2-dev pkg-config # the large resource_class has 4 CPUs but auto detection does not work - - run: python -m tox -e sunpy-docs -- -j 4 + - run: python -m tox -e sunpy_docs -- -j 4 # Remove some parts of the build to speed up upload - - run: rm -r .tmp/sunpy-docs/sunpy/docs/_build/html/.doctrees - - run: rm -r .tmp/sunpy-docs/sunpy/docs/_build/html/_downloads - - run: rm -r .tmp/sunpy-docs/sunpy/docs/_build/html/_sources + - run: rm -r .tmp/sunpy_docs/sunpy/docs/_build/html/.doctrees + - run: rm -r .tmp/sunpy_docs/sunpy/docs/_build/html/_downloads + - run: rm -r .tmp/sunpy_docs/sunpy/docs/_build/html/_sources - store_artifacts: - path: .tmp/sunpy-docs/sunpy/docs/_build/html - test_package: - resource_class: large - docker: - - image: cimg/python:3.11 - steps: - - checkout - - run: *apt-install - - run: *tox - - run: python -m tox -e testpackage-docs -- -j 4 - - store_artifacts: - path: test_package/docs/_build/html + path: .tmp/sunpy_docs/sunpy/docs/_build/html css_linting: resource_class: small docker: @@ -64,5 +53,4 @@ workflows: jobs: - css_linting - sunpy - - test_package - website diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 59257861d..5921833be 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -8,29 +8,29 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -U --user --force-reinstall pep517 setuptools_scm twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_TOKEN }} - run: | - python -m pep517.build --binary --source --out-dir wheelhouse . - python -m twine upload --skip-existing wheelhouse/* - - name: Install dependencies - run: | - pip install requests httpie - - name: Build all RTD versions - env: - RTD_AUTH_TOKEN: ${{ secrets.RTD_AUTH_TOKEN }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - run: | - python rebuild_all_rtd.py - http POST https://api.netlify.com/api/v1/sites/1ba3a6d4-f1ee-4524-bbec-3edc04720a48/builds "Authorization: Bearer $NETLIFY_AUTH_TOKEN" + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -U --user --force-reinstall pep517 setuptools_scm twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_TOKEN }} + run: | + python -m pep517.build --binary --source --out-dir wheelhouse . + python -m twine upload --skip-existing wheelhouse/* + - name: Install dependencies + run: | + pip install requests httpie + - name: Build all RTD versions + env: + RTD_AUTH_TOKEN: ${{ secrets.RTD_AUTH_TOKEN }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + run: | + python rebuild_all_rtd.py + http POST https://api.netlify.com/api/v1/sites/1ba3a6d4-f1ee-4524-bbec-3edc04720a48/builds "Authorization: Bearer $NETLIFY_AUTH_TOKEN" diff --git a/.gitignore b/.gitignore index a2c15ef01..b9d6dab62 100644 --- a/.gitignore +++ b/.gitignore @@ -103,15 +103,19 @@ ENV/ # vim tmp files *~ -# test_package -test_package/docs/_build -test_package/docs/generated -test_package/docs/api +# vscode .history .vscode # temp directory that tox uses .tmp +# Docs +docs/generated/ +docs/sg_execution_times.rst +docs/autoapi/ +docs/api/ + +# node node_modules .nodeenv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a23b01cec..1e577ec91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,44 +2,54 @@ ci: autofix_prs: false autoupdate_schedule: "quarterly" repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.1.5" hooks: - - id: check-ast - - id: check-case-conflict - - id: check-json - - id: check-toml - - id: check-yaml - - id: debug-statements - - id: end-of-file-fixer - - id: mixed-line-ending - args: ['--fix=lf'] - - id: trailing-whitespace - -- repo: https://github.com/PyCQA/autoflake + - id: ruff + args: ["--fix"] + - repo: https://github.com/PyCQA/autoflake rev: v2.2.1 hooks: - - id: autoflake - args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] - -- repo: https://github.com/PyCQA/docformatter + - id: autoflake + args: + [ + "--in-place", + "--remove-all-unused-imports", + "--remove-unused-variable", + ] + - repo: https://github.com/PyCQA/docformatter rev: v1.7.5 hooks: - id: docformatter - args: ['--make-summary-multi-line', '--pre-summary-newline', '-ri'] - -- repo: https://github.com/PyCQA/isort - rev: 5.12.0 + args: ["--make-summary-multi-line", "--pre-summary-newline", "-ri"] + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 hooks: - - id: isort - -- repo: https://github.com/psf/black - rev: 23.11.0 + - id: isort + - repo: https://github.com/psf/black + rev: 23.12.1 hooks: - - id: black - -- repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + - id: black + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 hooks: - id: prettier - types_or: [css, scss, javascript] + types_or: [css, scss, javascript, rst, json, yaml, toml, markdown] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-json + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + args: ["--fix=lf"] + - id: trailing-whitespace + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + args: ["--write-changes"] diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2ec3e919c..d608b8cfb 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -21,9 +21,9 @@ formats: - htmlzip python: - install: - - method: pip - extra_requirements: + install: + - method: pip + extra_requirements: - all - docs - path: . + path: . diff --git a/.stylelintrc.json b/.stylelintrc.json index 25470207b..269c06aaa 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,7 +1,7 @@ { "extends": "stylelint-config-recommended", "rules": { - "no-descending-specificity": null, - "selector-pseudo-element-no-unknown": null - } + "no-descending-specificity": null, + "selector-pseudo-element-no-unknown": null + } } diff --git a/LICENSE.md b/LICENSE.md index eff936445..a3223f457 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -6,10 +6,10 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. diff --git a/MANIFEST.in b/MANIFEST.in index e12aa35ca..71e45c3af 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ -recursive-include src/sunpy_sphinx_theme/sunpy/ * exclude rebuild_all_rtd.py exclude tox.ini exclude .gitignore @@ -6,4 +5,6 @@ exclude .pre-commit-config.yaml exclude .stylelintrc prune .circleci/ prune .github/ -prune test_package/ +prune docs/ +prune examples/ +recursive-include src/sunpy_sphinx_theme/sunpy/ * diff --git a/README.md b/README.md index 4cbc029ff..f0773926c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# SunPy Sphinx Theme +# SunPy Project Sphinx Theme [![PyPI version](https://badge.fury.io/py/sunpy-sphinx-theme.svg)](https://badge.fury.io/py/sunpy-sphinx-theme) -This repository contains the sphinx theme used by the Sunpy Project for its website and documentation. +This repository contains the sphinx theme used by The Sunpy Project for all online resources. -This theme is a derivitive of the excellent [pydata-sphinx-theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html), customised to present a uniform navigation over all the sunpy projects. +This theme is a derivative of the excellent [pydata-sphinx-theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html), customised to present a uniform navigation over all the projects. For more information see the [documentation](https://sunpy-sphinx-theme.readthedocs.io/). diff --git a/docs/code_ref/animals.rst b/docs/code_ref/animals.rst new file mode 100644 index 000000000..80e2d0ca9 --- /dev/null +++ b/docs/code_ref/animals.rst @@ -0,0 +1,5 @@ +******* +Animals +******* + +.. automodapi:: test_package.animals diff --git a/test_package/docs/code_ref/index.rst b/docs/code_ref/index.rst similarity index 51% rename from test_package/docs/code_ref/index.rst rename to docs/code_ref/index.rst index 358b06ebd..74fd5e9b6 100644 --- a/test_package/docs/code_ref/index.rst +++ b/docs/code_ref/index.rst @@ -1,11 +1,9 @@ -.. _reference: - ************* API Reference ************* .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - stuff - timerange + animals + timerange diff --git a/test_package/docs/code_ref/timerange.rst b/docs/code_ref/timerange.rst similarity index 100% rename from test_package/docs/code_ref/timerange.rst rename to docs/code_ref/timerange.rst diff --git a/docs/colors.rst b/docs/colors.rst new file mode 100644 index 000000000..c4e9b56e7 --- /dev/null +++ b/docs/colors.rst @@ -0,0 +1,143 @@ +.. COPY FROM PYDATA THEME DOCS + +Colors +****** + +This theme specifies color variables for the primary and secondary colors (``--pst-color-primary`` and ``--pst-color-secondary``, respectively). +These are meant to complement one another visually across the theme, if you modify these, choose colors that look good when paired with one another. +There are also several other color variables that control the color for admonitions, links, menu items, etc. + +Each color variable has two values, one corresponding to the "light" and one for the "dark" theme. +These are used throughout many of the theme elements to define text color, background color, etc. + +Here is an overview of the colors available in the theme (change theme mode to switch from light to dark versions). + +.. raw:: html + + + +

+ primary + secondary + accent + success + info + warning + danger + background + on-background + surface + on-surface + target +

+ +This theme uses shadows to convey depth in the light theme mode and opacity in the dark one. +It defines 4 color variables that help build overlays in your documentation. + +- :code:`background`: color of the back-most surface of the documentation +- :code:`on-background` elements that are set on top of this background (e.g. the header navbar on dark mode). +- :code:`surface` elements set on the background with a light-grey color in the light theme mode. This color has been kept in the dark theme (e.g. code-block directives). +- :code:`on-surface` elements that are on top of :code:`surface` elements (e.g. sidebar directives). + +The following image should help you understand these overlays: + +.. raw:: html + + + +
+
+

background

+
+
+

on-background

+
+
+

surface

+
+
+

on-surface

+
+
+ +Snippets +-------- + +Documentation :any:`index ` and :any:`Module ` index. + +Some code: + +.. code-block:: python + + """ + Parameters + ---------- + x : `type` + Description of parameter x. + """ + import numpy as np + + def func(x): + return np.mean(x) + + # This is a comment + return func + +It's good to have your upstream remote have a scary name [#]_, to remind you that it's a read-write remote: + +.. code-block:: bash + + $ git remote add upstream-rw git@github.com:sunpy/sunpy.git + $ git fetch upstream-rw + +.. [#] Text of the first footnote. + +``:func:`` +:func:`numpy.mean` + +``:meth:`` +:meth:`numpy.mean` + +``:class:`` +:class:`numpy.mean` + +Normal +`numpy.mean` + +``:func:`` +:func:`numpy.ndarray.mean` + +``:meth:`` +:meth:`numpy.ndarray.mean` + +``:class:`` +:class:`numpy.ndarray.mean` + +Normal +`numpy.ndarray.mean` + +Sometimes you need a URL: `bbc.com `__ + +Contributing to ``sunraster`` diff --git a/docs/conf.py b/docs/conf.py index d00eca1b1..3afb45c32 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,15 +1,126 @@ -# -- Project information ----------------------------------------------------- -from datetime import datetime +""" +Configuration file for the Sphinx documentation builder. +""" +import os +import sys +import datetime +from pathlib import Path -project = "sunpy-sphinx-theme" -copyright = f"{datetime.now().year}, The SunPy Project" -author = "The SunPy Project" -release = "2.0" +from sphinx_gallery.sorting import ExampleTitleSortKey, ExplicitOrder -# -- General configuration --------------------------------------------------- -extensions = [] -templates_path = ["_templates"] -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +from sunpy_sphinx_theme import SVG_ICON + +project = "Test Package" +author = "The Test Package Community" +copyright = f"{datetime.datetime.now().year}, {author}" +extensions = [ + "sphinx_automodapi.automodapi", + "sphinx_automodapi.smart_resolver", + "hoverxref.extension", + "matplotlib.sphinxext.plot_directive", + "sphinx_copybutton", + "sphinx_design", + "sphinx_gallery.gen_gallery", + "sphinx_togglebutton", + "sphinx.ext.coverage", + "sphinx.ext.doctest", + "sphinx.ext.inheritance_diagram", + "sphinx.ext.intersphinx", + "sphinx.ext.mathjax", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# Add the test package to the path so we can import it for automodapi +sys.path.append(Path(".").absolute().as_posix()) +import test_package # NOQA - Test package must be on the path -# -- Options for HTML output ------------------------------------------------- +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +source_suffix = ".rst" +master_doc = "index" +default_role = "obj" +napoleon_use_rtype = False +intersphinx_mapping = { + "python": ( + "https://docs.python.org/3/", + (None, "http://www.astropy.org/astropy-data/intersphinx/python3.inv"), + ), + "numpy": ( + "https://numpy.org/doc/stable/", + (None, "http://www.astropy.org/astropy-data/intersphinx/numpy.inv"), + ), + "scipy": ( + "https://docs.scipy.org/doc/scipy/reference/", + (None, "http://www.astropy.org/astropy-data/intersphinx/scipy.inv"), + ), + "matplotlib": ( + "https://matplotlib.org/", + (None, "http://www.astropy.org/astropy-data/intersphinx/matplotlib.inv"), + ), + "astropy": ("https://docs.astropy.org/en/stable/", None), + "sqlalchemy": ("https://docs.sqlalchemy.org/en/latest/", None), + "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), + "skimage": ("https://scikit-image.org/docs/stable/", None), + "drms": ("https://docs.sunpy.org/projects/drms/en/stable/", None), + "parfive": ("https://parfive.readthedocs.io/en/latest/", None), + "reproject": ("https://reproject.readthedocs.io/en/stable/", None), +} html_theme = "sunpy" +graphviz_output_format = "svg" +graphviz_dot_args = [ + "-Nfontsize=10", + "-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif", + "-Efontsize=10", + "-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif", + "-Gfontsize=10", + "-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif", +] +sphinx_gallery_conf = { + "filename_pattern": "^((?!skip_).)*$", + "examples_dirs": os.path.join("..", "examples"), + "subsection_order": ExplicitOrder( + [ + "../examples/section", + ] + ), + "within_subsection_order": ExampleTitleSortKey, + "gallery_dirs": os.path.join("generated", "gallery"), + "default_thumb_file": SVG_ICON, + "abort_on_example_error": False, + "plot_gallery": "True", + "remove_config_comments": True, +} +if os.environ.get("READTHEDOCS"): + hoverxref_api_host = "https://readthedocs.org" + + if os.environ.get("PROXIED_API_ENDPOINT"): + # Use the proxied API endpoint + # A RTD thing to avoid a CSRF block when docs are using a custom domain + hoverxref_api_host = "/_" + +hoverxref_auto_ref = False +hoverxref_domains = ["py"] +hoverxref_mathjax = True +hoverxref_modal_hover_delay = 500 +hoverxref_tooltip_maxwidth = 600 # RTD main window is 696px +hoverxref_intersphinx = list(intersphinx_mapping.keys()) +hoverxref_role_types = { + # Roles within the py domain + "attr": "tooltip", + "class": "tooltip", + "const": "tooltip", + "data": "tooltip", + "exc": "tooltip", + "func": "tooltip", + "meth": "tooltip", + "mod": "tooltip", + "obj": "tooltip", + # Roles within the std domain + "confval": "tooltip", + "hoverxref": "tooltip", + "ref": "tooltip", # Would be used by hoverxref_auto_ref if we set it to True + "term": "tooltip", +} +copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: " +copybutton_prompt_is_regexp = True diff --git a/docs/customizing.rst b/docs/customizing.rst index 33a769236..b416d293b 100644 --- a/docs/customizing.rst +++ b/docs/customizing.rst @@ -50,7 +50,6 @@ It's possible to add dropdown menus to the topnav by setting document equal to a Footer links are a number of links which will get placed in the center of the footer. They are specified in the same format as the ``navbar_links``. - Adjusting the Styling --------------------- @@ -71,6 +70,5 @@ We have tried to use CSS variables to control the styling the key variables are: --sst-header-text: var(--sst-lighter-color); --sst-sidebar-background-color: var(--pst-color-background); - The included CSS uses "light" (light, lighter, lightest) colors for the background on the light theme and "dark" colors for the text, and the inverse on the dark theme. The bright accent color is used for some text (e.g. links) on the dark theme, and the muted variant on the light theme to increase contrast. diff --git a/docs/index.rst b/docs/index.rst index b492ced7c..1e5f11fc6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,44 @@ The core changes between this theme and the `pydata-sphinx-theme` are: * Add a center element to the footer bar. * Restyled the theme for SunPy colors. -.. toctree:: - :maxdepth: 2 +.. grid:: 1 2 2 2 + :gutter: 3 - customizing + .. grid-item-card:: + :class-card: card + + Documentation + ^^^^^^^^^^^^^ + + .. toctree:: + :maxdepth: 1 + + customizing + colors + web-components + + .. grid-item-card:: + :class-card: card + + Examples + ^^^^^^^^ + + .. toctree:: + :maxdepth: 1 + + generated/gallery/index + code_ref/index + + .. grid-item-card:: + :class-card: card + :link: subsections + :link-type: ref + + Conventions + ^^^^^^^^^^^ + + .. toctree:: + :maxdepth: 1 + + subsections + subsections_toc diff --git a/test_package/docs/subsections.rst b/docs/subsections.rst similarity index 72% rename from test_package/docs/subsections.rst rename to docs/subsections.rst index 05bc68871..b43663eea 100644 --- a/test_package/docs/subsections.rst +++ b/docs/subsections.rst @@ -9,7 +9,7 @@ subsections Abcdefghijklmnopqrstuvwxyz ************************** -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed congue ligula in erat pulvinar, convallis consectetur mi eleifend. Fusce tincidunt mauris ac lacus mollis, semper bibendum orci semper. Vivamus elit purus, congue ac erat sit amet, iaculis malesuada velit. Nam egestas imperdiet ex. Duis eget dignissim purus. In sollicitudin nibh vel lorem sodales mattis. Nullam vitae leo sed elit consequat aliquam vitae eget diam. Nunc elit justo, consectetur sit amet pulvinar at, imperdiet at felis. Nam dolor dui, sodales in volutpat quis, laoreet vitae enim. Curabitur scelerisque auctor nunc a auctor. +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed congue ligula in erat pulvinar, convallis consectetur mi eleifend. Fusce tincidunt mauris ac lacus mollis, semper bibendum orci semper. Vivamus elit purus, congue ac erat sit amet, iaculis malesuada velit. Name egestas imperdiet ex. Duis eget dignissim purus. In sollicitudin nibh vel lorem sodales mattis. Nullam vitae leo sed elit consequat aliquam vitae eget diam. Nunc elit justo, consectetur sit amet pulvinar at, imperdiet at felis. Name dolor dui, sodales in volutpat quis, laoreet vitae enim. Curabitur scelerisque auctor nunc a auctor. Bcdefghijklmnopqrstuvwxyz ========================= @@ -32,4 +32,4 @@ Vestibulum est ex, gravida sit amet tortor non, aliquet auctor ante. Nulla conva Fghijklmnopqrstuvwxyz """"""""""""""""""""" -Proin non suscipit massa. Vivamus at auctor felis, ut placerat velit. Mauris sapien turpis, luctus at justo eget, aliquet molestie nisl. Nam molestie eros sem, at commodo ligula pellentesque eu. Vivamus tincidunt a nulla id rhoncus. Integer viverra ipsum arcu, sit amet molestie diam suscipit at. Ut feugiat arcu nisl, eu blandit ipsum vulputate vitae. Mauris orci magna, vulputate sed blandit a, varius quis mi. Vivamus vehicula libero nec erat varius porta. Morbi eros leo, efficitur eu risus et, eleifend ultrices tellus. Fusce nec laoreet eros. In non pulvinar massa. Sed hendrerit posuere massa eu gravida. +Proin non suscipit massa. Vivamus at auctor felis, ut placerat velit. Mauris sapien turpis, luctus at justo eget, aliquet molestie nisl. Name molestie eros sem, at commodo ligula pellentesque eu. Vivamus tincidunt a nulla id rhoncus. Integer viverra ipsum arcu, sit amet molestie diam suscipit at. Ut feugiat arcu nisl, eu blandit ipsum vulputate vitae. Mauris orci magna, vulputate sed blandit a, various quis mi. Vivamus vehicula libero nec erat various porta. Morbi eros leo, efficitur eu risus et, eleifend ultrices tellus. Fusce nec laoreet eros. In non pulvinar massa. Sed hendrerit posuere massa eu gravida. diff --git a/test_package/docs/subsections_toc.rst b/docs/subsections_toc.rst similarity index 73% rename from test_package/docs/subsections_toc.rst rename to docs/subsections_toc.rst index 3356ec854..3b18356b0 100644 --- a/test_package/docs/subsections_toc.rst +++ b/docs/subsections_toc.rst @@ -12,7 +12,7 @@ This time, we have a toctree in side the doc with a depth of 5, the goal is to s Abcdefghijklmnopqrstuvwxyz ************************** -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed congue ligula in erat pulvinar, convallis consectetur mi eleifend. Fusce tincidunt mauris ac lacus mollis, semper bibendum orci semper. Vivamus elit purus, congue ac erat sit amet, iaculis malesuada velit. Nam egestas imperdiet ex. Duis eget dignissim purus. In sollicitudin nibh vel lorem sodales mattis. Nullam vitae leo sed elit consequat aliquam vitae eget diam. Nunc elit justo, consectetur sit amet pulvinar at, imperdiet at felis. Nam dolor dui, sodales in volutpat quis, laoreet vitae enim. Curabitur scelerisque auctor nunc a auctor. +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed congue ligula in erat pulvinar, convallis consectetur mi eleifend. Fusce tincidunt mauris ac lacus mollis, semper bibendum orci semper. Vivamus elit purus, congue ac erat sit amet, iaculis malesuada velit. Name egestas imperdiet ex. Duis eget dignissim purus. In sollicitudin nibh vel lorem sodales mattis. Nullam vitae leo sed elit consequat aliquam vitae eget diam. Nunc elit justo, consectetur sit amet pulvinar at, imperdiet at felis. Name dolor dui, sodales in volutpat quis, laoreet vitae enim. Curabitur scelerisque auctor nunc a auctor. Bcdefghijklmnopqrstuvwxyz ========================= @@ -35,4 +35,4 @@ Vestibulum est ex, gravida sit amet tortor non, aliquet auctor ante. Nulla conva Fghijklmnopqrstuvwxyz """"""""""""""""""""" -Proin non suscipit massa. Vivamus at auctor felis, ut placerat velit. Mauris sapien turpis, luctus at justo eget, aliquet molestie nisl. Nam molestie eros sem, at commodo ligula pellentesque eu. Vivamus tincidunt a nulla id rhoncus. Integer viverra ipsum arcu, sit amet molestie diam suscipit at. Ut feugiat arcu nisl, eu blandit ipsum vulputate vitae. Mauris orci magna, vulputate sed blandit a, varius quis mi. Vivamus vehicula libero nec erat varius porta. Morbi eros leo, efficitur eu risus et, eleifend ultrices tellus. Fusce nec laoreet eros. In non pulvinar massa. Sed hendrerit posuere massa eu gravida. +Proin non suscipit massa. Vivamus at auctor felis, ut placerat velit. Mauris sapien turpis, luctus at justo eget, aliquet molestie nisl. Name molestie eros sem, at commodo ligula pellentesque eu. Vivamus tincidunt a nulla id rhoncus. Integer viverra ipsum arcu, sit amet molestie diam suscipit at. Ut feugiat arcu nisl, eu blandit ipsum vulputate vitae. Mauris orci magna, vulputate sed blandit a, various quis mi. Vivamus vehicula libero nec erat various porta. Morbi eros leo, efficitur eu risus et, eleifend ultrices tellus. Fusce nec laoreet eros. In non pulvinar massa. Sed hendrerit posuere massa eu gravida. diff --git a/docs/test_package/__init__.py b/docs/test_package/__init__.py new file mode 100644 index 000000000..757c867b1 --- /dev/null +++ b/docs/test_package/__init__.py @@ -0,0 +1,2 @@ +from .animals import * # NOQA: F401, F403 +from .timerange import * # NOQA: F401, F403 diff --git a/test_package/test_package/__init__.py b/docs/test_package/animals.py similarity index 98% rename from test_package/test_package/__init__.py rename to docs/test_package/animals.py index 5225eda08..3d0311198 100644 --- a/test_package/test_package/__init__.py +++ b/docs/test_package/animals.py @@ -1,5 +1,5 @@ """ -This module provies a collection of functions. +This module provides a collection of functions. """ from sunpy.util.decorators import deprecated diff --git a/test_package/test_package/timerange.py b/docs/test_package/timerange.py similarity index 98% rename from test_package/test_package/timerange.py rename to docs/test_package/timerange.py index f67f29d67..02c2eabab 100644 --- a/test_package/test_package/timerange.py +++ b/docs/test_package/timerange.py @@ -1,5 +1,5 @@ """ -This module provies a object that can handle a time range. +This module provides a object that can handle a time range. """ from datetime import timedelta @@ -22,8 +22,8 @@ class TimeRange: .. note:: - Regardless of how a `sunpy.time.TimeRange` is constructed it will always - provide a positive time range where the start time is before the end time. + Regardless of how a `sunpy.time.TimeRange` is constructed it will always + provide a positive time range where the start time is before the end time. Parameters ---------- diff --git a/docs/web-components.rst b/docs/web-components.rst new file mode 100644 index 000000000..16e0f19e9 --- /dev/null +++ b/docs/web-components.rst @@ -0,0 +1,260 @@ +.. INSPIRED FROM sphinx-design documentation +.. COPY FROM PYDATA THEME DOCS + +======================== +Sphinx Design Components +======================== + +The PyData Sphinx Theme uses `sphinx-design `__ +to add several UI components and provide extra flexibility for content creation. +These include badges, buttons, cards, and tabs, among other components. +This theme provides custom CSS to ensure that `sphinx-design `__ elements look and feel consistent with this theme. + +.. seealso:: + + For more information about how to use these extensions, see `the sphinx-design documentation `_. + +Below you can find some examples of the components created with the :code:`sphinx-design` extension. + +.. _badges-buttons: + +Badges and button-links +======================= + +Here are some of the available badges: + +:bdg-primary:`primary` +:bdg-secondary:`secondary` +:bdg-success:`success` +:bdg-primary-line:`primary outline` +:bdg-secondary-line:`secondary outline` +:bdg-success-line:`success outline` + +Here are some of the available button-style links, also using semantic colors: + +.. grid:: auto + + .. grid-item:: + + .. button-ref:: badges-buttons + :ref-type: ref + :color: info + :shadow: + + Info + + .. grid-item:: + + .. button-ref:: badges-buttons + :ref-type: ref + :color: success + :shadow: + + Success + + .. grid-item:: + + .. button-ref:: badges-buttons + :ref-type: ref + :color: warning + :shadow: + + Warning + + .. grid-item:: + + .. button-ref:: badges-buttons + :ref-type: ref + :color: danger + :shadow: + + Danger + + .. grid-item:: + + .. button-ref:: badges-buttons + :ref-type: ref + :color: muted + :shadow: + + Muted + + .. grid-item:: + + .. button-ref:: badges-buttons + :ref-type: ref + :color: light + :shadow: + + Light + + .. grid-item:: + + .. button-ref:: badges-buttons + :ref-type: ref + :color: dark + :shadow: + + Dark + +.. note:: + + `Sphinx Design buttons + `__ + are actually links, meaning they are rendered in HTML with ```` tags + instead of ``