mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-29 12:23:42 +03:00
Removed files used by the Epydoc documentation.
This commit is contained in:
parent
e11199c420
commit
8246b28563
|
@ -1,138 +0,0 @@
|
||||||
/* Based on the Epydoc "default.css"
|
|
||||||
** with some missing reST-related classes
|
|
||||||
** and Python syntax support (from SilverCity)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Body color */
|
|
||||||
body { background: #ffffff; color: #000000; }
|
|
||||||
|
|
||||||
/* Tables */
|
|
||||||
table.summary, table.details, table.index
|
|
||||||
{ background: #e8f0f8; color: #000000; }
|
|
||||||
tr.summary, tr.details, tr.index
|
|
||||||
{ background: #70b0f0; color: #000000;
|
|
||||||
text-align: left; font-size: 120%; }
|
|
||||||
tr.group { background: #c0e0f8; color: #000000;
|
|
||||||
text-align: left; font-size: 120%;
|
|
||||||
font-style: italic; }
|
|
||||||
|
|
||||||
/* Documentation page titles */
|
|
||||||
h2.module { margin-top: 0.2em; }
|
|
||||||
h2.class { margin-top: 0.2em; }
|
|
||||||
|
|
||||||
/* Headings */
|
|
||||||
h1.heading { font-size: +140%; font-style: italic;
|
|
||||||
font-weight: bold; }
|
|
||||||
h2.heading { font-size: +125%; font-style: italic;
|
|
||||||
font-weight: bold; }
|
|
||||||
h3.heading { font-size: +110%; font-style: italic;
|
|
||||||
font-weight: normal; }
|
|
||||||
|
|
||||||
/* Base tree */
|
|
||||||
pre.base-tree { font-size: 80%; margin: 0; }
|
|
||||||
|
|
||||||
/* TOC */
|
|
||||||
p.toc { margin: 0; }
|
|
||||||
|
|
||||||
/* Details Sections */
|
|
||||||
table.func-details { background: #e8f0f8; color: #000000;
|
|
||||||
border: 2px groove #c0d0d0;
|
|
||||||
padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }
|
|
||||||
h3.func-detail { background: transparent; color: #000000;
|
|
||||||
margin: 0 0 1em 0; }
|
|
||||||
|
|
||||||
table.var-details { background: #e8f0f8; color: #000000;
|
|
||||||
border: 2px groove #c0d0d0;
|
|
||||||
padding: 0 1em 0 1em; margin: 0.4em 0 0 0; }
|
|
||||||
h3.var-details { background: transparent; color: #000000;
|
|
||||||
margin: 0 0 1em 0; }
|
|
||||||
|
|
||||||
/* Function signatures */
|
|
||||||
.sig { background: transparent; color: #000000;
|
|
||||||
font-weight: bold; }
|
|
||||||
.sig-name { background: transparent; color: #006080; }
|
|
||||||
.sig-arg, .sig-kwarg, .sig-vararg
|
|
||||||
{ background: transparent; color: #008060; }
|
|
||||||
.sig-default { background: transparent; color: #602000; }
|
|
||||||
.summary-sig { background: transparent; color: #000000; }
|
|
||||||
.summary-sig-name { background: transparent; color: #204080; }
|
|
||||||
.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg
|
|
||||||
{ background: transparent; color: #008060; }
|
|
||||||
|
|
||||||
/* Doctest blocks */
|
|
||||||
.py-src { background: transparent; color: #000000; }
|
|
||||||
.py-prompt { background: transparent; color: #005050;
|
|
||||||
font-weight: bold;}
|
|
||||||
.py-string { background: transparent; color: #006030; }
|
|
||||||
.py-comment { background: transparent; color: #003060; }
|
|
||||||
.py-keyword { background: transparent; color: #600000; }
|
|
||||||
.py-output { background: transparent; color: #404040; }
|
|
||||||
div.code-block,
|
|
||||||
pre.literal-block,
|
|
||||||
pre.doctestblock { background: #f4faff; color: #000000;
|
|
||||||
padding: .5em; margin: 1em;
|
|
||||||
border: 1px solid #708890; }
|
|
||||||
table pre.doctestblock
|
|
||||||
{ background: #dce4ec; color: #000000;
|
|
||||||
padding: .5em; margin: 1em;
|
|
||||||
border: 1px solid #708890; }
|
|
||||||
div.code-block { font-family: monospace; }
|
|
||||||
|
|
||||||
/* Variable values */
|
|
||||||
pre.variable { background: #dce4ec; color: #000000;
|
|
||||||
padding: .5em; margin: 0;
|
|
||||||
border: 1px solid #708890; }
|
|
||||||
.variable-linewrap { background: transparent; color: #604000; }
|
|
||||||
.variable-ellipsis { background: transparent; color: #604000; }
|
|
||||||
.variable-quote { background: transparent; color: #604000; }
|
|
||||||
.re { background: transparent; color: #000000; }
|
|
||||||
.re-char { background: transparent; color: #006030; }
|
|
||||||
.re-op { background: transparent; color: #600000; }
|
|
||||||
.re-group { background: transparent; color: #003060; }
|
|
||||||
.re-ref { background: transparent; color: #404040; }
|
|
||||||
|
|
||||||
/* Navigation bar */
|
|
||||||
table.navbar { background: #a0c0ff; color: #0000ff;
|
|
||||||
border: 2px groove #c0d0d0; }
|
|
||||||
th.navbar { background: #a0c0ff; color: #0000ff; }
|
|
||||||
th.navselect { background: #70b0ff; color: #000000; }
|
|
||||||
.nomargin { margin: 0; }
|
|
||||||
|
|
||||||
/* Links */
|
|
||||||
a:link { background: transparent; color: #0000ff; }
|
|
||||||
a:visited { background: transparent; color: #204080; }
|
|
||||||
a.navbar:link { background: transparent; color: #0000ff;
|
|
||||||
text-decoration: none; }
|
|
||||||
a.navbar:visited { background: transparent; color: #204080;
|
|
||||||
text-decoration: none; }
|
|
||||||
|
|
||||||
/* Admonitions */
|
|
||||||
div.warning,
|
|
||||||
div.note { background-color: #c0e0f8;
|
|
||||||
border: thin solid black;
|
|
||||||
padding: 1em;
|
|
||||||
margin-left: 1em;
|
|
||||||
margin-right: 1em; }
|
|
||||||
div.warning .first,
|
|
||||||
div.note .first { font-family: sans-serif;
|
|
||||||
font-size: 110%;
|
|
||||||
margin-right: 0.5em; }
|
|
||||||
|
|
||||||
/* Lists */
|
|
||||||
ul { margin-top: 0; }
|
|
||||||
|
|
||||||
/* Python syntax */
|
|
||||||
.p_character { color: olive; }
|
|
||||||
.p_classname { color: blue; font-weight: bold; }
|
|
||||||
.p_commentblock {color: gray; font-style: italic; }
|
|
||||||
.p_commentline { color: green; font-style: italic; }
|
|
||||||
.p_default {}
|
|
||||||
.p_defname { color: #009999; font-weight: bold; }
|
|
||||||
.p_identifier { color: black; }
|
|
||||||
.p_number { color: #009999; }
|
|
||||||
.p_operator { color: black; }
|
|
||||||
.p_string { color: #7F007F; }
|
|
||||||
.p_stringeol { color: #7F007F; }
|
|
||||||
.p_triple { color: #7F0000; }
|
|
||||||
.p_tripledouble { color: #7F0000; }
|
|
||||||
.p_word { color: navy; font-weight: bold; }
|
|
|
@ -1,169 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# Author: Daniele Varrazzo
|
|
||||||
# Contact: daniele dot varrazzo at gmail dot com
|
|
||||||
# Revision: $Revision$
|
|
||||||
# Date: $Date$
|
|
||||||
# Copyright: This module has been placed in the public domain.
|
|
||||||
|
|
||||||
"""
|
|
||||||
A minimal front end to the Docutils Publisher, producing HTML.
|
|
||||||
|
|
||||||
Output can refer to Epydoc-generated APIs through the iterpreted text role
|
|
||||||
"api".
|
|
||||||
"""
|
|
||||||
|
|
||||||
import types
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# The url fragment where the api "index.html" resides w.r.t. the generated docs
|
|
||||||
api_root = "api/"
|
|
||||||
|
|
||||||
try:
|
|
||||||
import locale
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
from docutils.core import publish_cmdline, default_description
|
|
||||||
from docutils.parsers.rst.roles import register_canonical_role
|
|
||||||
from docutils import nodes, utils
|
|
||||||
|
|
||||||
# api references are searched for in these modules
|
|
||||||
api_modules = [
|
|
||||||
'psycopg2',
|
|
||||||
'psycopg2._psycopg',
|
|
||||||
'psycopg2.extensions',
|
|
||||||
]
|
|
||||||
|
|
||||||
# name starting with a dot are looking as those objects attributes.
|
|
||||||
searched_objects = [
|
|
||||||
# module_name, object_name
|
|
||||||
('psycopg2.extensions', 'connection'),
|
|
||||||
('psycopg2.extensions', 'cursor'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# import all the referenced modules
|
|
||||||
for modname in api_modules:
|
|
||||||
__import__(modname)
|
|
||||||
|
|
||||||
class EpydocTarget:
|
|
||||||
"""Representation of an element language."""
|
|
||||||
def __init__(self, name, element):
|
|
||||||
self.name = name
|
|
||||||
|
|
||||||
# The python object described
|
|
||||||
self.element = element
|
|
||||||
|
|
||||||
# The base name of the page
|
|
||||||
self.page = None
|
|
||||||
|
|
||||||
# The url fragment
|
|
||||||
self.fragment = None
|
|
||||||
|
|
||||||
def get_url(self):
|
|
||||||
# is it a private element?
|
|
||||||
components = self.page.split('.')
|
|
||||||
if self.fragment: components.append(self.fragment)
|
|
||||||
|
|
||||||
for component in components:
|
|
||||||
if component.startswith('_'):
|
|
||||||
private = True
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
private = False
|
|
||||||
|
|
||||||
ref = api_root + (private and "private/" or "public/") \
|
|
||||||
+ self.page + "-" + self.get_type() + ".html"
|
|
||||||
if self.fragment:
|
|
||||||
ref = ref + "#" + self.fragment
|
|
||||||
|
|
||||||
return ref
|
|
||||||
|
|
||||||
def get_type(self):
|
|
||||||
# detect the element type
|
|
||||||
if isinstance(self.element, types.TypeType):
|
|
||||||
return 'class'
|
|
||||||
elif isinstance(self.element, types.ModuleType):
|
|
||||||
return 'module'
|
|
||||||
else:
|
|
||||||
raise ValueError("Can't choose a type for '%s'." % self.name)
|
|
||||||
|
|
||||||
def filter_par(name):
|
|
||||||
"""Filter parenthesis away from a name."""
|
|
||||||
if name.endswith(")"):
|
|
||||||
return name.split("(")[0]
|
|
||||||
else:
|
|
||||||
return name
|
|
||||||
|
|
||||||
def get_element_target(name):
|
|
||||||
"""Return the life, the death, the miracles about a package element."""
|
|
||||||
|
|
||||||
name = filter_par(name)
|
|
||||||
|
|
||||||
if name.startswith('.'):
|
|
||||||
for modname, objname in searched_objects:
|
|
||||||
if hasattr(getattr(sys.modules[modname], objname), name[1:]):
|
|
||||||
name = objname + name
|
|
||||||
break
|
|
||||||
|
|
||||||
# is the element a module?
|
|
||||||
if name in api_modules:
|
|
||||||
out = EpydocTarget(name, sys.modules[name])
|
|
||||||
out.page = name
|
|
||||||
return out
|
|
||||||
|
|
||||||
# look for the element in some module
|
|
||||||
for modname in api_modules:
|
|
||||||
element = getattr(sys.modules[modname], name, None)
|
|
||||||
if element is not None:
|
|
||||||
|
|
||||||
# Check if it is a function defined in a module
|
|
||||||
if isinstance(element,
|
|
||||||
(int, types.FunctionType, types.BuiltinFunctionType)):
|
|
||||||
out = EpydocTarget(name, sys.modules[modname])
|
|
||||||
out.page = modname
|
|
||||||
out.fragment = name
|
|
||||||
else:
|
|
||||||
out = EpydocTarget(name, element)
|
|
||||||
out.page = modname + '.' + name
|
|
||||||
|
|
||||||
return out
|
|
||||||
|
|
||||||
# maybe a qualified name?
|
|
||||||
if '.' in name:
|
|
||||||
out = get_element_target('.'.join(name.split('.')[:-1]))
|
|
||||||
if out is not None:
|
|
||||||
out.fragment = filter_par(name.split('.')[-1])
|
|
||||||
return out
|
|
||||||
|
|
||||||
raise ValueError("Can't find '%s' in any provided module." % name)
|
|
||||||
|
|
||||||
def api_role(role, rawtext, text, lineno, inliner,
|
|
||||||
options={}, content=[]):
|
|
||||||
try:
|
|
||||||
target = get_element_target(text)
|
|
||||||
except Exception, exc:
|
|
||||||
msg = inliner.reporter.error(str(exc), line=lineno)
|
|
||||||
prb = inliner.problematic(rawtext, rawtext, msg)
|
|
||||||
return [prb], [msg]
|
|
||||||
|
|
||||||
ref = target.get_url()
|
|
||||||
node2 = nodes.literal(rawtext, utils.unescape(text))
|
|
||||||
node = nodes.reference(rawtext, '', node2, refuri=ref,
|
|
||||||
**options)
|
|
||||||
return [node], []
|
|
||||||
|
|
||||||
|
|
||||||
register_canonical_role('api', api_role)
|
|
||||||
|
|
||||||
# Register the 'api' role as canonical role
|
|
||||||
from docutils.parsers.rst import roles
|
|
||||||
roles.DEFAULT_INTERPRETED_ROLE = 'api'
|
|
||||||
|
|
||||||
|
|
||||||
description = ('Generates (X)HTML documents from standalone reStructuredText '
|
|
||||||
'sources with links to Epydoc API. ' + default_description)
|
|
||||||
|
|
||||||
|
|
||||||
publish_cmdline(writer_name='html', description=description)
|
|
|
@ -1,15 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
"""Build documentation and api."""
|
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
EPYDOC = "python c:/programmi/python23/scripts/epydoc.py"
|
|
||||||
PSYCOPG = "c:/programmi/python23/lib/site-packages/psycopg2"
|
|
||||||
|
|
||||||
os.system("python ext2html.py ../doc/extensions.rst > ../doc/extensions.html")
|
|
||||||
os.system("%s "
|
|
||||||
"-o ../doc/api "
|
|
||||||
"--css ../doc/api-screen.css "
|
|
||||||
"--docformat restructuredtext "
|
|
||||||
"%s"
|
|
||||||
% (EPYDOC,PSYCOPG,))
|
|
Loading…
Reference in New Issue
Block a user