dask_sphinx_theme-3.0.5/ 0000755 0001751 0000173 00000000000 14437642624 016031 5 ustar runner docker 0000000 0000000 dask_sphinx_theme-3.0.5/LICENSE.txt 0000644 0001751 0000173 00000002672 14437642600 017655 0 ustar runner docker 0000000 0000000 Copyright (c) 2018 Dask 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.
Neither the name of Anaconda nor the names of any contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
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 OWNER 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.
dask_sphinx_theme-3.0.5/MANIFEST.in 0000644 0001751 0000173 00000000711 14437642600 017560 0 ustar runner docker 0000000 0000000 recursive-include dask_sphinx_theme *.py
recursive-include dask_sphinx_theme *.html
recursive-include dask_sphinx_theme *.css
recursive-include dask_sphinx_theme *.svg
recursive-include dask_sphinx_theme *.png
recursive-include dask_sphinx_theme *.ico
recursive-include dask_sphinx_theme *.conf
include setup.py
include requirements.txt
include README.rst
include LICENSE.txt
include MANIFEST.in
include versioneer.py
include dask_sphinx_theme/_version.py
dask_sphinx_theme-3.0.5/PKG-INFO 0000644 0001751 0000173 00000003426 14437642624 017133 0 ustar runner docker 0000000 0000000 Metadata-Version: 1.0
Name: dask_sphinx_theme
Version: 3.0.5
Summary: Dask theme for Sphinx
Home-page: https://github.com/dask/dask-sphinx-theme/
Author: Dask Developers
Author-email: UNKNOWN
License: BSD
Description: Dask Sphinx Theme
=================
This is the official Sphinx theme for Dask documentation. It extends the
``sphinx-book-theme`` project, but adds custom styling and a navigation bar to
additional Dask subprojects.
When creating a Dask subproject you can include this theme by changing this
line in your conf.py file
.. code-block:: python
html_theme = 'dask_sphinx_theme'
And by including ``dask_sphinx_theme`` as a requirement in your documentation
installation.
Releasing
---------
This project `uses GitHub Actions `_
to automatically push a new release to PyPI whenever
a git tag is pushed. For example, to release a new ``x.y.z`` version of
``dask-sphinx-theme``, checkout the commit you would like to release,
add a git tag, and push the tag to the ``main`` branch of the
``dask/dask-sphinx-theme`` repository:
.. code-block::
$ git checkout main
$ git tag -a x.y.z -m 'Version x.y.z'
$ git push upstream main --tags
After a new release is published on PyPI, a pull request to the ``dask-sphinx-theme``
`conda-forge feedstock `_
for the new ``x.y.z`` release will automatically be opened by conda-forge bots.
Platform: UNKNOWN
dask_sphinx_theme-3.0.5/README.rst 0000644 0001751 0000173 00000002411 14437642600 017510 0 ustar runner docker 0000000 0000000 Dask Sphinx Theme
=================
This is the official Sphinx theme for Dask documentation. It extends the
``sphinx-book-theme`` project, but adds custom styling and a navigation bar to
additional Dask subprojects.
When creating a Dask subproject you can include this theme by changing this
line in your conf.py file
.. code-block:: python
html_theme = 'dask_sphinx_theme'
And by including ``dask_sphinx_theme`` as a requirement in your documentation
installation.
Releasing
---------
This project `uses GitHub Actions `_
to automatically push a new release to PyPI whenever
a git tag is pushed. For example, to release a new ``x.y.z`` version of
``dask-sphinx-theme``, checkout the commit you would like to release,
add a git tag, and push the tag to the ``main`` branch of the
``dask/dask-sphinx-theme`` repository:
.. code-block::
$ git checkout main
$ git tag -a x.y.z -m 'Version x.y.z'
$ git push upstream main --tags
After a new release is published on PyPI, a pull request to the ``dask-sphinx-theme``
`conda-forge feedstock `_
for the new ``x.y.z`` release will automatically be opened by conda-forge bots.
dask_sphinx_theme-3.0.5/dask_sphinx_theme/ 0000755 0001751 0000173 00000000000 14437642624 021526 5 ustar runner docker 0000000 0000000 dask_sphinx_theme-3.0.5/dask_sphinx_theme/__init__.py 0000644 0001751 0000173 00000001032 14437642600 023625 0 ustar runner docker 0000000 0000000 from os import path
from . import _version
__version__ = _version.get_versions()["version"]
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
return cur_dir
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
def setup(app):
app.add_html_theme("dask_sphinx_theme", path.abspath(path.dirname(__file__)))
return {
"parallel_read_safe": True,
"parallel_write_safe": True,
}
dask_sphinx_theme-3.0.5/dask_sphinx_theme/_pygments/ 0000755 0001751 0000173 00000000000 14437642624 023533 5 ustar runner docker 0000000 0000000 dask_sphinx_theme-3.0.5/dask_sphinx_theme/_pygments/style.py 0000644 0001751 0000173 00000010374 14437642600 025244 0 ustar runner docker 0000000 0000000 from pygments.style import Style
from pygments.token import (
Keyword,
Name,
Comment,
Error,
Number,
Operator,
Generic,
Whitespace,
Punctuation,
Literal,
String,
)
class DaskStyle(Style):
default_style = ""
background_color = "#ffffff"
green = "#17955C"
blue = "#1F5AFF"
red = "#EF1161"
purple = "#F61FFF"
salmon = "#FC6E6B"
dusty_blue = "#183D72"
black = "#080815"
styles = {
# No corresponding class for the following:
# Text: "", # class: ''
Whitespace: "#ffffff", # class: 'w'
Error: f"bold {salmon}", # class: 'err'
Comment: f"italic {dusty_blue}", # class: 'c'
Comment.Multiline: f"italic {dusty_blue}", # class: 'cm'
Comment.Preproc: f"italic {dusty_blue}", # class: 'cp'
Comment.Single: f"italic {dusty_blue}", # class: 'c1'
Comment.Special: f"italic {dusty_blue}", # class: 'cs'
Keyword: f"bold {green}", # class: 'k'
Keyword.Constant: f"bold {green}", # class: 'kc'
Keyword.Declaration: f"bold {green}", # class: 'kd'
Keyword.Namespace: f"bold {green}", # class: 'kn'
Keyword.Pseudo: f"bold {green}", # class: 'kp'
Keyword.Reserved: f"bold {green}", # class: 'kr'
Keyword.Type: f"bold {green}", # class: 'kt'
Operator: black, # class: 'o'
Operator.Word: f"bold {purple}", # class: 'ow' - like keywords
Punctuation: black, # class: 'p'
# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
Name: black, # class: 'n'
Name.Attribute: salmon, # class: 'na' - to be revised
Name.Builtin: green, # class: 'nb'
Name.Builtin.Pseudo: green, # class: 'bp'
Name.Class: f"bold {blue}", # class: 'nc' - to be revised
Name.Constant: black, # class: 'no' - to be revised
Name.Decorator: purple, # class: 'nd' - to be revised
Name.Entity: salmon, # class: 'ni'
Name.Exception: f"bold {salmon}", # class: 'ne'
Name.Function: blue, # class: 'nf'
Name.Property: black, # class: 'py'
Name.Label: salmon, # class: 'nl'
Name.Namespace: f"bold {blue}", # class: 'nn' - to be revised
Name.Other: black, # class: 'nx'
Name.Tag: f"bold {green}", # class: 'nt' - like a keyword
Name.Variable: black, # class: 'nv' - to be revised
Name.Variable.Class: black, # class: 'vc' - to be revised
Name.Variable.Global: black, # class: 'vg' - to be revised
Name.Variable.Instance: black, # class: 'vi' - to be revised
# since the tango light blue does not show up well in text, we choose
# a pure blue instead.
Number: black, # class: 'm'
Number.Float: black, # class: 'mf'
Number.Hex: black, # class: 'mh'
Number.Integer: black, # class: 'mi'
Number.Integer.Long: black, # class: 'il'
Number.Oct: black, # class: 'mo'
Literal: black, # class: 'l'
Literal.Date: black, # class: 'ld'
String: red, # class: 's'
String.Backtick: red, # class: 'sb'
String.Char: red, # class: 'sc'
String.Doc: f"italic {dusty_blue}", # class: 'sd' - like a comment
String.Double: red, # class: 's2'
String.Escape: red, # class: 'se'
String.Heredoc: red, # class: 'sh'
String.Interpol: red, # class: 'si'
String.Other: red, # class: 'sx'
String.Regex: red, # class: 'sr'
String.Single: red, # class: 's1'
String.Symbol: red, # class: 'ss'
Generic: black, # class: 'g'
Generic.Deleted: salmon, # class: 'gd'
Generic.Emph: f"italic {black}", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: f"bold {green}", # class: 'gh'
Generic.Inserted: green, # class: 'gi'
Generic.Output: black, # class: 'go'
Generic.Prompt: black, # class: 'gp'
Generic.Strong: f"bold {black}", # class: 'gs'
Generic.Subheading: f"bold {purple}", # class: 'gu'
Generic.Traceback: f"bold {salmon}", # class: 'gt'
}
dask_sphinx_theme-3.0.5/dask_sphinx_theme/_version.py 0000644 0001751 0000173 00000000761 14437642624 023730 0 ustar runner docker 0000000 0000000
# This file was generated by 'versioneer.py' (0.21) from
# revision-control system data, or from the parent directory name of an
# unpacked source archive. Distribution tarballs contain a pre-generated copy
# of this file.
import json
version_json = '''
{
"date": "2023-06-06T11:05:10+0100",
"dirty": false,
"error": null,
"full-revisionid": "30f977de873e11e47c80b35486710425a8cebced",
"version": "3.0.5"
}
''' # END VERSION_JSON
def get_versions():
return json.loads(version_json)
dask_sphinx_theme-3.0.5/dask_sphinx_theme/ext/ 0000755 0001751 0000173 00000000000 14437642624 022326 5 ustar runner docker 0000000 0000000 dask_sphinx_theme-3.0.5/dask_sphinx_theme/ext/dask_config_sphinx_ext.py 0000644 0001751 0000173 00000005154 14437642600 027417 0 ustar runner docker 0000000 0000000 import requests
import yaml
from docutils import nodes
from docutils.parsers.rst import Directive, directives
def get_remote_yaml(url):
r = requests.get(url)
return yaml.safe_load(r.text)
class DaskConfigDirective(Directive):
option_spec = {
"location": directives.unchanged,
"schema": directives.uri,
"config": directives.uri,
}
def run(self):
location = self.options["location"]
config = self.options["config"]
schema = self.options["schema"]
config = get_remote_yaml(config)
schema = get_remote_yaml(schema)
for k in location.split("."):
# dask config does not have a top level key
# we need to pass full schema and config
if k == "dask":
schema = schema
config = config
else:
config = config[k]
schema = schema["properties"].get(k, {})
html = generate_html(config, schema, location)
return [nodes.raw("", html, format="html")]
def setup(app):
app.add_directive("dask-config-block", DaskConfigDirective)
return {
"version": "0.1",
"parallel_read_safe": True,
"parallel_write_safe": True,
}
def dask_config_to_html(key, value, schema, prefix=""):
if isinstance(value, dict):
return sum(
(
dask_config_to_html(
k,
v,
schema.get("properties", {}).get(k, {"properties": {}}),
prefix=prefix + key + ".",
)
for k, v in value.items()
),
[],
)
else:
try:
description = schema["description"]
description = description.strip()
except KeyError:
description = "No Comment"
if "dask." in prefix:
prefix = prefix.replace("dask.", "")
key = prefix + key
value = str(value)
node = f"""