Compat with new sphinx

Changed a lot of code:: to code-block::
Also added sphinx_rtd_theme to deps in tox
This commit is contained in:
Anders Ingemann 2016-03-04 01:19:29 +01:00
parent e80233bc44
commit 6bb654b79f
18 changed files with 45 additions and 43 deletions

View file

@ -62,7 +62,7 @@ Here are a few quickstart tutorials for the most common images.
If you plan on partitioning your volume, you will need the ``parted`` If you plan on partitioning your volume, you will need the ``parted``
package and ``kpartx``: package and ``kpartx``:
.. code:: sh .. code-block:: sh
root@host:~# apt-get install parted kpartx root@host:~# apt-get install parted kpartx
@ -75,7 +75,7 @@ quits the process.
Docker Docker
~~~~~~ ~~~~~~
.. code:: sh .. code-block:: sh
user@host:~$ sudo -i # become root user@host:~$ sudo -i # become root
root@host:~# git clone https://github.com/andsens/bootstrap-vz.git # Clone the repo root@host:~# git clone https://github.com/andsens/bootstrap-vz.git # Clone the repo
@ -93,7 +93,7 @@ it is recommended to install `the latest docker version <https://docs.docker.com
VirtualBox Vagrant VirtualBox Vagrant
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
.. code:: sh .. code-block:: sh
user@host:~$ sudo -i # become root user@host:~$ sudo -i # become root
root@host:~# git clone https://github.com/andsens/bootstrap-vz.git # Clone the repo root@host:~# git clone https://github.com/andsens/bootstrap-vz.git # Clone the repo
@ -109,7 +109,7 @@ __ https://my.vmware.com/web/vmware/info/slug/desktop_end_user_computing/vmware_
Amazon EC2 EBS backed AMI Amazon EC2 EBS backed AMI
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: sh .. code-block:: sh
user@host:~$ sudo -i # become root user@host:~$ sudo -i # become root
root@host:~# git clone https://github.com/andsens/bootstrap-vz.git # Clone the repo root@host:~# git clone https://github.com/andsens/bootstrap-vz.git # Clone the repo
@ -121,7 +121,7 @@ To bootstrap S3 backed AMIs, bootstrap-vz will also need the
``euca2ools`` package. However, version 3.2.0 is required meaning you ``euca2ools`` package. However, version 3.2.0 is required meaning you
must install it directly from the eucalyptus repository like this: must install it directly from the eucalyptus repository like this:
.. code:: sh .. code-block:: sh
apt-get install --no-install-recommends python-dev libxml2-dev libxslt-dev gcc zlib1g-dev apt-get install --no-install-recommends python-dev libxml2-dev libxslt-dev gcc zlib1g-dev
pip install git+git://github.com/eucalyptus/euca2ools.git@v3.2.0 pip install git+git://github.com/eucalyptus/euca2ools.git@v3.2.0

View file

@ -11,7 +11,7 @@ dependency graph where directed edges dictate precedence. Each task is
a simple class that defines its predecessor tasks and successor tasks a simple class that defines its predecessor tasks and successor tasks
via attributes. Here is an example: via attributes. Here is an example:
.. code:: python .. code-block:: python
class MapPartitions(Task): class MapPartitions(Task):
description = 'Mapping volume partitions' description = 'Mapping volume partitions'

View file

@ -33,7 +33,7 @@ Settings
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
plugins: plugins:

View file

@ -23,7 +23,7 @@ Example
~~~~~~~ ~~~~~~~
Create an empty `index.html` in `/var/www` and delete all locales except english. Create an empty `index.html` in `/var/www` and delete all locales except english.
.. code:: yaml .. code-block:: yaml
commands: commands:
commands: commands:

View file

@ -7,7 +7,7 @@ to the image, which sets up the network configuration and SSH keys.
The virtual machine context should be configured as follows: The virtual machine context should be configured as follows:
:: .. code-block:: text
ETH0_DNS $NETWORK[DNS, NETWORK_ID=2] ETH0_DNS $NETWORK[DNS, NETWORK_ID=2]
ETH0_GATEWAY $NETWORK[GATEWAY, NETWORK_ID=2] ETH0_GATEWAY $NETWORK[GATEWAY, NETWORK_ID=2]

View file

@ -23,7 +23,7 @@ Provider
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:

View file

@ -43,7 +43,7 @@ Provider
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
name: bootstrap-vz:latest name: bootstrap-vz:latest

View file

@ -53,7 +53,7 @@ under the ``provider`` section.
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:
@ -78,7 +78,7 @@ __ http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:
@ -96,7 +96,7 @@ __ http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:
@ -117,7 +117,7 @@ Image
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:

View file

@ -21,7 +21,7 @@ Provider
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:

View file

@ -18,7 +18,7 @@ Provider
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:

View file

@ -28,7 +28,7 @@ generation. They will be used to authenticate the API client.
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:
@ -52,7 +52,7 @@ available to customize the process of uploading and verifying an image.
Default: ``false``. Default: ``false``.
``optional`` ``optional``
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:

View file

@ -28,7 +28,7 @@ Provider
Example: Example:
.. code:: yaml .. code-block:: yaml
--- ---
provider: provider:

View file

@ -63,7 +63,7 @@ The file ``build-servers.yml`` informs bootstrap-vz about the different
build servers you have at your disposal. build servers you have at your disposal.
In its simplest form you can just add your own machine like this: In its simplest form you can just add your own machine like this:
.. code:: yaml .. code-block:: yaml
local: local:
type: local type: local
@ -94,7 +94,7 @@ Remote settings
The other (and more interesting) setting for ``type`` is ``ssh``, The other (and more interesting) setting for ``type`` is ``ssh``,
which requires a few more configuration settings: which requires a few more configuration settings:
.. code:: yaml .. code-block:: yaml
local_vm: local_vm:
type: ssh type: ssh
@ -141,7 +141,7 @@ This is useful when for example the VirtualBox guest additions ISO is located
at ``/root/guest_additions.iso`` on server 1, while server 2 has it at at ``/root/guest_additions.iso`` on server 1, while server 2 has it at
``/root/images/vbox.iso``. ``/root/images/vbox.iso``.
.. code:: yaml .. code-block:: yaml
local: local:
type: local type: local
@ -174,7 +174,7 @@ Run settings
The run settings hold information about how to start a bootstrapped image. The run settings hold information about how to start a bootstrapped image.
This is useful only when running system tests. This is useful only when running system tests.
.. code:: yaml .. code-block:: yaml
local: local:
type: local type: local

View file

@ -12,7 +12,7 @@ Start by creating an ``__init__.py`` in your plugin folder.
The only obligatory function you need to implement is ``resolve_tasks()``. The only obligatory function you need to implement is ``resolve_tasks()``.
This function adds tasks to be run to the tasklist: This function adds tasks to be run to the tasklist:
.. code:: python .. code-block:: python
def resolve_tasks(taskset, manifest): def resolve_tasks(taskset, manifest):
taskset.add(tasks.DoSomething) taskset.add(tasks.DoSomething)
@ -23,7 +23,7 @@ check of which release of Debian bootstrap-vz will create an image.
A task is a class with a static ``run()`` function and some meta-information: A task is a class with a static ``run()`` function and some meta-information:
.. code:: python .. code-block:: python
class DoSomething(Task): class DoSomething(Task):
description = 'Doing something' description = 'Doing something'
@ -46,7 +46,7 @@ process. If you created temporary files for example, you can add a task to the
rollback taskset that deletes those files, you might even already have it because rollback taskset that deletes those files, you might even already have it because
you run it after an image has been successfully bootstrapped: you run it after an image has been successfully bootstrapped:
.. code:: python .. code-block:: python
def resolve_rollback_tasks(taskset, manifest, completed, counter_task): def resolve_rollback_tasks(taskset, manifest, completed, counter_task):
counter_task(taskset, tasks.DoSomething, tasks.UndoSomething) counter_task(taskset, tasks.DoSomething, tasks.UndoSomething)
@ -63,7 +63,7 @@ running through the completed tasklist and checking each completed task.
You can also specify a ``validate_manifest()`` function. You can also specify a ``validate_manifest()`` function.
Typically it looks like this: Typically it looks like this:
.. code:: python .. code-block:: python
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):
import os.path import os.path
@ -75,7 +75,7 @@ The schema is a `JSON schema <http://json-schema.org/>`__, since bootstrap-vz
supports `yaml <http://yaml.org/>`__, you can avoid a lot of curly braces supports `yaml <http://yaml.org/>`__, you can avoid a lot of curly braces
quotes: quotes:
.. code:: yaml .. code-block:: yaml
$schema: http://json-schema.org/draft-04/schema# $schema: http://json-schema.org/draft-04/schema#
title: Example plugin manifest title: Example plugin manifest
@ -110,7 +110,7 @@ specific to your use-case or when the plugin contains proprietary code that you
would not like to share. would not like to share.
They integrate with bootstrap-vz by exposing an entry-point through ``setup.py``: They integrate with bootstrap-vz by exposing an entry-point through ``setup.py``:
.. code:: python .. code-block:: python
setup(name='example-plugin', setup(name='example-plugin',
version=0.9.5, version=0.9.5,
@ -123,7 +123,7 @@ They integrate with bootstrap-vz by exposing an entry-point through ``setup.py``
Beyond ``setup.py`` the package might need a ``MANIFEST.in`` so that assets Beyond ``setup.py`` the package might need a ``MANIFEST.in`` so that assets
like ``manifest-schema.yml`` are included when the package is built: like ``manifest-schema.yml`` are included when the package is built:
.. code:: .. code-block:: text
include example/manifest-schema.yml include example/manifest-schema.yml
include example/README.rst include example/README.rst
@ -141,6 +141,6 @@ Some plugins may not find their way to the python package index
(especially if it's in a private repo). They can of course still be installed (especially if it's in a private repo). They can of course still be installed
using pip: using pip:
.. code:: sh .. code-block:: sh
pip install git+ssh://git@github.com/username/repo#egg=plugin_name pip install git+ssh://git@github.com/username/repo#egg=plugin_name

View file

@ -9,7 +9,7 @@ Selecting tests
--------------- ---------------
To run one specific test suite simply append the module path to tox: To run one specific test suite simply append the module path to tox:
.. code:: sh .. code-block:: sh
$ tox -e unit tests.unit.releases_tests $ tox -e unit tests.unit.releases_tests
@ -17,6 +17,6 @@ Specific tests can be selected by appending the function name with a colon
to the modulepath -- to run more than one tests, simply attach more arguments. to the modulepath -- to run more than one tests, simply attach more arguments.
.. code:: sh .. code-block:: sh
$ tox -e unit tests.unit.releases_tests:test_lt tests.unit.releases_tests:test_eq $ tox -e unit tests.unit.releases_tests:test_lt tests.unit.releases_tests:test_eq

View file

@ -46,7 +46,7 @@ Instead of creating manifests from scratch for each single test, reusable parts
are factored out into partials in the manifest folder. are factored out into partials in the manifest folder.
This allows code like this: This allows code like this:
.. code:: python .. code-block:: python
partials = {'vdi': '{provider: {name: virtualbox}, volume: {backing: vdi}}', partials = {'vdi': '{provider: {name: virtualbox}, volume: {backing: vdi}}',
'vmdk': '{provider: {name: virtualbox}, volume: {backing: vmdk}}', 'vmdk': '{provider: {name: virtualbox}, volume: {backing: vmdk}}',

View file

@ -28,7 +28,7 @@ up logging and invokes a specific test can be used instead:
Example: Example:
.. code:: python .. code-block:: python
#!/usr/bin/env python #!/usr/bin/env python

View file

@ -32,5 +32,7 @@ commands = nosetests --with-html --html-file=system.html --verbose {posargs:test
[testenv:docs] [testenv:docs]
changedir = docs changedir = docs
deps = sphinx deps =
sphinx
sphinx_rtd_theme
commands = sphinx-build -W -b html -d _build/html/doctrees . _build/html commands = sphinx-build -W -b html -d _build/html/doctrees . _build/html