瀏覽代碼

Import nameko theme

commit: 0fee483ff8
from github.com/nameko/sphinx-nameko-theme
master
Dimitri Merejkowsky 4 年之前
父節點
當前提交
06b6ec7852
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 6BF3C7EA7C2D64EC
共有 17 個文件被更改,包括 1452 次插入0 次删除
  1. +14
    -0
      cours/theme/nameko/.gitignore
  2. +20
    -0
      cours/theme/nameko/.travis.yml
  3. +20
    -0
      cours/theme/nameko/LICENSE
  4. +5
    -0
      cours/theme/nameko/MANIFEST.in
  5. +56
    -0
      cours/theme/nameko/README.rst
  6. +153
    -0
      cours/theme/nameko/docs/Makefile
  7. +76
    -0
      cours/theme/nameko/docs/source/conf.py
  8. +88
    -0
      cours/theme/nameko/docs/source/example.py
  9. +323
    -0
      cours/theme/nameko/docs/source/index.rst
  10. +29
    -0
      cours/theme/nameko/setup.py
  11. +13
    -0
      cours/theme/nameko/sphinx_nameko_theme/__init__.py
  12. +19
    -0
      cours/theme/nameko/sphinx_nameko_theme/nameko/layout.html
  13. +14
    -0
      cours/theme/nameko/sphinx_nameko_theme/nameko/reference.html
  14. +19
    -0
      cours/theme/nameko/sphinx_nameko_theme/nameko/relations.html
  15. +530
    -0
      cours/theme/nameko/sphinx_nameko_theme/nameko/static/nameko.css_t
  16. +70
    -0
      cours/theme/nameko/sphinx_nameko_theme/nameko/static/pygments.css
  17. +3
    -0
      cours/theme/nameko/sphinx_nameko_theme/nameko/theme.conf

+ 14
- 0
cours/theme/nameko/.gitignore 查看文件

@@ -0,0 +1,14 @@
# Project files
docs/build
.coverage
.tox

# Python compiled files
*.py[cod]

# Python packages
*.egg
*.egg-info
dist
build
__pycache__

+ 20
- 0
cours/theme/nameko/.travis.yml 查看文件

@@ -0,0 +1,20 @@
sudo: false
language: python

python:
- '2.7'

install:
- pip install -e .

script:
- sphinx-build -nW -b html -d docs/build/doctrees docs/source docs/build

deploy:
provider: pypi
user: onefinestay
password:
secure: iRIzqEHs1E6FkV91LbReCsNuSo40+xp1B97UnA8rlP5l3LGA6Msv7wsO6SYK5ISrp5vF34hBEPx9SguQWYhNylvQZoELQ2xv+6ST9YT5xo6QeOoWDPW97mXwMQ4ZeR1+4ekqg7rT28NkGe6VfWsLl7FAPd1AQiOD9Rlv5UAu9Lg=
on:
tags: true
repo: onefinestay/sphinx-nameko-theme

+ 20
- 0
cours/theme/nameko/LICENSE 查看文件

@@ -0,0 +1,20 @@
Copyright (c) 2013 Ignacy Sokołowski
2015 Lifealike, Ltd. DBA onefinestay

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.

+ 5
- 0
cours/theme/nameko/MANIFEST.in 查看文件

@@ -0,0 +1,5 @@
include README.rst
include LICENSE
recursive-include sphinx_nameko_theme *
recursive-include docs Makefile
recursive-include docs/source *.py *.rst

+ 56
- 0
cours/theme/nameko/README.rst 查看文件

@@ -0,0 +1,56 @@
===================
Sphinx Nameko Theme
===================

Official sphinx theme for `nameko <https://github.com/onefinestay/nameko>`_.

Forked from `Sphinx Readable Theme <https://github.com/ignacysokolowski/sphinx-readable-theme>`_, combined with elements of the `Read The Docs <https://github.com/snide/sphinx_rtd_theme>`_ theme.


