Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish docs and change theme #4758

Merged
merged 11 commits into from
Oct 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dist/
MANIFEST

# Documentation
docs/_build/
docs/build/

# mypy
.mypy_cache/
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ recursive-exclude src/pip/_vendor *.pyi

prune .github
prune .travis
prune docs/_build
prune docs/build
prune news
prune contrib
prune tasks
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
BUILDDIR = build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand Down
29 changes: 15 additions & 14 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# intersphinx
intersphinx_cache_limit = 0
intersphinx_mapping = {
'pypug': ('https://packaging.python.org/en/latest/', None),
'pypug': ('https://packaging.python.org/', None),
'pypa': ('https://www.pypa.io/en/latest/', None),
}

Expand All @@ -52,7 +52,7 @@

# General information about the project.
project = 'pip'
copyright = '2008-2016, PyPA'
copyright = '2008-2017, PyPA'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -83,7 +83,7 @@

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_patterns = ['_build/', 'man/']
exclude_patterns = ['build/', 'man/']

# The reST default role (used for this markup: `text`) to use for all documents
# default_role = None
Expand Down Expand Up @@ -114,19 +114,17 @@

# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'default'
if not on_rtd:
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
pass
html_theme = "pypa_theme"

# 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
# documentation.
# html_theme_options = {}
html_theme_options = {
'collapsiblesidebar': True,
'externalrefs': True,
'navigation_depth': 2,
'issues_url': 'https://github.com/pypa/pip/issues'
}

# Add any paths that contain custom themes here, relative to this directory.

Expand Down Expand Up @@ -157,10 +155,13 @@

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = False
smart_quotes = False

# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
html_sidebars = {
'**': ['localtoc.html', 'relations.html'],
'index': ['localtoc.html']
}

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `PyPA recommended <https://packaging.python.org/en/latest/current/>`_ tool
for installing Python packages.

.. toctree::
:maxdepth: 2
:maxdepth: 1

quickstart
installing
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Reference Guide
===============

.. toctree::
:maxdepth: 2
:maxdepth: 1

pip
pip_install
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pip
---

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_check.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
pip check
---------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
pip config
------------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
pip download
------------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_freeze.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
pip freeze
-----------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_hash.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
pip hash
------------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
pip install
-----------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
pip list
---------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
pip search
----------

.. contents::

Usage
*****

Expand Down
3 changes: 0 additions & 3 deletions docs/reference/pip_show.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
pip show
--------

.. contents::


Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_uninstall.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
pip uninstall
-------------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/pip_wheel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
pip wheel
---------

.. contents::

Usage
*****

Expand Down
2 changes: 0 additions & 2 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
User Guide
==========

.. contents::

Running pip
***********

Expand Down
1 change: 1 addition & 0 deletions news/4758.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change documentation theme to be in line with Python Documentation
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ commands = py.test --timeout 300 []
install_command = python -m pip install {opts} {packages}

[testenv:docs]
deps = sphinx == 1.6.1
deps =
sphinx == 1.6.1
git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme
git+https://github.com/pypa/pypa-docs-theme.git#egg=pypa-docs-theme

basepython = python2.7
commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
sphinx-build -W -b man -d {envtmpdir}/doctrees docs docs/_build/man
sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/build/html
sphinx-build -W -b man -d {envtmpdir}/doctrees docs docs/build/man

[testenv:packaging]
deps =
Expand Down