2010-06-04 16:13:53 -05:00
|
|
|
.. _websupportapi:
|
|
|
|
|
2010-07-12 01:41:39 -05:00
|
|
|
.. currentmodule:: sphinx.websupport
|
|
|
|
|
|
|
|
The WebSupport Class
|
|
|
|
====================
|
2010-06-04 16:13:53 -05:00
|
|
|
|
|
|
|
.. class:: WebSupport
|
|
|
|
|
2010-08-21 12:15:14 -05:00
|
|
|
The main API class for the web support package. All interactions with the
|
|
|
|
web support package should occur through this class.
|
|
|
|
|
|
|
|
The class takes the following keyword arguments:
|
|
|
|
|
|
|
|
srcdir
|
|
|
|
The directory containing reStructuredText source files.
|
|
|
|
|
|
|
|
builddir
|
|
|
|
The directory that build data and static files should be placed in. This
|
|
|
|
should be used when creating a :class:`WebSupport` object that will be
|
|
|
|
used to build data.
|
|
|
|
|
|
|
|
datadir
|
|
|
|
The directory that the web support data is in. This should be used when
|
|
|
|
creating a :class:`WebSupport` object that will be used to retrieve data.
|
|
|
|
|
|
|
|
search
|
|
|
|
This may contain either a string (e.g. 'xapian') referencing a built-in
|
|
|
|
search adapter to use, or an instance of a subclass of
|
|
|
|
:class:`~.search.BaseSearch`.
|
|
|
|
|
|
|
|
storage
|
|
|
|
This may contain either a string representing a database uri, or an
|
|
|
|
instance of a subclass of :class:`~.storage.StorageBackend`. If this is
|
|
|
|
not provided, a new sqlite database will be created.
|
|
|
|
|
|
|
|
moderation_callback
|
|
|
|
A callable to be called when a new comment is added that is not
|
|
|
|
displayed. It must accept one argument: a dictionary representing the
|
|
|
|
comment that was added.
|
|
|
|
|
|
|
|
staticdir
|
|
|
|
If static files are served from a location besides ``'/static'``, this
|
|
|
|
should be a string with the name of that location
|
|
|
|
(e.g. ``'/static_files'``).
|
|
|
|
|
|
|
|
docroot
|
|
|
|
If the documentation is not served from the base path of a URL, this
|
|
|
|
should be a string specifying that path (e.g. ``'docs'``).
|
|
|
|
|
2010-08-10 10:11:11 -05:00
|
|
|
|
2010-07-12 01:41:39 -05:00
|
|
|
Methods
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
.. automethod:: sphinx.websupport.WebSupport.build
|
2010-06-04 16:13:53 -05:00
|
|
|
|
2010-07-12 01:41:39 -05:00
|
|
|
.. automethod:: sphinx.websupport.WebSupport.get_document
|
2010-06-04 16:13:53 -05:00
|
|
|
|
2010-08-07 17:04:45 -05:00
|
|
|
.. automethod:: sphinx.websupport.WebSupport.get_data
|
2010-06-04 16:13:53 -05:00
|
|
|
|
2010-07-12 01:41:39 -05:00
|
|
|
.. automethod:: sphinx.websupport.WebSupport.add_comment
|
2010-06-26 14:49:30 -05:00
|
|
|
|
2010-07-12 01:41:39 -05:00
|
|
|
.. automethod:: sphinx.websupport.WebSupport.process_vote
|
2010-06-26 14:49:30 -05:00
|
|
|
|
2010-07-12 01:41:39 -05:00
|
|
|
.. automethod:: sphinx.websupport.WebSupport.get_search_results
|