Installation and setup
======================


Install from PyPI::

$ pip install sphinx-nameko-theme

And add this to your Sphinx ``conf.py``:

.. code-block:: python

import sphinx_nameko_theme

html_theme_path = [sphinx_nameko_theme.get_html_theme_path()]
html_theme = 'nameko'


Example
=======

The official `nameko <https://nameko.readthedocs.org>`_ documentation uses this theme.

License
=======

Sphinx Nameko Theme is licensed under the MIT license.


Changelog
=========

Version 0.0.3
-------------

Add colours to admonitions
Nicer styles for inline literals

Version 0.0.2
-------------

Remove symlink confusing ReadTheDocs

Version 0.0.1
-------------

Initial fork

+ 153
- 0
cours/theme/nameko/docs/Makefile 查看文件

@@ -0,0 +1,153 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
-rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/SphinxNamekoTheme.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/SphinxNamekoTheme.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/SphinxNamekoTheme"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/SphinxNamekoTheme"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

+ 76
- 0
cours/theme/nameko/docs/source/conf.py 查看文件

@@ -0,0 +1,76 @@
# -*- coding: utf-8 -*-
"""Sphinx Readable Theme documentation build configuration file.

This file is execfile()d with the current directory set to its containing dir.

"""

import os
import sys
import pkg_resources


# Adding this directory to the sys path, to build autodoc of example module.
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))


# -- General configuration ----------------------------------------------------

# Defining Sphinx extension modules.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']

autodoc_default_flags = ['members', 'show-inheritance']
autodoc_member_order = 'bysource'

# Don't display module names before objects titles, it's more readable.
add_module_names = False

intersphinx_mapping = {
'python': ('http://docs.python.org/2.7', None),
}

# The suffix of source filenames.
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Sphinx Nameko Theme'
copyright = u'2015'

# The version info for the project, acts as replacement for |version| and
# |release|, also used in various other places throughout the built documents.
#
# The short X.Y version.
version = pkg_resources.get_distribution('sphinx_nameko_theme').version
# The full version, including alpha/beta/rc tags.
release = version

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- Options for HTML output --------------------------------------------------

# The theme to use for HTML and HTML Help pages.
html_theme = 'nameko'

# Output file base name for HTML help builder.
htmlhelp_basename = 'sphinxnamekothemedoc'


# -- Options for manual page output -------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(
'index',
'Sphinx Nameko Theme',
u'Sphinx Nameko Theme Documentation',
[u'onefinestay'],
1,
)
]

+ 88
- 0
cours/theme/nameko/docs/source/example.py 查看文件

@@ -0,0 +1,88 @@
"""An example module to show autodoc style.

Contains an example constant, :class:`Storage` class for storing objects and
helper function :func:`store_integers` for storing only integers.

"""

import datetime


#: Example integer constant.
INT_CONSTANT = 1
#: Example integer constant.
STR_CONSTANT = 'string'


class Storage(object):

"""A class for storing objects.

This is an example class to show autodoc style.

It stores a list of objects and saves date of last appended item.
Example usage::

>>> storage = Storage(['foo', 'bar'])
>>> storage.items
['foo', 'bar']
>>> storage.last_updated
datetime.datetime(2013, 8, 15, 13, 41, 38, 515797)
>>> storage.add_item('baz')
>>> storage.items
['foo', 'bar', 'baz']
>>> storage.last_updated
datetime.datetime(2013, 8, 15, 13, 41, 40, 595544)

:param items:
Optional list of items to start with.

"""

def __init__(self, items=None):
#: List of items, add new item using :meth:`add_item`.
self.items = items or []
#: :py:class:`datetime.datetime` of last item update, will be set
#: to :py:meth:`datetime.datetime.now` on object instantiation.
self.last_updated = datetime.datetime.now()

