Skip to content

Commit 422fd07

Browse files
author
James William Pye
committed
Use sphinx's autodoc.
1 parent 42429cc commit 422fd07

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

sphinx-src/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ help:
2323
clean:
2424
-rm -rf *.txt
2525
-rm -rf ../sphinx
26-
-rm -f meta.py*
2726

2827
html: dump
2928
mkdir -p $(BUILD_DIR) $(BUILD_DIR)/doctrees
@@ -73,6 +72,6 @@ mkdirs:
7372
mkdir -p .static .templates
7473

7574
dump: mkdirs
76-
cp ../postgresql/__init__.py ./meta.py
7775
cp ../postgresql/documentation/*.txt ./
7876
cp index.rst index.txt
77+
cp modules.rst modules.txt

sphinx-src/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@
1313

1414
import sys, os
1515
sys.path.insert(0, '.')
16+
sys.dont_write_bytecode = True
1617

1718
# If your extensions are in another directory, add it here. If the directory
1819
# is relative to the documentation root, use os.path.abspath to make it
1920
# absolute, like shown here.
20-
#sys.path.append(os.path.abspath('some/directory'))
21+
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '../..'))
2122

2223
# General configuration
2324
# ---------------------
2425

2526
# Add any Sphinx extension module names here, as strings. They can be extensions
2627
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
27-
extensions = []
28+
extensions = ['sphinx.ext.autodoc']
2829

2930
# Add any paths that contain templates here, relative to this directory.
3031
templates_path = ['.templates']
@@ -36,7 +37,7 @@
3637
master_doc = 'index'
3738

3839
# General substitutions.
39-
import meta
40+
import postgresql as meta
4041
project = meta.__project__
4142
copyright = meta.__date__ + ', ' + meta.__author__
4243

sphinx-src/index.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ using PostgreSQL.
88
At its core, py-postgresql provides a PG-API, `postgresql.api`, and
99
DB-API 2.0 interface for using a PostgreSQL database.
1010

11-
1211
Contents
1312
--------
1413

@@ -19,10 +18,17 @@ Contents
1918
driver
2019
lib
2120
clientparameters
22-
bin
2321
gotchas
2422
changes
2523

24+
Reference
25+
---------
26+
27+
.. toctree::
28+
:maxdepth: 2
29+
30+
bin
31+
modules
2632

2733
Sample PG-API Code
2834
------------------

sphinx-src/modules.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Modules
2+
=======
3+
4+
Modules intended for general use.
5+
6+
:mod:`postgresql.string`
7+
------------------------
8+
9+
.. automodule::
10+
postgresql.string
11+
:members:
12+
:show-inheritance:
13+
14+
15+
:mod:`postgresql.types`
16+
-----------------------
17+
18+
.. automodule::
19+
postgresql.types
20+
:members:
21+
:show-inheritance:
22+

0 commit comments

Comments
 (0)