Skip to content

Commit 8ace6ad

Browse files
Allow recent Sphinx versions to be used for doc.
1 parent e65a2d4 commit 8ace6ad

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

doc/README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
Sphinx 4.2 is used to generate the HTML for the python-oracledb documentation.
1+
Sphinx is used to generate the HTML for the python-oracledb documentation.
22

33
The generated python-oracledb documentation is at https://python-oracledb.readthedocs.io/
44

55
This directory contains the documentation source. It is written using reST
6-
(re-Structured Text) format source files which are processed using Sphinx and
7-
turned into HTML, PDF or ePub documents. If you wish to build these yourself,
8-
you need to install Sphinx 4.2. Sphinx is available on many Linux distributions as a
9-
pre-built package. You can also install Sphinx 4.2 on all platforms using the Python
10-
package manager "pip". To install Sphinx 4.2, run the following command:
11-
pip install Sphinx==4.2.0
6+
(re-Structured Text). The source files are processed using Sphinx and can be
7+
turned into HTML, PDF or ePub documentation.
8+
9+
If you wish to build documentation yourself, install Sphinx. It is available
10+
on many Linux distributions as a pre-built package. You can also install it
11+
using the Python package manager "pip", for example::
12+
13+
python -m pip install Sphinx
1214

1315
For more information on Sphinx, please visit this page:
1416

1517
http://www.sphinx-doc.org
1618

17-
Once Sphinx 4.2 is installed, the supplied Makefile can be used to build the
18-
different targets.
19+
Once Sphinx is installed, the supplied Makefile can be used to build the
20+
different targets, for example to build the HTML documentation, run::
21+
22+
make
23+
24+
To make ePub documentation, run::
25+
26+
make epub
27+
28+
To make PDF documentation, run::
29+
30+
make pdf
31+
32+
The program ``latexmk`` may be required by Sphinx to generate PDF output.

doc/src/_ext/table_with_summary.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
# option on top of the regular "list-table" directive.
3030
#------------------------------------------------------------------------------
3131

32-
import sphinx.writers.html5
32+
import sphinx
3333
from docutils.parsers.rst import directives
3434
from docutils.parsers.rst.directives import tables
3535

36+
from packaging import version
37+
3638
class ListTableWithSummary(tables.ListTable):
3739

3840
option_spec = {'summary': directives.unchanged}
@@ -50,7 +52,10 @@ def run(self):
5052
class HTMLTranslator(sphinx.writers.html5.HTML5Translator):
5153

5254
def visit_table(self, node):
53-
self._table_row_index = 0
55+
if version.parse(sphinx.__version__) > version.parse('4.2.0'):
56+
self._table_row_indices = [0]
57+
else:
58+
self._table_row_index = 0
5459

5560
atts = {}
5661
classes = [cls.strip(' \t\n') \

0 commit comments

Comments
 (0)