def add_item(self, item):
"""Append item to the list.

:attr:`last_updated` will be set to :py:meth:`datetime.datetime.now`.

:param item:
Something to append to :attr:`items`.

"""
self.items.append(item)
self.last_updated = datetime.datetime.now()


def store_integers(items, allow_zero=True):
"""Store integers from the given list in a storage.

This is an example function to show autodoc style.

Return :class:`Storage` instance with integers from the given list.

Examples::

>>> storage = store_integers([1, 'foo', 2, 'bar', 0])
>>> storage.items
[1, 2, 0]
>>> storage = store_integers([1, 'foo', 2, 'bar', 0], allow_zero=False)
>>> storage.items
[1, 2]

:param items:
List of objects of any type, only :class:`int` instances will be
stored.
:param allow_zero:
Boolean -- if ``False``, ``0`` integers will be skipped.
Defaults to ``True``.

"""
ints = [x for x in items if isinstance(x, int) and (allow_zero or x != 0)]
storage = Storage(ints)
return storage

+ 323
- 0
cours/theme/nameko/docs/source/index.rst 查看文件

@@ -0,0 +1,323 @@
===================
Sphinx Nameko Theme
===================

A fork of `Sphinx Readable Theme <https://github.com/ignacysokolowski/sphinx-readable-theme>`_ for use in `Nameko <https://github.com/onefinestay/nameko>`_.


Installation and setup
======================


Install from PyPI::

$ pip install sphinx-nameko-theme

And add this to your ``conf.py``:

.. code-block:: python

import sphinx_nameko_theme

html_theme_path = [sphinx_nameko_theme.get_html_theme_path()]
html_theme = 'nameko'


License
=======

Sphinx Nameko Theme is licensed under the MIT license.


Changelog
=========

Version 0.0.1
-------------

First release.


Theme style
===========

.. index::
single: Headings

Headings
--------

.. raw:: html

<h1>H1: Lorem ipsum dolor sit amet</h1>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

.. raw:: html

<h2>H2: Lorem ipsum dolor sit amet</h2>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

.. raw:: html

<h3>H3: Lorem ipsum dolor sit amet</h3>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

.. raw:: html

<h4>H4: Lorem ipsum dolor sit amet</h4>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

.. raw:: html

<h5>H5: Lorem ipsum dolor sit amet</h5>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

.. raw:: html

<h6>H6: Lorem ipsum dolor sit amet</h6>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.


.. index::
single: Paragraphs

Paragraphs
----------

Duis **aute irure dolor** in `reprehenderit` in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

`Lorem ipsum`_ dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat `cupidatat`_
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.



.. _footnotes:

Footnotes
---------

.. target-notes::

.. _Lorem ipsum: http://www.google.com
.. _`cupidatat`: http://docutils.sourceforge.net/rst.html


.. index::
single: Tables

Tables
------

+----------------------+------------------------------------------------+
| Header row, column 1 | Header row, column 2 |
+======================+================================================+
| body row 1 | Second column of row 1 |
+----------------------+------------------------------------------------+
| body row 2 | Second column of row 2 |
| | |
| | Second line of paragraph |
+----------------------+------------------------------------------------+
| body row 3 | Unordered list: |
| | |
| | * Second column of row 3 |
| | * Second item in bullet list (row 3, column 2) |
+----------------------+------------------------------------------------+
| \ | Row 4; column 1 will be empty |
+----------------------+------------------------------------------------+


.. index::
single: Lists

Lists
-----

Unordered list
~~~~~~~~~~~~~~

* Lorem ipsum
* Dolor sit amet

* Dolor
* Sit
* Amet

* Consectetur adipiscing elit

Ordered list
~~~~~~~~~~~~

#. Lorem ipsum
#. Dolor sit amet

#. Dolor
#. Sit
#. Amet

#. Consectetur adipiscing elit

Definition Lists
~~~~~~~~~~~~~~~~

