1.. _websupportapi: 2 3.. currentmodule:: sphinxcontrib.websupport 4 5The WebSupport Class 6==================== 7 8.. class:: WebSupport 9 10 The main API class for the web support package. All interactions with the 11 web support package should occur through this class. 12 13 The class takes the following keyword arguments: 14 15 srcdir 16 The directory containing reStructuredText source files. 17 18 builddir 19 The directory that build data and static files should be placed in. This 20 should be used when creating a :class:`WebSupport` object that will be 21 used to build data. 22 23 datadir 24 The directory that the web support data is in. This should be used when 25 creating a :class:`WebSupport` object that will be used to retrieve data. 26 27 search 28 This may contain either a string (e.g. 'xapian') referencing a built-in 29 search adapter to use, or an instance of a subclass of 30 :class:`~.search.BaseSearch`. 31 32 storage 33 This may contain either a string representing a database uri, or an 34 instance of a subclass of :class:`~.storage.StorageBackend`. If this is 35 not provided, a new sqlite database will be created. 36 37 moderation_callback 38 A callable to be called when a new comment is added that is not 39 displayed. It must accept one argument: a dictionary representing the 40 comment that was added. 41 42 staticdir 43 If the static files should be created in a different location 44 **and not in** ``'/static'``, this should be a string with the name of 45 that location (e.g. ``builddir + '/static_files'``). 46 47 .. note:: 48 If you specify ``staticdir``, you will typically want to adjust 49 ``staticroot`` accordingly. 50 51 staticroot 52 If the static files are not served from ``'/static'``, this should be a 53 string with the name of that location (e.g. ``'/static_files'``). 54 55 docroot 56 If the documentation is not served from the base path of a URL, this 57 should be a string specifying that path (e.g. ``'docs'``). 58 59 60.. versionchanged:: 1.6 61 62 WebSupport class is moved to sphinxcontrib.websupport from sphinx.websupport. 63 Please add ``sphinxcontrib-websupport`` package in your dependency and use 64 moved class instead. 65 66 67Methods 68------- 69 70.. automethod:: sphinxcontrib.websupport.WebSupport.build 71 72.. automethod:: sphinxcontrib.websupport.WebSupport.get_document 73 74.. automethod:: sphinxcontrib.websupport.WebSupport.get_data 75 76.. automethod:: sphinxcontrib.websupport.WebSupport.add_comment 77 78.. automethod:: sphinxcontrib.websupport.WebSupport.process_vote 79 80.. automethod:: sphinxcontrib.websupport.WebSupport.get_search_results 81