diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7bbc71c --- /dev/null +++ b/.gitignore @@ -0,0 +1,101 @@ +# 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/ diff --git a/LICENSE b/LICENSE index 48bc965..b6bddd8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,48 @@ -MIT License - -Copyright (c) 2017 Python Packaging Authority - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation; All Rights +Reserved" are retained in Python alone or in any derivative version prepared by +Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..c882441 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include LICENSE README.rst +recursive-include pypa_theme *.* diff --git a/README.md b/README.md deleted file mode 100644 index 172881e..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# pypa-docs-theme -Common base Sphinx theme for PyPA projects diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..c3d919e --- /dev/null +++ b/README.rst @@ -0,0 +1,4 @@ +PyPA Sphinx Theme +================= + +This is the common Sphinx theme for all PyPA projects. diff --git a/pypa_theme/__init__.py b/pypa_theme/__init__.py new file mode 100644 index 0000000..4283981 --- /dev/null +++ b/pypa_theme/__init__.py @@ -0,0 +1,7 @@ +import os + + +def setup(app): + current_dir = os.path.abspath(os.path.dirname(__file__)) + app.add_html_theme( + 'pypa_theme', current_dir) diff --git a/pypa_theme/localtoc.html b/pypa_theme/localtoc.html new file mode 100644 index 0000000..dbfabe1 --- /dev/null +++ b/pypa_theme/localtoc.html @@ -0,0 +1,15 @@ +{# Adapted from sphinx_rtd_theme/layout.html #} +

{{ _('Table Of Contents') }}

+{# + The singlehtml builder doesn't handle this toctree call when the + toctree is empty. Skip building this for now. +#} +{% if theme_global_toc and 'singlehtml' not in builder %} + {% set global_toc = toctree(maxdepth=theme_navigation_depth|int, collapse=theme_collapse_navigation, includehidden=True) %} +{% endif %} +{% if global_toc %} + {{ global_toc }} +{% else %} + {# local toc #} + {{ toc }} +{% endif %} diff --git a/pypa_theme/static/pypa.css b/pypa_theme/static/pypa.css new file mode 100644 index 0000000..0594937 --- /dev/null +++ b/pypa_theme/static/pypa.css @@ -0,0 +1,11 @@ +@import url("pydoctheme.css"); + +/* Highlight active item in global toctree sidebar */ + +.sphinxsidebar li.current > a { + font-weight: bold; +} + +.sphinxsidebar li.current a { + color: #0072aa; +} diff --git a/pypa_theme/theme.conf b/pypa_theme/theme.conf new file mode 100644 index 0000000..0421e6b --- /dev/null +++ b/pypa_theme/theme.conf @@ -0,0 +1,11 @@ +[theme] +inherit = python_docs_theme +stylesheet = pypa.css +pygments_style = sphinx + +[options] +global_toc = True +collapse_navigation = False +navigation_depth = 4 +root_name = PyPA +root_url = https://pypa.io diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..2a9acf1 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ab5d45b --- /dev/null +++ b/setup.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +import io + +from setuptools import setup + +# README into long description +with io.open('README.rst', encoding='utf-8') as readme_file: + long_description = readme_file.read() + + +setup( + name='pypa-theme', + version='0.0.1', + description='The Sphinx theme for PyPA projects', + long_description=long_description, + author='PyPA', + author_email='distutils-sig@python.org', + url='https://pypa.io', + packages=['pypa_theme'], + include_package_data=True, + entry_points={ + 'sphinx.html_themes': [ + 'pypa_theme = pypa_theme', + ] + }, + classifiers=[ + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Python Software Foundation License', + 'Operating System :: OS Independent', + 'Topic :: Documentation', + 'Topic :: Software Development :: Documentation', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + ], +)