Lorem
Lorem ipsum dolor sit amet.
Ipsum
Ipsum dolor amet sit.
Dolor : classifier
Dolor lorem ipsum.
Sit amet : classifier one : classifier two
Sit amet consectetur adipiscing elit.


.. index::
single: Topics

.. _topic:

Topics
------

.. topic:: Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.

Sidebars
--------

.. sidebar:: Sidebar title

Lorem ipsum dolor sit amet, nunc iaculis nulla molestie neque varius vulputate. Aenean hendrerit condimentum arcu ut porta.

Nullam ac velit lobortis, tincidunt est varius, condimentum lectus. In eu sapien nec lacus interdum ultricies. Aliquam in luctus metus. Nulla mattis, sem quis fringilla pharetra, dui eros consequat velit, at bibendum Mauris sed velit non nibh aliquet mattis.

Mauris sed velit non nibh aliquet mattis. Nullam ac velit lobortis, tincidunt est varius, condimentum lectus. In eu sapien nec lacus interdum ultricies. Aliquam in luctus metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.


.. index::
single: Admonitions

.. _admonitions:

Admonitions
-----------

.. admonition:: Admonition title

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. attention::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. caution::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. danger::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. error::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. hint::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. important::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. note::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. seealso::

Module :py:mod:`zipfile`
Documentation of the :py:mod:`zipfile` standard module.

`GNU tar manual, Basic Tar Format <http://link>`_
Documentation for tar archive files, including GNU tar extensions.

.. tip::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

.. warning::
Lorem ipsum dolor sit amet, consectetur adipisicing elit.


.. index::
single: Code

Code
----

.. code-block:: python

"""An example module docstring to show Pygments style."""

# Some comment.

import datetime
from functools import partial

number = 123
word = 'foo'


class ExampleClass(object):

"""An example class docstring to show Pygments style."""

def __init__(self, arg1, arg2=None, *args, **kwargs):
self.attr1 = attr1
self.attr2 = attr2 or datetime.datetime.now()
for arg in args:
print('Argument: '.format(arg))
for k, v in kwargs.iteritems():
print('Keyword argument named {}: {}'.format(k, v))

def call_method(self, arg):
"""An example method docstring."""
if not isinstance(arg, int):
raise ValueError('Only ints allowed.')
self.attr1 = arg

@property
def example_property(self):
"""An example property docstring."""
return self.attr1 * 2


def example_function(arg1, arg2=None, *args, **kwargs):
"""An example function docstring to show Pygments style."""
raise NotImplementedError()


.. index::
single: Autodoc

Autodoc
~~~~~~~

.. automodule:: example

+ 29
- 0
cours/theme/nameko/setup.py 查看文件

@@ -0,0 +1,29 @@
from setuptools import setup

setup(
name='sphinx-nameko-theme',
version='0.0.3',
author='onefinestay',
author_email='nameko-devs@onefinestay.com',
description='Sphinx Nameko Theme',
url='https://github.com/onefinestay/sphinx-nameko-theme',
license='MIT',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet',
'Topic :: Software Development :: Documentation',
],
packages=['sphinx_nameko_theme'],
install_requires=['sphinx'],
entry_points = {
'sphinx_themes': [
'path = sphinx_nameko_theme:get_html_theme_path',
]
},
include_package_data=True,
zip_safe=False
)

+ 13
- 0
cours/theme/nameko/sphinx_nameko_theme/__init__.py 查看文件

@@ -0,0 +1,13 @@
"""Sphinx Nameko Theme.

A fork of https://github.com/ignacysokolowski/sphinx-readable-theme for use
in Nameko (https://github.com/onefinestay/nameko)

"""

import os


def get_html_theme_path():
"""Return path to directory containing package theme."""
return os.path.abspath(os.path.dirname(__file__))

+ 19
- 0
cours/theme/nameko/sphinx_nameko_theme/nameko/layout.html 查看文件

