diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-12-08 13:05:41 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-12-08 13:05:44 +0000 |
commit | 4925e71c8cdf50c650d3c3aed9843678eb2c54e9 (patch) | |
tree | 15fd932854f1480f967c1bb22467f835517ae621 | |
parent | 04fe7c2679588238c4330bef2a1f11e9d2f71440 (diff) | |
parent | fa92decba875a13e8c12431aef83e9e8ea56276d (diff) |
Merge branch 'devhelpful'
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32081
-rw-r--r-- | doc/templates/devhelp.devhelp2 | 4 | ||||
-rw-r--r-- | tools/specparser.py | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/doc/templates/devhelp.devhelp2 b/doc/templates/devhelp.devhelp2 index af327fa6..6cf685ac 100644 --- a/doc/templates/devhelp.devhelp2 +++ b/doc/templates/devhelp.devhelp2 @@ -10,9 +10,11 @@ </chapters> <functions> #for $obj in $spec.everything.values() + $spec.types.values() + $spec.errors.values() - <keyword type="$obj.devhelp_name" name="$obj.get_title()" link="$obj.get_url()" #slurp +#for $entry in $obj.get_index_entries() + <keyword type="$obj.devhelp_name" name="$entry" link="$obj.get_url()" #slurp #if $obj.deprecated: deprecated="true" #slurp /> #end for +#end for </functions> </book> diff --git a/tools/specparser.py b/tools/specparser.py index d11d0c04..f54e55a9 100644 --- a/tools/specparser.py +++ b/tools/specparser.py @@ -400,6 +400,15 @@ WARNING: Key '%s' not known in namespace '%s' def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.name) + def get_index_entries(self): + context = self.parent.get_index_context() + return set([ + '%s (%s in %s)' % (self.short_name, self.get_type_name(), context), + '%s %s' % (self.get_type_name(), self.name)]) + + def get_index_context(self): + return self.short_name + class DBusConstruct(Base): """Base class for signals, methods and properties.""" @@ -1102,7 +1111,7 @@ class SectionBase(object): """ def __init__(self, dom, spec_namespace): - + self.spec_namespace = spec_namespace self.items = [] def recurse(nodes): @@ -1123,6 +1132,9 @@ class SectionBase(object): recurse(dom.childNodes) + def get_index_context(self): + return self.spec_namespace + class Section(Base, SectionBase): def __init__(self, parent, namespace, dom, spec_namespace): Base.__init__(self, parent, namespace, dom) @@ -1139,6 +1151,7 @@ class Spec(SectionBase): def __init__(self, dom, spec_namespace, allow_externals=False): self.document = dom self.spec_namespace = spec_namespace + self.short_name = spec_namespace self.allow_externals = allow_externals # build a dictionary of errors in this spec |