summaryrefslogtreecommitdiff
path: root/sphinx/application.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-08 00:04:05 +0200
committerGeorg Brandl <georg@python.org>2009-09-08 00:04:05 +0200
commit747deb102b425af2b7b021b13ae339c85cd3e510 (patch)
tree9ac2211a1bf318ff158d91e191ff79944650a29e /sphinx/application.py
parentd7efd6a03f20f128aa3eda81f038f2f6e370429b (diff)
downloadsphinx-747deb102b425af2b7b021b13ae339c85cd3e510.tar.gz
app: allow giving the localized object name when adding new object types.
Diffstat (limited to 'sphinx/application.py')
-rw-r--r--sphinx/application.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/sphinx/application.py b/sphinx/application.py
index e5024872..14aee1be 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -379,9 +379,10 @@ class Sphinx(object):
all_domains[domain].roles[name] = role
def add_object_type(self, directivename, rolename, indextemplate='',
- parse_node=None, ref_nodeclass=None):
+ parse_node=None, ref_nodeclass=None, objname=''):
+ # XXX document objname
StandardDomain.object_types[directivename] = \
- ObjType(directivename, rolename)
+ ObjType(objname or directivename, rolename)
# create a subclass of GenericObject as the new directive
new_directive = type(directivename, (GenericObject, object),
{'indextemplate': indextemplate,
@@ -394,9 +395,10 @@ class Sphinx(object):
add_description_unit = add_object_type
def add_crossref_type(self, directivename, rolename, indextemplate='',
- ref_nodeclass=None):
+ ref_nodeclass=None, objname=''):
+ # XXX document objname
StandardDomain.object_types[directivename] = \
- ObjType(directivename, rolename)
+ ObjType(objname or directivename, rolename)
# create a subclass of Target as the new directive
new_directive = type(directivename, (Target, object),
{'indextemplate': indextemplate})