@@ -0,0 +1,19 @@
{%- extends "basic/layout.html" %}
{%- block extrahead %}
{{ super() }}
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Lora:400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
{% endblock %}
{%- block relbar2 %}{% endblock %}
{% block header %}
{{ super() }}
{% if pagename == 'index' %}
<div class="indexwrapper">
{% endif %}
{% endblock %}
{%- block footer %}
{% if pagename == 'index' %}
</div>
{% endif %}
{%- endblock %}

+ 14
- 0
cours/theme/nameko/sphinx_nameko_theme/nameko/reference.html 查看文件

@@ -0,0 +1,14 @@
<div class="widget">
<h1>On This Page</h1>
<p>{{ toc }}</p>

{%- if prev -%}
<h1>Previous Topic</h1>
<p><a href="{{ prev.link|e }}">{{ prev.title }}</a></p>
{%- endif -%}

{%- if next -%}
<h1>Next Topic</h1>
<p><a href="{{ next.link|e }}">{{ next.title }}</a>{{ nextchar }}</p>
{%- endif -%}
</div>

+ 19
- 0
cours/theme/nameko/sphinx_nameko_theme/nameko/relations.html 查看文件

@@ -0,0 +1,19 @@
<h3>Related Topics</h3>
<ul>
<li><a href="{{ pathto(master_doc) }}">Documentation index</a><ul>
{%- for parent in parents %}
<li><a href="{{ parent.link | e }}">{{ parent.title }}</a><ul>
{%- endfor %}
{%- if prev %}
<li>Previous: <a href="{{ prev.link | e }}" title="{{ _('previous chapter')
}}">{{ prev.title }}</a></li>
{%- endif %}
{%- if next %}
<li>Next: <a href="{{ next.link | e }}" title="{{ _('next chapter')
}}">{{ next.title }}</a></li>
{%- endif %}
{%- for parent in parents %}
</ul></li>
{%- endfor %}
</ul></li>
</ul>

+ 530
- 0
cours/theme/nameko/sphinx_nameko_theme/nameko/static/nameko.css_t 查看文件

@@ -0,0 +1,530 @@
/*
* nameko.css_t
* ~~~~~~~~~~~~~~
*
* Sphinx Nameko Theme
*
* Forked from https://github.com/ignacysokolowski/sphinx-readable-theme
*
* :copyright: Copyright 2013 Ignacy Sokolowski; 2015 Lifealike, Ltd. DBA onefinestay
* :license: MIT, see LICENSE for details.
*
*/

{% set page_width = '940px' %}

@import url('basic.css');

/* -- page layout --------------------------------------------------------- */

body {
font-family: "Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
margin: 0;
padding: 0;
background-color: rgb(252, 252, 252);
}

h1, h2, h3, h4 {
color: #2a2730;
font-weight: 700;
font-family: "Lora","Times",serif;
clear: both;
}

div.document {
margin: 10px auto 0 auto;
max-width: {{ page_width }};
}

div.documentwrapper {
float: left;
width: 100%;
}

div.bodywrapper {
margin: 0 0 0 {{ theme_sidebarwidth|toint }}px;
}

div.body {
background-color: rgb(252, 252, 252);
color: #3e4349;
padding: 0 30px 30px 30px;
}

div.footer {
color: #555;
font-size: 14px;
margin: 20px auto 30px auto;
text-align: right;
max-width: 880px;
}

div.footer a {
color: #444;
text-decoration: underline;
}

div.related {
padding: 10px 10px;
width: auto;
}

div.sphinxsidebar {
float: left;
font-size: 14px;
line-height: 1.5em;
margin-left: -100%;
width: {{ theme_sidebarwidth|toint }}px;
}

div.sphinxsidebarwrapper {
font-size: 14px;
line-height: 1.5em;
padding: 10px 0 10px 10px;
}

