Update skel. Add some mock docs for testing.

rc1
Ionel Cristian Mărieș 8 years ago
parent 776c320b85
commit e83951ea25

@ -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'

7
.gitignore vendored

@ -17,6 +17,8 @@ develop-eggs
.installed.cfg
lib
lib64
venv*/
pyvenv*/
# Installer logs
pip-log.txt
@ -24,7 +26,6 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
.coverage
.coverage.*
nosetests.xml
htmlcov
@ -37,6 +38,8 @@ htmlcov
.project
.pydevproject
.idea
*.iml
*.komodoproject
# Complexity
output/*.html
@ -51,5 +54,7 @@ docs/_build
.build
.ve
.env
.cache
.pytest
.bootstrap
*.bak

@ -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

@ -17,8 +17,8 @@ When `reporting a bug <https://github.com/ionelmc/sphinx-py3doc-enhanced-theme/i
Documentation improvements
==========================
Enhanced theme based on py3 documentation's theme could always use more documentation, whether as part of the
official Enhanced theme based on py3 documentation's theme docs, in docstrings, or even on the web in blog posts,
Enhanced Sphinx theme (based on Python 3 docs) could always use more documentation, whether as part of the
official Enhanced Sphinx theme (based on Python 3 docs) docs, in docstrings, or even on the web in blog posts,
articles, and such.
Feature requests and feedback

@ -4,9 +4,9 @@ graft src
graft ci
graft tests
include *.komodoproject
include .bumpversion.cfg
include .coveragerc
include .cookiecutterrc
include .isort.cfg
include .pylintrc
@ -18,4 +18,4 @@ include README.rst
include tox.ini .travis.yml appveyor.yml
global-exclude *.py[co] __pycache__ *.so *.pyd
global-exclude *.py[cod] __pycache__ *.so

@ -1,14 +1,37 @@
=================================================
Enhanced theme based on py3 documentation's theme
=================================================
==============================================
Enhanced Sphinx theme (based on Python 3 docs)
==============================================
| |version| |downloads|
.. list-table::
:stub-columns: 1
.. |version| image:: http://img.shields.io/pypi/v/sphinx-py3doc-enhanced-theme.png?style=flat
* - docs
- |docs|
* - tests
- | |travis| |appveyor|
|
* - package
- |version| |downloads|
.. |docs| image:: https://readthedocs.org/projects/sphinx-py3doc-enhanced-theme/badge/?style=flat
:target: https://readthedocs.org/projects/sphinx-py3doc-enhanced-theme
:alt: Documentation Status
.. |travis| image:: http://img.shields.io/travis/ionelmc/sphinx-py3doc-enhanced-theme/master.svg?style=flat&label=Travis
:alt: Travis-CI Build Status
:target: https://travis-ci.org/ionelmc/sphinx-py3doc-enhanced-theme
.. |appveyor| image:: https://img.shields.io/appveyor/ci/ionelmc/sphinx-py3doc-enhanced-theme/master.svg?style=flat&label=AppVeyor
:alt: AppVeyor Build Status
:target: https://ci.appveyor.com/project/ionelmc/sphinx-py3doc-enhanced-theme
.. |version| image:: http://img.shields.io/pypi/v/sphinx-py3doc-enhanced-theme.svg?style=flat
:alt: PyPI Package latest release
:target: https://pypi.python.org/pypi/sphinx-py3doc-enhanced-theme
.. |downloads| image:: http://img.shields.io/pypi/dm/sphinx-py3doc-enhanced-theme.png?style=flat
.. |downloads| image:: http://img.shields.io/pypi/dm/sphinx-py3doc-enhanced-theme.svg?style=flat
:alt: PyPI Package monthly downloads
:target: https://pypi.python.org/pypi/sphinx-py3doc-enhanced-theme
@ -21,16 +44,16 @@ Installation
::
pip install sphinx_py3doc_enhanced_theme
Add this in your documentation's ``conf.py``::
pip install sphinx-py3doc-enhanced-theme
Documentation
=============
https://sphinx-py3doc-enhanced-theme.readthedocs.org/
import sphinx_py3doc_enhanced_theme
html_theme = "sphinx_py3doc_enhanced_theme"
html_theme_path = [sphinx_py3doc_enhanced_theme.get_html_theme_path()]
Development
===========
Examples
========
To run the all tests run::
* http://python-aspectlib.readthedocs.org/en/latest/
* http://python-manhole.readthedocs.org/en/latest/
tox

@ -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
)

@ -2,22 +2,17 @@
universal = 1
[aliases]
release = register clean --all sdist bdist_wheel upload
release = register clean --all sdist bdist_wheel
[flake8]
max-line-length = 140
exclude = tests/*,*/migrations/*,*/south_migrations/*
[bumpversion]
current_version = 0.1.0
files = setup.py docs/conf.py src/sphinx_py3doc_enhanced_theme/__init__.py
commit = True
tag = True
[pytest]
norecursedirs =
.git
.tox
.env
dist
build
south_migrations
@ -41,46 +36,4 @@ force_single_line=True
line_length=120
known_first_party=sphinx_py3doc_enhanced_theme
default_section=THIRDPARTY
forced_separate=test_sphinx_py3doc_enhanced_theme
[matrix]
# This is the configuration for the `./bootstrap.py` script.
# It generates `.travis.yml`, `tox.ini` and `appveyor.yml`.
#
# Syntax: [alias:] value [!variable[glob]] [&variable[glob]]
#
# alias:
# - is used to generate the tox environment
# - it's optional
# - if not present the alias will be computed from the `value`
# value:
# - a value of "-" means empty
# !variable[glob]:
# - exclude the combination of the current `value` with
# any value matching the `glob` in `variable`
# - can use as many you want
# &variable[glob]:
# - only include the combination of the current `value`
# when there's a value matching `glob` in `variable`
# - can use as many you want
python_versions =
2.6
2.7
3.3
3.4
pypy
dependencies =
# 1.4: Django==1.4.16 !python_versions[3.*]
# 1.5: Django==1.5.11
# 1.6: Django==1.6.8
# 1.7: Django==1.7.1 !python_versions[2.6]
# Deps commented above are provided as examples. That's what you would use in a Django project.
coverage_flags =
: true
nocover: false
environment_variables =
-
forced_separate=test_sphinx_py3doc_enhanced_theme

@ -27,8 +27,8 @@ setup(
version='2.0.2',
license='BSD',
description='A theme based on the theme of https://docs.python.org/3/ with some responsive enhancements.',
long_description='%s\n%s' % (read('README.rst'), re.sub(':obj:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst'))),
author='Ionel Cristian M\xc4\x83rie\xc8\x99',
long_description='%s\n%s' % (read('README.rst'), re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst'))),
author='Ionel Cristian Mărieș',
author_email='contact@ionelmc.ro',
url='https://github.com/ionelmc/sphinx-py3doc-enhanced-theme',
packages=find_packages('src'),
@ -61,8 +61,8 @@ setup(
# eg: 'aspectlib==1.1.1', 'six>=1.7',
],
extras_require={
# eg: 'rst': ['docutils>=0.11'],
},
entry_points={
# eg:
# 'rst': ['docutils>=0.11'],
# ':python_version=="2.6"': ['argparse'],
},
)

@ -0,0 +1 @@
.. include:: ../AUTHORS.rst

@ -0,0 +1 @@
.. include:: ../CHANGELOG.rst

@ -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 @@
.. include:: ../CONTRIBUTING.rst

@ -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…
Cancel
Save