Skip to content

Commit 84fd9af

Browse files
committed
docs: link to Client and TemplatingUtils class/method docstrings
pydoc.txt: new page. Has two example autodoc invocations: automethod and autoclass. docs.txt Added pydoc.txt as a hidden page in a new toc in docs.txt. Added includehidden in toc directive.Not sure what it does, but was part of a recipie to hide the pydoc from the main TOC. conf.py: added sphinx.ext.autodoc to get it pulling in the docs. reference.txt: added references to the pydoc using :py:meth: for templating utils methods like set-http_response and :py:class: for Client as the existing docs referenced the docstrings. Changed table formatting for the TemplatingUtils methods from table to list-table. The length of the references to the methods was too large to exist in the first column of a drawn table. For right now the pydoc stuff is only referenced via links from the main docs. Currently it is ugly, but the additional info on tempating utils and their arguments can be helpful. Added sphin
1 parent fd1a1e9 commit 84fd9af

File tree

4 files changed

+62
-25
lines changed

4 files changed

+62
-25
lines changed

doc/pydoc.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
================
2+
Pydocs from code
3+
================
4+
5+
.. contents::
6+
:local:
7+
8+
Client class
9+
============
10+
11+
.. autoclass:: roundup.cgi.client::Client
12+
13+
Templating Utils class
14+
======================
15+
16+
.. autoclass:: roundup.cgi.templating::TemplatingUtils
17+
:members:

doc/reference.txt

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ is used by ``roundup.cgi``, ``roundup-server`` and ``ZRoundup``
17451745
(``ZRoundup`` is broken, until further notice). In all cases, Roundup
17461746
determines which tracker is accessed (the first part of the URL
17471747
path inside the scope of the CGI handler) and pass control on to the
1748-
``roundup.cgi.client.Client`` class - which handles the rest of the
1748+
:py:class:`roundup.cgi.client.Client` class - which handles the rest of the
17491749
access through its ``main()`` method. This means that you can do pretty
17501750
much anything you want as a web interface to your tracker.
17511751

@@ -3467,26 +3467,38 @@ This is implemented by the
34673467
``roundup.cgi.templating.TemplatingUtils`` class. New methods can
34683468
be added to the variable by using extensions_.
34693469

3470-
.. table::
3471-
:class: valign-top
3472-
3473-
================= ========================================================
3474-
Method Description
3475-
================= ========================================================
3476-
Batch return a batch object using the supplied list
3477-
anti_csrf_nonce returns the random nonce generated for this session
3478-
expandfile load a file into a template and expand
3479-
'%(tokenname)s' in the file using
3480-
values from the supplied dictionary.
3481-
html_quote quote some text as safe in HTML (ie. <, >, ...)
3482-
html_calendar renders an HTML calendar used by the
3483-
``_generic.calendar.html`` template (itself invoked by
3484-
the popupCalendar DateHTMLProperty method
3485-
readfile read JavaScript or other content in an external
3486-
file into the template.
3487-
set_http_response sets the HTTP response code for the request.
3488-
url_quote quote some text as safe for a URL (ie. space, %, ...)
3489-
================= ========================================================
3470+
-----
3471+
3472+
.. list-table:: TemplatingUtils Methods
3473+
:align: left
3474+
:header-rows: 1
3475+
:class: valign-top captionbelow booktabs
3476+
3477+
* - Method
3478+
- Description
3479+
* - Batch
3480+
- return a batch object using the supplied list
3481+
* - anti_csrf_nonce
3482+
- returns the random nonce generated for this session
3483+
* - :meth:`expandfile <roundup.cgi.templating.TemplatingUtils.expandfile>`
3484+
- load a file into a template and expand
3485+
'%(tokenname)s' in the file using
3486+
values from the supplied dictionary.
3487+
* - :meth:`html_calendar <roundup.cgi.templating.TemplatingUtils.html_calendar>`
3488+
- renders an HTML calendar used by the ``_generic.calendar.html``
3489+
template (itself invoked by the popupCalendar DateHTMLProperty
3490+
method
3491+
* - :meth:`html_quote <roundup.cgi.templating.TemplatingUtils.html_quote>`
3492+
- quote some text as safe in HTML (ie. <, >, ...)
3493+
* - :meth:`readfile <roundup.cgi.templating.TemplatingUtils.readfile>`
3494+
- read JavaScript or other content in an external file
3495+
into the template.
3496+
* - :meth:`set_http_response <roundup.cgi.templating.TemplatingUtils.set_http_response>`
3497+
- set_http_response sets the HTTP response code for the request.
3498+
* - :meth:`url_quote <roundup.cgi.templating.TemplatingUtils.url_quote>`
3499+
- quote some text as safe for a URL (ie. space, %, ...)
3500+
3501+
-----
34903502

34913503
Additional info can be obtained by starting ``python`` with the
34923504
``roundup`` subdirectory on your PYTHONPATH and using the Python help
@@ -3960,7 +3972,8 @@ example ``myaction.py``::
39603972
'''
39613973

39623974
The *self.client* attribute is an instance of ``roundup.cgi.client.Client``.
3963-
See the docstring of that class for details of what it can do.
3975+
See the :class:`docstring of that class <roundup.cgi.client.Client>`
3976+
for details of what it can do.
39643977

39653978
The method will typically check the ``self.form`` variable's contents.
39663979
It may then:

website/www/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@
4545
# General configuration
4646
# ---------------------
4747

48-
# Add any Sphinx extension module names here, as strings. They can be extensions
49-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
50-
extensions = ["sphinxext.opengraph", 'sphinx_sitemap', 'sphinx_tabs.tabs',]
48+
# Add any Sphinx extension module names here, as strings. They can be
49+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
50+
extensions = ['sphinx.ext.autodoc', 'sphinxext.opengraph',
51+
'sphinx_sitemap', 'sphinx_tabs.tabs']
5152

5253
sphinx_tabs_valid_builders = ['linkcheck']
5354
sphinx_tabs_disable_tab_closing = True

website/www/docs.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ documentation.
2020

2121
.. toctree::
2222
:maxdepth: 2
23+
:includehidden:
2324

2425
Features <docs/features>
2526
Installation <docs/installation>
@@ -37,3 +38,8 @@ documentation.
3738
docs/license
3839
docs/acknowledgements
3940
olderdocs
41+
42+
.. toctree::
43+
:hidden:
44+
45+
docs/pydoc

0 commit comments

Comments
 (0)