23 changed files with 477 additions and 81 deletions
@ -1,6 +1,8 @@
|
||||
[bumpversion] |
||||
current_version = 2.0.2 |
||||
files = setup.py src/sphinx_py3doc_enhanced_theme/__init__.py |
||||
commit = True |
||||
tag = True |
||||
|
||||
[bumpversion:file:setup.py] |
||||
[bumpversion:file:docs/conf.py] |
||||
[bumpversion:file:src/sphinx_py3doc_enhanced_theme/__init__.py] |
||||
|
@ -0,0 +1,29 @@
|
||||
# This file exists so you can easily regenerate your project. |
||||
# |
||||
# Unfortunatelly cookiecutter can't use this right away so |
||||
# you have to copy this file to ~/.cookiecutterrc |
||||
|
||||
default_context: |
||||
|
||||
c_extension_optional: 'no' |
||||
c_extension_support: 'no' |
||||
codecov: 'no' |
||||
command_line_interface: 'no' |
||||
coveralls: 'no' |
||||
distribution_name: 'sphinx-py3doc-enhanced-theme' |
||||
email: 'contact@ionelmc.ro' |
||||
full_name: 'Ionel Cristian Mărieș' |
||||
github_username: 'ionelmc' |
||||
landscape: 'no' |
||||
package_name: 'sphinx_py3doc_enhanced_theme' |
||||
project_name: 'Enhanced Sphinx theme (based on Python 3 docs)' |
||||
project_short_description: 'A theme based on the theme of https://docs.python.org/3/ with some responsive enhancements.' |
||||
release_date: '2015-07-08' |
||||
repo_name: 'sphinx-py3doc-enhanced-theme' |
||||
scrutinizer: 'no' |
||||
sphinx_theme: 'sphinx-py3doc-enhanced-theme' |
||||
test_matrix_configurator: 'no' |
||||
test_runner: 'pytest' |
||||
version: '2.0.2' |
||||
website: 'http://blog.ionelmc.ro' |
||||
year: '2014-2015' |
@ -0,0 +1,33 @@
|
||||
language: python |
||||
python: 2.7 |
||||
sudo: false |
||||
env: |
||||
global: |
||||
LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so |
||||
matrix: |
||||
- TOXENV=check |
||||
- TOXENV=2.6 |
||||
- TOXENV=2.6-nocover |
||||
- TOXENV=2.7 |
||||
- TOXENV=2.7-nocover |
||||
- TOXENV=3.3 |
||||
- TOXENV=3.3-nocover |
||||
- TOXENV=3.4 |
||||
- TOXENV=3.4-nocover |
||||
- TOXENV=pypy |
||||
- TOXENV=pypy-nocover |
||||
before_install: |
||||
- python --version |
||||
- virtualenv --version |
||||
- pip --version |
||||
- uname -a |
||||
- lsb_release -a |
||||
install: |
||||
- pip install tox |
||||
script: |
||||
- tox -v |
||||
notifications: |
||||
email: |
||||
on_success: never |
||||
on_failure: always |
||||
|
@ -0,0 +1,60 @@
|
||||
version: '{branch}-{build}' |
||||
build: off |
||||
environment: |
||||
global: |
||||
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\ci\\appveyor-with-compiler.cmd" |
||||
matrix: |
||||
- TOXENV: check |
||||
PYTHON_HOME: "C:\\Python27" |
||||
PYTHON_VERSION: "2.7" |
||||
PYTHON_ARCH: "32" |
||||
- TOXENV: "2.7" |
||||
TOXPYTHON: "C:\\Python27\\python.exe" |
||||
WINDOWS_SDK_VERSION: "v7.0" |
||||
PYTHON_HOME: "C:\\Python27" |
||||
PYTHON_VERSION: "2.7" |
||||
PYTHON_ARCH: "32" |
||||
- TOXENV: "2.7-nocover" |
||||
TOXPYTHON: "C:\\Python27\\python.exe" |
||||
WINDOWS_SDK_VERSION: "v7.0" |
||||
PYTHON_HOME: "C:\\Python27" |
||||
PYTHON_VERSION: "2.7" |
||||
PYTHON_ARCH: "32" |
||||
- TOXENV: "3.3" |
||||
TOXPYTHON: "C:\\Python33\\python.exe" |
||||
WINDOWS_SDK_VERSION: "v7.1" |
||||
PYTHON_HOME: "C:\\Python33" |
||||
PYTHON_VERSION: "3.3" |
||||
PYTHON_ARCH: "32" |
||||
- TOXENV: "3.3-nocover" |
||||
TOXPYTHON: "C:\\Python33\\python.exe" |
||||
WINDOWS_SDK_VERSION: "v7.1" |
||||
PYTHON_HOME: "C:\\Python33" |
||||
PYTHON_VERSION: "3.3" |
||||
PYTHON_ARCH: "32" |
||||
- TOXENV: "3.4" |
||||
TOXPYTHON: "C:\\Python34\\python.exe" |
||||
WINDOWS_SDK_VERSION: "v7.1" |
||||
PYTHON_HOME: "C:\\Python34" |
||||
PYTHON_VERSION: "3.4" |
||||
PYTHON_ARCH: "32" |
||||
- TOXENV: "3.4-nocover" |
||||
TOXPYTHON: "C:\\Python34\\python.exe" |
||||
WINDOWS_SDK_VERSION: "v7.1" |
||||
PYTHON_HOME: "C:\\Python34" |
||||
PYTHON_VERSION: "3.4" |
||||
PYTHON_ARCH: "32" |
||||
init: |
||||
- "ECHO %TOXENV%" |
||||
- ps: "ls C:\\Python*" |
||||
install: |
||||
- "powershell ci\\appveyor-bootstrap.ps1" |
||||
test_script: |
||||
- "%PYTHON_HOME%\\Scripts\\tox --version" |
||||
- "%PYTHON_HOME%\\Scripts\\virtualenv --version" |
||||
- "%PYTHON_HOME%\\Scripts\\pip --version" |
||||
- "%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\tox" |
||||
after_test: |
||||
- "IF \"%TOXENV:~-8,8%\" == \"-nocover\" %WITH_COMPILER% %TOXPYTHON% setup.py bdist_wheel" |
||||
artifacts: |
||||
- path: dist\* |
@ -0,0 +1,88 @@
|
||||
# Source: https://github.com/pypa/python-packaging-user-guide/blob/master/source/code/install.ps1 |
||||
# Sample script to install Python and pip under Windows |
||||
# Authors: Olivier Grisel and Kyle Kastner |
||||
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ |
||||
|
||||
$BASE_URL = "https://www.python.org/ftp/python/" |
||||
$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" |
||||
$GET_PIP_PATH = "C:\get-pip.py" |
||||
|
||||
|
||||
function DownloadPython ($python_version, $platform_suffix) { |
||||
$webclient = New-Object System.Net.WebClient |
||||
$filename = "python-" + $python_version + $platform_suffix + ".msi" |
||||
$url = $BASE_URL + $python_version + "/" + $filename |
||||
|
||||
$basedir = $pwd.Path + "\" |
||||
$filepath = $basedir + $filename |
||||
if (Test-Path $filename) { |
||||
Write-Host "Reusing" $filepath |
||||
return $filepath |
||||
} |
||||
|
||||
# Download and retry up to 5 times in case of network transient errors. |
||||
Write-Host "Downloading" $filename "from" $url |
||||
$retry_attempts = 3 |
||||
for($i=0; $i -lt $retry_attempts; $i++){ |
||||
try { |
||||
$webclient.DownloadFile($url, $filepath) |
||||
break |
||||
} |
||||
Catch [Exception]{ |
||||
Start-Sleep 1 |
||||
} |
||||
} |
||||
Write-Host "File saved at" $filepath |
||||
return $filepath |
||||
} |
||||
|
||||
|
||||
function InstallPython ($python_version, $architecture, $python_home) { |
||||
Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home |
||||
if (Test-Path $python_home) { |
||||
Write-Host $python_home "already exists, skipping." |
||||
return $false |
||||
} |
||||
if ($architecture -eq "32") { |
||||
$platform_suffix = "" |
||||
} else { |
||||
$platform_suffix = ".amd64" |
||||
} |
||||
$filepath = DownloadPython $python_version $platform_suffix |
||||
Write-Host "Installing" $filepath "to" $python_home |
||||
$args = "/qn /i $filepath TARGETDIR=$python_home" |
||||
Write-Host "msiexec.exe" $args |
||||
Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru |
||||
Write-Host "Python $python_version ($architecture) installation complete" |
||||
return $true |
||||
} |
||||
|
||||
|
||||
function InstallPip ($python_home) { |
||||
$pip_path = $python_home + "/Scripts/pip.exe" |
||||
$python_path = $python_home + "/python.exe" |
||||
if (-not(Test-Path $pip_path)) { |
||||
Write-Host "Installing pip..." |
||||
$webclient = New-Object System.Net.WebClient |
||||
$webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) |
||||
Write-Host "Executing:" $python_path $GET_PIP_PATH |
||||
Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru |
||||
} else { |
||||
Write-Host "pip already installed." |
||||
} |
||||
} |
||||
|
||||
function InstallPackage ($python_home, $pkg) { |
||||
$pip_path = $python_home + "/Scripts/pip.exe" |
||||
& $pip_path install $pkg |
||||
} |
||||
|
||||
function main () { |
||||
InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON_HOME |
||||
InstallPip $env:PYTHON_HOME |
||||
InstallPackage $env:PYTHON_HOME setuptools |
||||
InstallPackage $env:PYTHON_HOME wheel |
||||
InstallPackage $env:PYTHON_HOME tox |
||||
} |
||||
|
||||
main |
@ -0,0 +1,37 @@
|
||||
:: To build extensions for 64 bit Python 3, we need to configure environment |
||||
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: |
||||
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) |
||||
:: |
||||
:: To build extensions for 64 bit Python 2, we need to configure environment |
||||
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: |
||||
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) |
||||
:: |
||||
:: 32 bit builds do not require specific environment configurations. |
||||
:: |
||||
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the |
||||
:: cmd interpreter, at least for (SDK v7.0) |
||||
:: |
||||
:: More details at: |
||||
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows |
||||
:: http://stackoverflow.com/a/13751649/163740 |
||||
:: |
||||
:: Author: Olivier Grisel |
||||
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ |
||||
@ECHO OFF |
||||
|
||||
SET COMMAND_TO_RUN=%* |
||||
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows |
||||
|
||||
IF "%PYTHON_ARCH%"=="64" ( |
||||
ECHO SDK: %WINDOWS_SDK_VERSION% ARCH: %PYTHON_ARCH% |
||||
SET DISTUTILS_USE_SDK=1 |
||||
SET MSSdk=1 |
||||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% |
||||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release |
||||
ECHO Executing: %COMMAND_TO_RUN% |
||||
call %COMMAND_TO_RUN% || EXIT 1 |
||||
) ELSE ( |
||||
ECHO SDK: %WINDOWS_SDK_VERSION% ARCH: %PYTHON_ARCH% |
||||
ECHO Executing: %COMMAND_TO_RUN% |
||||
call %COMMAND_TO_RUN% || EXIT 1 |
||||
) |
@ -0,0 +1,42 @@
|
||||
# -*- coding: utf-8 -*- |
||||
from __future__ import unicode_literals |
||||
|
||||
import os |
||||
|
||||
|
||||
extensions = [ |
||||
'sphinx.ext.autodoc', |
||||
'sphinx.ext.autosummary', |
||||
'sphinx.ext.todo', |
||||
'sphinx.ext.coverage', |
||||
'sphinx.ext.ifconfig', |
||||
'sphinx.ext.viewcode', |
||||
] |
||||
if os.getenv('SPELLCHECK'): |
||||
extensions += 'sphinxcontrib.spelling', |
||||
spelling_show_suggestions = True |
||||
spelling_lang = 'en_US' |
||||
|
||||
source_suffix = '.rst' |
||||
master_doc = 'index' |
||||
project = 'Enhanced Sphinx theme (based on Python 3 docs)' |
||||
year = '2014-2015' |
||||
author = 'Ionel Cristian Mărieș' |
||||
copyright = '{0}, {1}'.format(year, author) |
||||
version = release = '2.0.2' |
||||
import sphinx_py3doc_enhanced_theme |
||||
html_theme = "sphinx_py3doc_enhanced_theme" |
||||
html_theme_path = [sphinx_py3doc_enhanced_theme.get_html_theme_path()] |
||||
html_theme_options = { |
||||
'githuburl': 'https://github.com/ionelmc/sphinx-py3doc-enhanced-theme/' |
||||
} |
||||
|
||||
pygments_style = 'trac' |
||||
templates_path = ['.'] |
||||
html_use_smartypants = True |
||||
html_last_updated_fmt = '%b %d, %Y' |
||||
html_split_index = True |
||||
html_sidebars = { |
||||
'**': ['searchbox.html', 'globaltoc.html', 'sourcelink.html'], |
||||
} |
||||
html_short_title = '%s-%s' % (project, version) |
@ -0,0 +1,23 @@
|
||||
Welcome to Enhanced Sphinx theme (based on Python 3 docs)'s documentation! |
||||
====================================== |
||||
|
||||
Contents: |
||||
|
||||
.. toctree:: |
||||
:maxdepth: 2 |
||||
|
||||
readme |
||||
installation |
||||
usage |
||||
reference/index |
||||
contributing |
||||
authors |
||||
changelog |
||||
|
||||
Indices and tables |
||||
================== |
||||
|
||||
* :ref:`genindex` |
||||
* :ref:`modindex` |
||||
* :ref:`search` |
||||
|
@ -0,0 +1,7 @@
|
||||
============ |
||||
Installation |
||||
============ |
||||
|
||||
At the command line:: |
||||
|
||||
pip install sphinx-py3doc-enhanced-theme |
@ -0,0 +1,5 @@
|
||||
######## |
||||
Overview |
||||
######## |
||||
|
||||
.. include:: ../README.rst |
@ -0,0 +1,35 @@
|
||||
:mod:`foo.bar` --- Boring lorem ipsum |
||||
===================================== |
||||
|
||||
.. module:: foo.bar |
||||
:synopsis: Some fake module to test rendering |
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In auctor mi odio, quis vehicula quam gravida at. Aliquam |
||||
venenatis ante augue, vel aliquam nulla porttitor a. Donec congue, metus quis viverra ultrices, mauris tellus sagittis |
||||
lectus, ac varius felis est nec sem. Etiam quis condimentum dui, non mollis nisi. Donec vehicula laoreet lorem et |
||||
dapibus. Etiam faucibus pulvinar nulla in lobortis. Fusce in ultricies lectus. Nulla felis leo, tristique vel venenatis |
||||
eget, placerat sit amet turpis. Nullam eget arcu vel ipsum finibus porttitor non nec quam. |
||||
|
||||
.. seealso:: |
||||
|
||||
The :mod:`foobar` offers some more lorem ipsum. |
||||
|
||||
.. note:: |
||||
|
||||
Pellentesque elementum convallis ``$nibh``, et semper nunc ornare et. Ut posuere condimentum auctor. Pellentesque |
||||
ultricies nisi pellentesque ipsum tempus varius. Donec in tempor turpis, imperdiet euismod ligula. Vivamus ut tellus |
||||
augue. Nunc porta porttitor purus non viverra. Cras in ante sed nibh pulvinar mattis in a neque. Lorem ipsum dolor |
||||
sit amet, consectetur adipiscing elit. Suspendisse potenti. Aenean tristique congue nibh tincidunt sodales. In |
||||
porttitor rhoncus lacus, sit amet condimentum tellus lacinia vel. |
||||
|
||||
.. function:: bob(val) |
||||
|
||||
Sed pellentesque pretium magna, in ``{"pulvinar": "justo"}`` bibendum at. Aliquam at leo non urna mollis consequat |
||||
nec in felis. Duis dui magna, ultrices eget nisl non, dapibus pretium risus. Proin eget risus eget est tempor |
||||
dictum. Duis vehicula faucibus leo ac luctus. Nulla lobortis neque non aliquet hendrerit. |
||||
|
||||
.. function:: lorem(ipsum) |
||||
|
||||
Nulla volutpat dignissim maximus. Nunc at erat sem. Proin justo augue, porttitor a erat non, elementum dignissim sem. |
||||
Vestibulum hendrerit aliquam scelerisque. Aenean bibendum nibh id neque interdum, nec cursus ligula dapibus. Ut in |
||||
nulla sit amet sem pretium tristique non vel ante. |
@ -0,0 +1,11 @@
|
||||
builtin |
||||
builtins |
||||
classmethod |
||||
staticmethod |
||||
classmethods |
||||
staticmethods |
||||
args |
||||
kwargs |
||||
callstack |
||||
Changelog |
||||
Indices |
@ -0,0 +1,7 @@
|
||||
===== |
||||
Usage |
||||
===== |
||||
|
||||
To use Enhanced Sphinx theme (based on Python 3 docs) in a project:: |
||||
|
||||
import sphinx_py3doc_enhanced_theme |
@ -1,14 +1,47 @@
|
||||
; a generative tox configuration, see: https://testrun.org/tox/latest/config.html#generative-envlist |
||||
|
||||
[tox] |
||||
envlist = check |
||||
envlist = |
||||
check, |
||||
docs-{2.7,3.4} |
||||
|
||||
[testenv] |
||||
basepython = |
||||
{spell,2.7}: {env:TOXPYTHON:python2.7} |
||||
{check,3.4}: {env:TOXPYTHON:python3.4} |
||||
setenv = |
||||
PYTHONPATH={toxinidir}/tests |
||||
PYTHONUNBUFFERED=yes |
||||
passenv = |
||||
* |
||||
deps = |
||||
sphinx |
||||
commands = |
||||
2.7: sphinx-build {posargs:-E} -b html tests dist/docs-2.7 |
||||
3.4: sphinx-build {posargs:-E} -b html tests dist/docs-3.4 |
||||
usedevelop = true |
||||
|
||||
[testenv:spell] |
||||
setenv = |
||||
SPELLCHECK=1 |
||||
commands = |
||||
sphinx-build -b spelling docs dist/docs |
||||
usedevelop = true |
||||
deps = |
||||
-r{toxinidir}/docs/requirements.txt |
||||
sphinxcontrib-spelling |
||||
pyenchant |
||||
|
||||
[testenv:check] |
||||
basepython = python3.4 |
||||
deps = |
||||
docutils |
||||
check-manifest |
||||
flake8 |
||||
usedevelop = true |
||||
readme |
||||
pygments |
||||
skip_install = true |
||||
commands = |
||||
python setup.py check --restructuredtext --strict --metadata |
||||
python setup.py check --strict --metadata --restructuredtext |
||||
check-manifest {toxinidir} |
||||
flake8 src |
||||
flake8 src |
Loading…
Reference in new issue