Skip to content

Commit

Permalink
Take our own docs style advice.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanj committed May 16, 2014
1 parent ecaa30a commit 7bd4bd1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 20 deletions.
3 changes: 2 additions & 1 deletion README.rst
@@ -1,3 +1,4 @@
=====================================
Spinneret: Twisted Web's Silk Spinner
=====================================

Expand All @@ -23,7 +24,7 @@ See http://github.com/jonathanj/txspinneret for development.


Installation
------------
============

.. code-block:: console
Expand Down
9 changes: 5 additions & 4 deletions docs/api.rst
@@ -1,8 +1,9 @@
=================
API Documentation
=================

Resource routing
----------------
================

.. automodule:: txspinneret.route
:members:
Expand All @@ -14,7 +15,7 @@ Resource routing


Query arguments
---------------
===============

.. automodule:: txspinneret.query
:members:
Expand All @@ -26,7 +27,7 @@ Query arguments


Utility resources
-----------------
=================

.. automodule:: txspinneret.resource
:members:
Expand All @@ -37,7 +38,7 @@ Utility resources


Interfaces
----------
==========

.. automodule:: txspinneret.interfaces
:members:
Expand Down
18 changes: 10 additions & 8 deletions docs/index.rst
Expand Up @@ -3,14 +3,15 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
=====================================
Spinneret: Twisted Web's Silk Spinner
=====================================

Release v\ |release|.


What is this?
-------------
=============

Spinneret is a collection of higher-level utility classes and functions to make
writing complex Twisted Web applications far simpler, it is designed to easily
Expand All @@ -19,7 +20,7 @@ integrate with existing Twisted Web projects for things like the improved


Why is this one different?
--------------------------
==========================

While I think `Klein`_ is a fantastic library—and a terrific source of
inspiration—there are some fundamental aspects I disagree with, not to mention
Expand All @@ -46,7 +47,7 @@ Or to install the latest development version:
Documentation
-------------
=============

.. toctree::
:maxdepth: 2
Expand All @@ -63,10 +64,11 @@ API documentation

api

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Contributing
============

.. toctree::
:maxdepth: 2

contributing
3 changes: 2 additions & 1 deletion docs/query.rst
@@ -1,5 +1,6 @@
.. py:currentmodule:: txspinneret.query
===============
Query Arguments
===============

Expand All @@ -12,7 +13,7 @@ The tedious process of processing query arguments usually follows this pattern:


Parsing query arguments
-----------------------
=======================

This small set of utility functions can relieve some of that pain, for example
assume the query string is
Expand Down
5 changes: 3 additions & 2 deletions docs/resource.rst
@@ -1,5 +1,6 @@
.. py:currentmodule:: txspinneret.resource
==================
Resource Utilities
==================

Expand All @@ -8,7 +9,7 @@ with any existing `IResource` implementations.


More featureful resources
-------------------------
=========================

`ISpinneretResource` is cut-down version of `IResource` that allows child
location (via `ISpinneretResource.locateChild`) and rendering (via the normal
Expand All @@ -27,7 +28,7 @@ And secondly, a `list` of remaining path segments to be processed.


Negotiating resources based on ``Accept``
-----------------------------------------
=========================================

When building an API, in particular, you may want to negotiate the resource
that best fits what the client is willing to accept, as specified in the
Expand Down
9 changes: 5 additions & 4 deletions docs/route.rst
@@ -1,5 +1,6 @@
.. py:currentmodule:: txspinneret.route
===========
URL Routing
===========

Expand All @@ -17,7 +18,7 @@ is only possible to specify relative routes.


Router basics
-------------
=============

`Router.route` will match a URL route exactly, meaning that every route
component must match the respective segment in the URL path; eg.
Expand All @@ -42,7 +43,7 @@ other parts of Spinneret or Twisted Web.


Special routes
--------------
==============

There are two routes—particularly in the case of nested routers—that may not be
obvious at first: The null root and the empty route.
Expand Down Expand Up @@ -70,7 +71,7 @@ with ``@router.route()`` (the null route.)


Matcher basics
--------------
==============

`txspinneret.route` contains some basic matchers such as `Any` (which is
a synonym for `Text`) and `Integer`. These matchers are simple factory
Expand All @@ -81,7 +82,7 @@ match.) Writing your own matchers to suit your needs is encouraged.


An example router
-----------------
=================

.. literalinclude:: examples/user_router.py

Expand Down

0 comments on commit 7bd4bd1

Please sign in to comment.