move documentation into the new standard layout

Change-Id: Id5ae008eab8e52d8943659b809ed1bcd996e0794
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-06-28 13:05:57 -04:00
parent 1955f12f92
commit e758e51871
24 changed files with 43 additions and 36 deletions

View File

@ -1 +0,0 @@
.. include:: ../../ChangeLog

View File

@ -12,29 +12,18 @@ for managing entry points tends to be repetitive, though, so stevedore
provides manager classes for implementing common patterns for using
dynamically loaded extensions.
Contents:
.. toctree::
:glob:
:maxdepth: 2
patterns_loading
patterns_enabling
tutorial/index
managers
sphinxext
install
essays/*
user/index
reference/index
install/index
.. toctree::
:maxdepth: 1
history
.. _setuptools entry points: http://setuptools.readthedocs.io/en/latest/pkg_resources.html?#entry-points
Indices and tables
==================
.. rubric:: Indices and tables
* :ref:`genindex`
* :ref:`search`

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -476,5 +476,5 @@ patterns.
* PyCon 2013 Video: http://pyvideo.org/video/1789/dynamic-code-patterns-extending-your-application
* Slides: http://www.slideshare.net/doughellmann/dynamic-codepatterns
* :doc:`/patterns_loading`
* :doc:`/patterns_enabling`
* :doc:`/user/patterns_loading`
* :doc:`/user/patterns_enabling`

View File

@ -0,0 +1,5 @@
===========
ChangeLog
===========
.. include:: ../../../ChangeLog

14
doc/source/user/index.rst Normal file
View File

@ -0,0 +1,14 @@
======================
stevedore User Guide
======================
.. toctree::
:glob:
:maxdepth: 2
patterns_loading
patterns_enabling
tutorial/index
sphinxext
essays/*
history

View File

@ -35,7 +35,7 @@ A Plugin Base Class
Step 1 above is to define an abstract base class for the API that
needs to be implemented by each plugin.
.. literalinclude:: ../../../stevedore/example/base.py
.. literalinclude:: ../../../../stevedore/example/base.py
:language: python
:prepend: # stevedore/example/base.py
@ -50,7 +50,7 @@ The next step is to create a couple of plugin classes with concrete
implementations of :func:`format`. A simple example formatter produces
output with each variable name and value on a single line.
.. literalinclude:: ../../../stevedore/example/simple.py
.. literalinclude:: ../../../../stevedore/example/simple.py
:language: python
:prepend: # stevedore/example/simple.py
@ -72,7 +72,7 @@ plugins are formatters from the stevedore examples, so I will use the
namespace "stevedore.example.formatter". Now it is possible to provide
all of the necessary information in the packaging instructions:
.. literalinclude:: ../../../stevedore/example/setup.py
.. literalinclude:: ../../../../stevedore/example/setup.py
:language: python
:prepend: # stevedore/example/setup.py
@ -84,7 +84,7 @@ where *name* is the user-visible name for the plugin, *module* is the
Python import reference for the module, and *importable* is the name
of something that can be imported from inside the module.
.. literalinclude:: ../../../stevedore/example/setup.py
.. literalinclude:: ../../../../stevedore/example/setup.py
:language: python
:lines: 37-43
@ -131,26 +131,26 @@ package the code for the plugin should live in.
For example, we can add an alternate implementation of a formatter
plugin that produces a reStructuredText `field list`_.
.. literalinclude:: ../../../stevedore/example2/fields.py
.. literalinclude:: ../../../../stevedore/example2/fields.py
:language: python
:prepend: # stevedore/example2/fields.py
The new plugin can then be packaged using a ``setup.py`` containing
.. literalinclude:: ../../../stevedore/example2/setup.py
.. literalinclude:: ../../../../stevedore/example2/setup.py
:language: python
:prepend: # stevedore/example2/setup.py
The new plugin is in a separate ``stevedore-examples2`` package.
.. literalinclude:: ../../../stevedore/example2/setup.py
.. literalinclude:: ../../../../stevedore/example2/setup.py
:language: python
:lines: 3-4
However, the plugin is registered as part of the
``stevedore.example.formatter`` namespace.
.. literalinclude:: ../../../stevedore/example2/setup.py
.. literalinclude:: ../../../../stevedore/example2/setup.py
:language: python
:lines: 36-40

View File

@ -16,7 +16,7 @@ application.
.. seealso::
* :doc:`/essays/pycon2013`
* :doc:`../essays/pycon2013`
* `Using setuptools entry points`_
* `Package Discovery and Resource Access using pkg_resources`_
* `Using Entry Points to Write Plugins | Pylons`_

View File

@ -17,7 +17,7 @@ This example program uses a :class:`DriverManager` to load a formatter
defined in the examples for stevedore. It then uses the formatter to
convert a data structure to a text format, which it can print.
.. literalinclude:: ../../../stevedore/example/load_as_driver.py
.. literalinclude:: ../../../../stevedore/example/load_as_driver.py
:language: python
:prepend: # stevedore/example/load_as_driver.py
@ -28,7 +28,7 @@ registered as a formatter. The ``invoke_args`` are positional
arguments passed to the class constructor, and are used to set the
maximum width parameter.
.. literalinclude:: ../../../stevedore/example/load_as_driver.py
.. literalinclude:: ../../../../stevedore/example/load_as_driver.py
:language: python
:lines: 30-35
@ -39,7 +39,7 @@ from the plugin. The single driver can be accessed via the
:attr:`driver` property of the manager, and then its methods can be
called directly.
.. literalinclude:: ../../../stevedore/example/load_as_driver.py
.. literalinclude:: ../../../../stevedore/example/load_as_driver.py
:language: python
:lines: 36-37
@ -57,7 +57,7 @@ support this invocation pattern, including
:class:`~stevedore.named.NamedExtensionManager`, and
:class:`~stevedore.enabled.EnabledExtensionManager`.
.. literalinclude:: ../../../stevedore/example/load_as_extension.py
.. literalinclude:: ../../../../stevedore/example/load_as_extension.py
:language: python
:prepend: # stevedore/example/load_as_extension.py
@ -65,7 +65,7 @@ The :class:`ExtensionManager` is created slightly differently from the
:class:`DriverManager` because it does not need to know in advance
which plugin to load. It loads all of the plugins it finds.
.. literalinclude:: ../../../stevedore/example/load_as_extension.py
.. literalinclude:: ../../../../stevedore/example/load_as_extension.py
:language: python
:lines: 24-28
@ -75,7 +75,7 @@ with :meth:`map` in this example takes two arguments, the
:class:`~stevedore.extension.Extension` and the data argument given to
:meth:`map`.
.. literalinclude:: ../../../stevedore/example/load_as_extension.py
.. literalinclude:: ../../../../stevedore/example/load_as_extension.py
:language: python
:lines: 30-33
@ -93,7 +93,7 @@ the extension name and the iterable that produces the text to
print. As the results are processed, the name of each plugin is
printed and then the formatted data.
.. literalinclude:: ../../../stevedore/example/load_as_extension.py
.. literalinclude:: ../../../../stevedore/example/load_as_extension.py
:language: python
:lines: 35-39
@ -122,5 +122,5 @@ achieve different goals.
.. seealso::
* :doc:`/patterns_loading`
* :doc:`/patterns_enabling`
* :doc:`../patterns_loading`
* :doc:`../patterns_enabling`