mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 21:00:33 +03:00
Merge branch 'sphinx-1.6'
This commit is contained in:
commit
582fd95986
|
@ -1,3 +1,3 @@
|
||||||
# Packages only needed to build the docs
|
# Packages only needed to build the docs
|
||||||
Pygments>=1.5
|
Pygments>=2.2,<2.3
|
||||||
Sphinx>=1.2,<=1.3
|
Sphinx>=1.6,<=1.7
|
||||||
|
|
|
@ -551,7 +551,7 @@ The ``connection`` class
|
||||||
the session.
|
the session.
|
||||||
|
|
||||||
.. doctest::
|
.. doctest::
|
||||||
:options: NORMALIZE_WHITESPACE
|
:options: +NORMALIZE_WHITESPACE
|
||||||
|
|
||||||
>>> cur.execute("CREATE TABLE foo (id serial PRIMARY KEY);")
|
>>> cur.execute("CREATE TABLE foo (id serial PRIMARY KEY);")
|
||||||
>>> pprint(conn.notices)
|
>>> pprint(conn.notices)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
from sphinx.locale import _
|
from sphinx.locale import _
|
||||||
from sphinx.util.compat import Directive, make_admonition
|
from docutils.parsers.rst import Directive
|
||||||
|
|
||||||
class extension_node(nodes.Admonition, nodes.Element): pass
|
class extension_node(nodes.Admonition, nodes.Element): pass
|
||||||
|
|
||||||
|
@ -29,12 +29,11 @@ class Extension(Directive):
|
||||||
option_spec = {}
|
option_spec = {}
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
nodes = make_admonition(extension_node,
|
node = extension_node('\n'.join(self.content))
|
||||||
self.name, [_('DB API extension')], self.options,
|
node += nodes.title(_('DB API extension'), _('DB API extension'))
|
||||||
self.content, self.lineno, self.content_offset,
|
self.state.nested_parse(self.content, self.content_offset, node)
|
||||||
self.block_text, self.state, self.state_machine)
|
node['classes'].append('dbapi-extension')
|
||||||
nodes[0]['classes'].append('dbapi-extension')
|
return [node]
|
||||||
return nodes
|
|
||||||
|
|
||||||
|
|
||||||
def visit_extension_node(self, node):
|
def visit_extension_node(self, node):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user