././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7611525 sunpy-sphinx-theme-1.2.36/ 0000755 0001751 0000171 00000000000 14305600770 014771 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7571523 sunpy-sphinx-theme-1.2.36/.circleci/ 0000755 0001751 0000171 00000000000 14305600770 016624 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/.circleci/config.yml 0000644 0001751 0000171 00000006022 14305600732 020612 0 ustar 00runner docker version: 2.1 apt-run: &apt-install name: Install apt packages command: | sudo apt update sudo apt install -y graphviz build-essential libopenjp2-7 python3-dev pandoc venv: &venv name: Setup venv for the entire job command: | python3 -m venv venv echo "source /home/circleci/project/venv/bin/activate" >> $BASH_ENV jobs: codestyle: docker: - image: cimg/python:3.10 steps: - checkout - run: name: Install pre-commit command: | python -m venv venv . venv/bin/activate pip install -U pip setuptools pip install pre-commit - run: name: Run pre-commit command: | . venv/bin/activate pre-commit install-hooks pre-commit run --color always --all-files --show-diff-on-failure website: docker: - image: cimg/python:3.10 steps: - checkout - run: *apt-install - run: *venv - run: pip install -e . - run: git clone --depth 1 https://github.com/sunpy/sunpy.org.git - run: cd sunpy.org && git submodule update --init && cd .. - run: pip install -r sunpy.org/requirements.txt - run: make -C $HOME/project/sunpy.org html - store_artifacts: path: sunpy.org/_build/html - run: name: "Built documentation is available at:" command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/sunpy.org/_build/html/index.html"; echo $DOCS_URL sunpy: docker: - image: cimg/python:3.10 steps: - checkout - run: *apt-install - run: *venv - run: pip install -e . - run: git clone --depth 1 https://github.com/sunpy/sunpy.git - run: pip install -e sunpy/.[dev] | cat - run: cd sunpy/docs && sphinx-build -D plot_gallery="False" --color -b html -d _build/.doctrees . _build/html - run: rm -r sunpy/docs/_build/html/_sources - store_artifacts: path: sunpy/docs/_build/html - run: name: "Built documentation is available at:" command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/sunpy/docs/_build/html/index.html"; echo $DOCS_URL test_package: docker: - image: cimg/python:3.10 steps: - checkout - run: *apt-install - run: *venv - run: pip install -e . - run: pip install -e test_package/.[docs] - run: cd test_package/docs && make html - store_artifacts: path: test_package/docs/_build/html - run: name: "Built documentation is available at:" command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/test_package/docs/_build/html/index.html"; echo $DOCS_URL css_linting: docker: - image: cimg/node:18.8.0 steps: - checkout - run: npm install --save-dev stylelint stylelint-config-standard - run: npx stylelint "**/*.css" workflows: version: 2 tests: jobs: - codestyle - css_linting - sunpy - test_package - website ././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7571523 sunpy-sphinx-theme-1.2.36/.github/ 0000755 0001751 0000171 00000000000 14305600770 016331 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7571523 sunpy-sphinx-theme-1.2.36/.github/workflows/ 0000755 0001751 0000171 00000000000 14305600770 020366 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/.github/workflows/pythonpublish.yml 0000644 0001751 0000171 00000002171 14305600732 024020 0 ustar 00runner docker name: Upload Python Package on: release: types: [published] 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" ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/.gitignore 0000644 0001751 0000171 00000002405 14305600732 016760 0 ustar 00runner docker # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # dotenv .env # virtualenv .venv venv/ ENV/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ # vim tmp files *~ # test_package test_package/docs/_build test_package/docs/generated test_package/docs/api .history .vscode ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/.pre-commit-config.yaml 0000644 0001751 0000171 00000001542 14305600732 021252 0 ustar 00runner docker ci: autofix_prs: false repos: - repo: https://github.com/psf/black rev: 22.8.0 hooks: - id: black - repo: https://github.com/myint/autoflake rev: v1.5.3 hooks: - id: autoflake args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] - repo: https://github.com/myint/docformatter rev: v1.5.0 hooks: - id: docformatter args: ['--make-summary-multi-line', '--pre-summary-newline', '-ri'] - repo: https://github.com/PyCQA/isort rev: 5.10.1 hooks: - id: isort - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - id: check-ast - id: check-case-conflict - id: check-json - id: check-yaml - id: debug-statements - id: end-of-file-fixer - id: mixed-line-ending args: ['--fix=lf'] - id: trailing-whitespace ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/.stylelintrc.json 0000644 0001751 0000171 00000000261 14305600732 020313 0 ustar 00runner docker { "extends": "stylelint-config-recommended", "rules": { "no-descending-specificity": null, "selector-pseudo-element-no-unknown": null } } ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/LICENSE.md 0000644 0001751 0000171 00000002462 14305600732 016377 0 ustar 00runner docker BSD 2-Clause License Copyright (c) 2018-2019, The SunPy Developers 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 list of conditions and the following disclaimer. * 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. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/MANIFEST.in 0000644 0001751 0000171 00000000427 14305600732 016530 0 ustar 00runner docker include *.txt include *.rst include *.py include sunpy_sphinx_theme/__init__.py # Non-python files. recursive-include sunpy_sphinx_theme * # Extra packages recursive-exclude test_package * prune test_package * # Extraneous files. global-exclude .DS_Store global-exclude *.pyc ././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7611525 sunpy-sphinx-theme-1.2.36/PKG-INFO 0000644 0001751 0000171 00000000762 14305600770 016073 0 ustar 00runner docker Metadata-Version: 2.1 Name: sunpy-sphinx-theme Version: 1.2.36 Summary: The sphinx theme for the SunPy website and documentation. Author: The SunPy Developers License: 2-clause BSD Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: BSD License License-File: LICENSE.md The sphinx theme for the SunPy website and documentation. ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/README.md 0000644 0001751 0000171 00000002001 14305600732 016237 0 ustar 00runner docker # SunPy Sphinx Theme [](https://badge.fury.io/py/sunpy-sphinx-theme) This repository contains the still work in progress sphinx theme for the new website and documentation. To use put this in your `conf.py` file: from sunpy_sphinx_theme.conf import * and make sure you do not have the `html_theme` variable defined elsewhere in `conf.py`. ## Dropdown If you want to add entries to the dropdown menus you can find them in `sunpy_sphinx_theme/conf.py`. If you want to override a link in your build of a project. You should be able to replace the entries in your project's `conf.py`. This should override the URL for the code of conduct. ```python html_theme_option["navbar_links"][0][-1][1] = NEW_URL ``` ## Sidebar We do not have a recursive check for the sidebar on all pages. If you want to add pages to the sidebar you can find ``html_sidebars`` in `sunpy_sphinx_theme/conf.py`. You will want to add to this in your own packages ``conf.py`` ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/pyproject.toml 0000644 0001751 0000171 00000000701 14305600732 017701 0 ustar 00runner docker [build-system] requires = ["setuptools", "setuptools_scm", "wheel"] build-backend = 'setuptools.build_meta' [tool.black] line-length = 110 target-version = ['py39'] include = '\.pyi?$' exclude = ''' /( \.eggs | \.git | \.hg | \.mypy_cache | \.tox | \.venv | _build | buck-out | build | dist | \.history # The following are specific to Black, you probably don't want those. | blib2to3 | tests/data | profiling )/ ''' ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/rebuild_all_rtd.py 0000644 0001751 0000171 00000002673 14305600732 020500 0 ustar 00runner docker """ Run all builds for all active versions of all SunPy and SunPy subprojects on RTD. """ import os import requests BASE_PROJECT = "sunpy" BASE_URL = f"https://readthedocs.org/api/v3/projects/" TOKEN = os.environ["RTD_AUTH_TOKEN"] headers = {"Authorization": f"Token {TOKEN}"} def get_active_versions(project): r = requests.get(BASE_URL + f"{project}/versions", headers=headers, params={"active": True}) if not r.ok: print(f"Failed to get versions for {project}: {r}") return [] r = r.json() if "results" not in r: print(project) print(r) return [] results = r["results"] slugs = [] for res in results: slugs.append(res["slug"]) return slugs def get_all_subprojects(base_project): r = requests.get(BASE_URL + f"{base_project}/subprojects", headers=headers) r = r.json() results = r["results"] projects = [] for res in results: projects.append(res["child"]["slug"]) return projects def rebuild_all_versions_for_project(project): slugs = get_active_versions(project) for slug in slugs: r = requests.post(BASE_URL + f"{project}/versions/{slug}/builds/", headers=headers) if r.status_code != 202: print(f"{slug} failed to build with: {r}") if __name__ == "__main__": projects = [BASE_PROJECT] + get_all_subprojects(BASE_PROJECT) for project in projects: rebuild_all_versions_for_project(project) ././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7611525 sunpy-sphinx-theme-1.2.36/setup.cfg 0000644 0001751 0000171 00000000046 14305600770 016612 0 ustar 00runner docker [egg_info] tag_build = tag_date = 0 ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/setup.py 0000644 0001751 0000171 00000001353 14305600732 016503 0 ustar 00runner docker from setuptools import setup setup( name="sunpy-sphinx-theme", use_scm_version=True, setup_requires=["setuptools_scm"], use_2to3=False, description="The sphinx theme for the SunPy website and documentation.", long_description="The sphinx theme for the SunPy website and documentation.", author="The SunPy Developers", install_requires=["sphinx-bootstrap-theme"], packages=["sunpy_sphinx_theme"], include_package_data=True, license="2-clause BSD", classifiers=[ "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Operating System :: OS Independent", "License :: OSI Approved :: BSD License", ], ) ././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7571523 sunpy-sphinx-theme-1.2.36/sunpy_sphinx_theme/ 0000755 0001751 0000171 00000000000 14305600770 020722 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/sunpy_sphinx_theme/__init__.py 0000644 0001751 0000171 00000000424 14305600732 023031 0 ustar 00runner docker """ SunPy Sphinx Theme. """ import os import sphinx_bootstrap_theme def get_html_theme_path(): """ Return list of HTML theme paths. """ cur_dir = os.path.abspath(os.path.dirname(__file__)) return [cur_dir] + sphinx_bootstrap_theme.get_html_theme_path() ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/sunpy_sphinx_theme/conf.py 0000644 0001751 0000171 00000006100 14305600732 022214 0 ustar 00runner docker import os import socket from urllib.parse import urljoin from sunpy_sphinx_theme import get_html_theme_path html_theme_path = get_html_theme_path() html_theme = "sunpy" html_static_path = [os.path.join(html_theme_path[0], html_theme, "static")] html_extra_path = [os.path.join(html_theme_path[0], html_theme, "static", "img")] templates_path = [os.path.join(html_theme_path[0], html_theme, "templates")] html_favicon = os.path.join(html_static_path[0], "img", "favicon-32.ico") svg_icon = os.path.join(html_static_path[0], "img", "sunpy_icon.svg") png_icon = os.path.join(html_static_path[0], "img", "sunpy_icon_128x128.png") on_rtd = os.environ.get("READTHEDOCS", False) == "True" if on_rtd: sunpy_website_url_base = "https://sunpy.org" else: sunpy_website_url_base = socket.gethostname() def page_url(page): return urljoin(sunpy_website_url_base, page) html_sidebars = { "**": ["docsidebar.html"], } html_theme_options = { "page_toctree_depths": {"generated/gallery": 2}, "on_rtd": on_rtd, "navbar_links": [ ( "About", [ ("Our Mission", page_url("about.html"), 1), ( "Acknowledge SunPy", page_url("about.html") + "#acknowledging-or-citing-sunpy", 1, ), ( "Code of Conduct", page_url("coc.html"), 1, ), ], 1, ), ( "Documentation", [ ("sunpy", "https://docs.sunpy.org/en/stable/", 1), ("aiapy", "https://aiapy.readthedocs.io/en/stable/", 1), ("drms", "https://docs.sunpy.org/projects/drms/", 1), ("ndcube", "https://docs.sunpy.org/projects/ndcube/", 1), ("pfsspy", "https://pfsspy.readthedocs.io/en/stable/", 1), ("pyflct", "https://pyflct.readthedocs.io/en/stable/", 1), ("radiospectra", "https://docs.sunpy.org/projects/radiospectra/en/stable/", 1), ("sunkit-image", "https://docs.sunpy.org/projects/sunkit-image/en/stable/", 1), ("sunraster", "https://docs.sunpy.org/projects/sunraster/en/stable/", 1), ], 1, ), ("Blog", page_url("blog.html"), 1), ("Support Us", page_url("contribute.html"), 1), ("Get Help", page_url("help.html"), 1), ( "SunPy Project", [ ("SunPy Project", page_url("project/"), 1), ("Community Roles", page_url("project/roles.html"), 1), ("Affiliated Packages", page_url("project/affiliated.html"), 1), ("Meetings", page_url("project/meetings.html"), 1), ], 1, ), ], # Only really setup to look nice with 3 values. "footer_links": [ ("GitHub", "https://github.com/sunpy", 1), ("Twitter", "https://twitter.com/SunPyProject", 1), ("Chat", "https://openastronomy.element.io/#/room/#sunpy:openastronomy.org", 1), ], } ././@PaxHeader 0000000 0000000 0000000 00000000034 00000000000 010212 x ustar 00 28 mtime=1662452215.7611525 sunpy-sphinx-theme-1.2.36/sunpy_sphinx_theme/sunpy/ 0000755 0001751 0000171 00000000000 14305600770 022100 5 ustar 00runner docker ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1662452186.0 sunpy-sphinx-theme-1.2.36/sunpy_sphinx_theme/sunpy/docsidebar.html 0000644 0001751 0000171 00000002155 14305600732 025066 0 ustar 00runner docker {% set default_depth = theme_default_toctree_depth | int %} {% set ttree = namespace(depth=default_depth) %} {% for config_prefix, config_depth in theme_page_toctree_depths.items() %} {% if pagename.startswith(config_prefix) %} {% set ttree.depth = config_depth | int %} {% endif %} {% endfor %} {% set toctree = toctree(maxdepth=ttree.depth, collapse=True, includehidden=True) %} {% if toctree %} {% if logo %}
{{ project|e }} {{ release|e }}
{{ toctree }} {% else %}