From ca618b2998161b873881ef357e4363d08b6714f0 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 22 Apr 2017 18:52:02 +0900 Subject: [PATCH] Update docs --- doc/web/api.rst | 21 ++++++++++++++------- doc/web/quickstart.rst | 10 +++++----- doc/web/searchadapters.rst | 6 +++++- doc/web/storagebackends.rst | 7 ++++++- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/doc/web/api.rst b/doc/web/api.rst index 070cd3a21..05ea68e71 100644 --- a/doc/web/api.rst +++ b/doc/web/api.rst @@ -1,6 +1,6 @@ .. _websupportapi: -.. currentmodule:: sphinx.websupport +.. currentmodule:: sphinxcontrib.websupport The WebSupport Class ==================== @@ -49,17 +49,24 @@ The WebSupport Class should be a string specifying that path (e.g. ``'docs'``). +.. versionchanged:: 1.6 + + WebSupport class is moved to sphinxcontrib.websupport from sphinx.websupport. + Please add ``sphinxcontrib-websupport`` package in your dependency and use + moved class instead. + + Methods ~~~~~~~ -.. automethod:: sphinx.websupport.WebSupport.build +.. automethod:: sphinxcontrib.websupport.WebSupport.build -.. automethod:: sphinx.websupport.WebSupport.get_document +.. automethod:: sphinxcontrib.websupport.WebSupport.get_document -.. automethod:: sphinx.websupport.WebSupport.get_data +.. automethod:: sphinxcontrib.websupport.WebSupport.get_data -.. automethod:: sphinx.websupport.WebSupport.add_comment +.. automethod:: sphinxcontrib.websupport.WebSupport.add_comment -.. automethod:: sphinx.websupport.WebSupport.process_vote +.. automethod:: sphinxcontrib.websupport.WebSupport.process_vote -.. automethod:: sphinx.websupport.WebSupport.get_search_results +.. automethod:: sphinxcontrib.websupport.WebSupport.get_search_results diff --git a/doc/web/quickstart.rst b/doc/web/quickstart.rst index 1611774c1..0ef735ca9 100644 --- a/doc/web/quickstart.rst +++ b/doc/web/quickstart.rst @@ -12,7 +12,7 @@ search indices, and node data that is used to track where comments and other things are in a document. To do this you will need to create an instance of the :class:`~.WebSupport` class and call its :meth:`~.WebSupport.build` method:: - from sphinx.websupport import WebSupport + from sphinxcontrib.websupport import WebSupport support = WebSupport(srcdir='/path/to/rst/sources/', builddir='/path/to/build/outdir', @@ -39,7 +39,7 @@ Integrating Sphinx Documents Into Your Webapp Now that the data is built, it's time to do something useful with it. Start off by creating a :class:`~.WebSupport` object for your application:: - from sphinx.websupport import WebSupport + from sphinxcontrib.websupport import WebSupport support = WebSupport(datadir='/path/to/the/data', search='xapian') @@ -115,7 +115,7 @@ The default value for *moderator* is ``False``. An example `Flask `_ function that checks whether a user is logged in and then retrieves a document is:: - from sphinx.websupport.errors import * + from sphinxcontrib.websupport.errors import * @app.route('/') def doc(docname): @@ -151,7 +151,7 @@ Performing Searches To use the search form built-in to the Sphinx sidebar, create a function to handle requests to the url 'search' relative to the documentation root. The user's search query will be in the GET parameters, with the key `q`. Then use -the :meth:`~sphinx.websupport.WebSupport.get_search_results` method to retrieve +the :meth:`~sphinxcontrib.websupport.WebSupport.get_search_results` method to retrieve search results. In `Flask `_ that would be like this:: @app.route('/search') @@ -191,7 +191,7 @@ request. If the comment is being attached directly to a node, `parent_id` will be empty. If the comment is a child of another comment, then `node_id` will be empty. Then next function handles the retrieval of comments for a specific node, and is aptly named -:meth:`~sphinx.websupport.WebSupport.get_data`:: +:meth:`~sphinxcontrib.websupport.WebSupport.get_data`:: @app.route('/docs/get_comments') def get_comments(): diff --git a/doc/web/searchadapters.rst b/doc/web/searchadapters.rst index 7d8634f71..e44584797 100644 --- a/doc/web/searchadapters.rst +++ b/doc/web/searchadapters.rst @@ -1,6 +1,6 @@ .. _searchadapters: -.. currentmodule:: sphinx.websupport.search +.. currentmodule:: sphinxcontrib.websupport.search Search Adapters =============== @@ -21,6 +21,10 @@ documentation of the :class:`BaseSearch` class below. Defines an interface for search adapters. +.. versionchanged:: 1.6 + + BaseSearch class is moved to sphinxcontrib.websupport.search from + sphinx.websupport.search. BaseSearch Methods ~~~~~~~~~~~~~~~~~~ diff --git a/doc/web/storagebackends.rst b/doc/web/storagebackends.rst index d191b43e5..1690a1420 100644 --- a/doc/web/storagebackends.rst +++ b/doc/web/storagebackends.rst @@ -1,6 +1,6 @@ .. _storagebackends: -.. currentmodule:: sphinx.websupport.storage +.. currentmodule:: sphinxcontrib.websupport.storage Storage Backends ================ @@ -21,6 +21,11 @@ documentation of the :class:`StorageBackend` class below. Defines an interface for storage backends. +.. versionchanged:: 1.6 + + StorageBackend class is moved to sphinxcontrib.websupport.storage from + sphinx.websupport.storage. + StorageBackend Methods ~~~~~~~~~~~~~~~~~~~~~~