div.sphinxsidebar h3,
div.sphinxsidebar h4 {
color: #333;
font-size: 24px;
font-weight: normal;
margin: 0 0 5px 0;
padding: 0;
}

div.sphinxsidebar h4 {
font-size: 1.1em;
}

div.sphinxsidebar h3 a {
color: #333;
}

div.sphinxsidebar p {
color: #888;
}

div.sphinxsidebar p.searchtip {
line-height: 1.4em;
}

div.sphinxsidebar ul {
color: #000;
margin: 10px 0 20px;
padding: 0;
}

div.sphinxsidebar a {
color: #444;
}

div.sphinxsidebar a:hover {
color: #d00;
}

div.sphinxsidebar input {
border: 1px solid #ccc;
font-family: sans-serif;
font-size: 1em;
}

/* -- body styles --------------------------------------------------------- */

a {
color: #900;
text-decoration: none;
}

a:visited {
color: #700;
}

a:hover {
color: #d00;
text-decoration: underline;
}

hr {
border: 1px solid #b1b4b6;
}

div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 { font-weight: normal; }

div.body h1,
div.body h2,
div.body h3,
div.body h4 { color: #212224; }
div.body h5 { color: #000; }
div.body h6 { color: #777; }

div.body h1 { margin: 0 0 10px 0; }
div.body h2,
div.body h3 { margin: 30px 0px 10px 0px; }
div.body h4,
div.body h5,
div.body h6 { margin: 20px 0px 10px 0px; }

div.body h1 { padding: 0 0 10px 0; }
div.body h2,
div.body h3 { padding: 10px 0 10px 0; }
div.body h4 { padding: 10px 0 10px 0; }
div.body h5,
div.body h6 { padding: 10px 0 0 0; }

div.body h1,
div.body h2,
div.body h3 { border-bottom: 1px solid #ddd; }
div.body h4 { border-bottom: 1px solid #e5e5e5; }

div.body h1 { font-size: 230%; }
div.body h2 { font-size: 180%; }
div.body h3 { font-size: 130%; }
div.body h4 { font-size: 110%; }
div.body h5 { font-size: 105%; }
div.body h6 { font-size: 100%; }

a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}

a.headerlink:hover {
background-color: #c60f0f;
color: #fff;
}

div.body ul {
list-style: disc;
margin: 1em 0;
padding-left: 1.3em;
}

div.body ul ul, div.body ol ul {
margin: .2em 0;
padding-left: 1.2em;
}

div.body ul li {
padding: 2px 0;
}

div.body ul.search li {
padding: 5px 0 5px 20px;
}

div.body ol {
counter-reset: li;
margin-left: 0;
padding-left: 0;
}

div.body ol ol {
margin: .2em 0;
}

div.body ol > li {
list-style: none;
margin: 0 0 0 1.9em;
padding: 2px 1px;
position: relative;
}

div.body ol > li:before {
content: counter(li) ".";
counter-increment: li;
top: -2px;
left: -1.9em;
width: 1.9em;
padding: 4px 0;
position: absolute;
text-align: left;
}

div.body p,
div.body dd,
div.body li {
line-height: 1.4em;
}

div.sidebar, div.topic {
background-color: #f6f7f9;
border: 1px solid #cdcdd1;
padding: 0;
margin: 0 0 1em 1.5em;
}

div.topic {
margin: 0;
}

div.sidebar p.sidebar-title, div.topic p.topic-title {
background-color: #cdcdd1;
padding: 8px;
}

div.sidebar p, div.topic p {
font-size: 0.9em;
padding: 10px 20px 0px 20px;
}

div.admonition {
background-color: #f6f7f9;
border: 1px solid #cdcdd1;
padding: 0px 12px 12px 12px;
font-size: 0.9em;
}

p.admonition-title {
display: block;
background-color: #cdcdd1;
margin: -12px -12px 12px -12px;
padding: 6px 12px;
}

div.admonition p.admonition-title + p {
display: inline;
}

div.attention, div.caution, div.seealso {
background-color: #fef9e9;
border: 1px solid #fbe091;
}

div.attention p.admonition-title,
div.caution p.admonition-title,
div.seealso p.admonition-title {
background-color: #fbe091;
}

div.danger, div.error, div.warning {
border: 1px solid #FEA1A2;
background-color: #FEE4E4;
}

div.danger p.admonition-title,
div.error p.admonition-title,
div.warning p.admonition-title {
background-color: #FEA1A2;
}

div.note, div.important, div.hint, div.tip {
border: 1px solid #daebea;
background-color: #F7FAFA;
}

div.note p.admonition-title,
div.important p.admonition-title,
div.hint p.admonition-title,
div.tip p.admonition-title {
background-color: #daebea;
}

div.highlight {
background-color: #fff;
}

pre {
background-color: #f6f7f9;
border: 1px solid #9aa2ab;
color: #222;
font-size: 0.75em;
line-height: 1.5em;
margin: 1.5em 0 1.5em 0;
padding: 10px;
}

pre, tt, code {
font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
}

tt, code, code.xref {
padding: 2px;
background-color: #fff;
border: 1px solid #daebea;
font-size: 0.75em;
}

tt.descname, code.descname {
font-size: 0.95em;
}

tt.xref, a tt, code.xref, a code {
font-weight: normal;
}

dl.class, dl.function {
margin-bottom: 50px;
}

dl.function > dt,
dl.attribute > dt,
dl.classmethod > dt,
dl.method > dt,
dl.class > dt,
dl.exception > dt {
background-color: #f5f5f5;
margin: 25px 0 10px 0;
padding: 1px 10px;
}

dl.function code.descname,
dl.attribute code.descname,
dl.classmethod code.descname,
dl.method code.descname,
dl.class code.descname,
dl.exception code.descname {
border: none;
}

table.docutils {
width: 100%;
font-size: 0.9em;
}

table.docutils.footnote {
width: auto;
}

table.docutils thead,
table.docutils tfoot {
background: #f5f5f5;
}

table.docutils thead tr th {
color: #000;
font-weight: normal;
padding: 7px 5px;
vertical-align: middle;
}

table.docutils tbody tr th,
table.docutils tbody tr td {
border-bottom: 0;
border-top: solid 1px #ddd;
padding: 7px 5px;
vertical-align: top;
}
table.docutils tbody tr:last-child th,
table.docutils tbody tr:last-child td {
border-bottom: solid 1px #ddd;
}

table.docutils thead tr td p,
table.docutils tfoot tr td p,
table.docutils tbody tr td p,
table.docutils thead tr td ul,
table.docutils tfoot tr td ul,
table.docutils tbody tr td ul,
table.docutils thead tr td ol,
table.docutils tfoot tr td ol,
table.docutils tbody tr td ol {
margin: 0 0 .5em;
}
table.docutils thead tr td p.last,
table.docutils tfoot tr td p.last,
table.docutils tbody tr td p.last,
table.docutils thead tr td ul.last,
table.docutils tfoot tr td ul.last,
table.docutils tbody tr td ul.last,
table.docutils thead tr td ol.last,
table.docutils tfoot tr td ol.last,
table.docutils tbody tr td ol.last {
margin-bottom: 0;
}

code.descname {
font-size: 0.8em;
}

span.viewcode-link {
font-size: 0.8em;
line-height: 1.75;
}

dl em {
font-size: 0.9em;
}

.viewcode-back {
font-family: Arial, sans-serif;
}

div.viewcode-block:target {
background-color: #fef9e9;
border-top: 1px solid #fbe091;
border-bottom: 1px solid #fbe091;
}

@media screen and (max-width: 870px) {

div.document {
width: auto;
margin: 0;
}

div.documentwrapper {
float: none;
}

div.bodywrapper {
margin: 0;
}

div.body {
min-height: 0;
padding: 0 20px 30px 20px;
}

div.footer {
background-color: #333;
color: #888;
margin: 0;
padding: 10px 20px 20px;
text-align: left;
width: auto;
}

div.footer a {
color: #bbb;
}

div.footer a:hover {
color: #fff;
}

div.sphinxsidebar {
background-color: #333;
color: #fff;
float: none;
margin: 0;
padding: 10px 20px;
width: auto;
}

div.sphinxsidebar h3,
div.sphinxsidebar h4,
div.sphinxsidebar p,
div.sphinxsidebar h3 a {
color: #fff;
}

div.sphinxsidebar ul {
color: #999;
}

div.sphinxsidebar a {
color: #aaa;
}

div.sphinxsidebar a:hover {
color: #fff;
}

}

+ 70
- 0
cours/theme/nameko/sphinx_nameko_theme/nameko/static/pygments.css 查看文件

@@ -0,0 +1,70 @@
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #888 } /* Comment */
.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
.highlight .g { color: #000000 } /* Generic */
.highlight .k { color: #004461; font-weight: bold } /* Keyword */
.highlight .l { color: #000000 } /* Literal */
.highlight .n { color: #000000 } /* Name */
.highlight .o { color: #582800 } /* Operator */
.highlight .x { color: #000000 } /* Other */
.highlight .p { color: #000000; font-weight: bold } /* Punctuation */
.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #8f5902 } /* Comment.Preproc */
.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */
.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */
.highlight .gd { color: #a40000 } /* Generic.Deleted */
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
.highlight .gr { color: #ef2929 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #745334 } /* Generic.Prompt */
.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
.highlight .kc { color: #004461; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #004461; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #004461; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #004461; font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { color: #004461; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #004461; font-weight: bold } /* Keyword.Type */
.highlight .ld { color: #000000 } /* Literal.Date */
.highlight .m { color: #990000 } /* Literal.Number */
.highlight .s { color: #3b7c03 } /* Literal.String */
.highlight .na { color: #c4a000 } /* Name.Attribute */
.highlight .nb { color: #004461 } /* Name.Builtin */
.highlight .nc { color: #000000 } /* Name.Class */
.highlight .no { color: #000000 } /* Name.Constant */
.highlight .nd { color: #888888 } /* Name.Decorator */
.highlight .ni { color: #ce5c00 } /* Name.Entity */
.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #000000 } /* Name.Function */
.highlight .nl { color: #f57900 } /* Name.Label */
.highlight .nn { color: #000000 } /* Name.Namespace */
.highlight .nx { color: #000000 } /* Name.Other */
.highlight .py { color: #000000 } /* Name.Property */
.highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #000000 } /* Name.Variable */
.highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */
.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
.highlight .mf { color: #990000 } /* Literal.Number.Float */
.highlight .mh { color: #990000 } /* Literal.Number.Hex */
.highlight .mi { color: #990000 } /* Literal.Number.Integer */
.highlight .mo { color: #990000 } /* Literal.Number.Oct */
.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */
.highlight .sc { color: #4e9a06 } /* Literal.String.Char */
.highlight .sd { color: #8f5902 } /* Literal.String.Doc */
.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */
.highlight .se { color: #4e9a06 } /* Literal.String.Escape */
.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */
.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */
.highlight .sx { color: #4e9a06 } /* Literal.String.Other */
.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */
.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */
.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */
.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #000000 } /* Name.Variable.Class */
.highlight .vg { color: #000000 } /* Name.Variable.Global */
.highlight .vi { color: #000000 } /* Name.Variable.Instance */
.highlight .il { color: #990000 } /* Literal.Number.Integer.Long */

+ 3
- 0
cours/theme/nameko/sphinx_nameko_theme/nameko/theme.conf 查看文件

@@ -0,0 +1,3 @@
[theme]
inherit = basic
stylesheet = nameko.css