mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-25 10:23:43 +03:00
NEWS file reformatted to reST and included in the docs
This commit is contained in:
parent
93928a7141
commit
abb3027aa3
|
@ -26,7 +26,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.ifconfig',
|
|||
'sphinx.ext.doctest', 'sphinx.ext.intersphinx' ]
|
||||
|
||||
# Specific extensions for Psycopg documentation.
|
||||
extensions += [ 'dbapi_extension', 'sql_role' ]
|
||||
extensions += [ 'dbapi_extension', 'sql_role', 'ticket_role' ]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
@ -65,6 +65,9 @@ intersphinx_mapping = {
|
|||
'py3': ('http://docs.python.org/3.2', None),
|
||||
}
|
||||
|
||||
# Pattern to generate links to the bug tracker
|
||||
ticket_url = 'http://psycopg.lighthouseapp.com/projects/62710/tickets/%s'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
|
|
@ -373,6 +373,8 @@ requires no adapter registration.
|
|||
List of component type oids of the type to be casted.
|
||||
|
||||
|
||||
.. _adapt-range:
|
||||
|
||||
.. index::
|
||||
pair: range; Data types
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ Psycopg 2 is both Unicode and Python 3 friendly.
|
|||
extras
|
||||
errorcodes
|
||||
faq
|
||||
news
|
||||
|
||||
|
||||
.. ifconfig:: builder != 'text'
|
||||
|
|
4
doc/src/news.rst
Normal file
4
doc/src/news.rst
Normal file
|
@ -0,0 +1,4 @@
|
|||
Release notes
|
||||
=============
|
||||
|
||||
.. include:: ../../NEWS
|
39
doc/src/tools/lib/ticket_role.py
Normal file
39
doc/src/tools/lib/ticket_role.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
ticket role
|
||||
~~~~~~~~~~~
|
||||
|
||||
An interpreted text role to link docs to lighthouse issues.
|
||||
|
||||
:copyright: Copyright 2013 by Daniele Varrazzo.
|
||||
"""
|
||||
|
||||
from docutils import nodes, utils
|
||||
from docutils.parsers.rst import roles
|
||||
|
||||
def ticket_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||
try:
|
||||
num = int(text.replace('#', ''))
|
||||
except ValueError:
|
||||
msg = inliner.reporter.error(
|
||||
"ticket number must be... a number, got '%s'" % text)
|
||||
prb = inliner.problematic(rawtext, rawtext, msg)
|
||||
return [prb], [msg]
|
||||
|
||||
url_pattern = inliner.document.settings.env.app.config.ticket_url
|
||||
if url_pattern is None:
|
||||
msg = inliner.reporter.warning(
|
||||
"ticket not configured: please configure ticket_url in conf.py")
|
||||
prb = inliner.problematic(rawtext, rawtext, msg)
|
||||
return [prb], [msg]
|
||||
|
||||
url = url_pattern % num
|
||||
roles.set_classes(options)
|
||||
node = nodes.reference(rawtext, 'ticket ' + utils.unescape(text),
|
||||
refuri=url, **options)
|
||||
return [node], []
|
||||
|
||||
def setup(app):
|
||||
app.add_config_value('ticket_url', None, 'env')
|
||||
app.add_role('ticket', ticket_role)
|
||||
|
Loading…
Reference in New Issue
Block a user