From 153ed5c5719bf244c299aa8c953da925770d093c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 6 May 2010 15:22:30 +0100 Subject: List all types in the full index, not just the generic ones --- doc/templates/fullindex.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/templates') diff --git a/doc/templates/fullindex.html b/doc/templates/fullindex.html index 2c465e1d..7ad3153e 100644 --- a/doc/templates/fullindex.html +++ b/doc/templates/fullindex.html @@ -8,7 +8,7 @@ #set $star = [] -#for $item in $spec.everything.values() + $spec.errors.values() + $spec.generic_types +#for $item in $spec.everything.values() + $spec.errors.values() + $spec.types.values() #echo $star.append(($item.short_name, $item)) #slurp #end for -- cgit v1.2.3 From 581ee23c6787ae63098d1d8eec893f0664d9996e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 7 Apr 2010 19:18:15 +0100 Subject: Sort errors by name in output --- doc/templates/errors.html | 4 ++-- tools/specparser.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'doc/templates') diff --git a/doc/templates/errors.html b/doc/templates/errors.html index 907d6601..0a4d52c9 100644 --- a/doc/templates/errors.html +++ b/doc/templates/errors.html @@ -18,7 +18,7 @@

Errors

- #for $error in $spec.errors.values() + #for $error in $spec.sorted_errors #if $error.deprecated #else @@ -36,7 +36,7 @@

Errors

- #for $error in $spec.errors.values() + #for $error in $spec.sorted_errors
(Permalink) diff --git a/tools/specparser.py b/tools/specparser.py index 650c90e4..7937c131 100644 --- a/tools/specparser.py +++ b/tools/specparser.py @@ -821,6 +821,9 @@ class Spec(SectionBase): except IndexError: self.errors = {} + self.sorted_errors = sorted(self.errors.values(), + key=lambda e: e.name) + # build a list of generic types self.generic_types = reduce (lambda a, b: a + b, map(lambda l: parse_types(self, l), -- cgit v1.2.3 From afddfa3c8855cf1724df95c69b56b416c7846e21 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 7 Apr 2010 19:28:57 +0100 Subject: Display the errors section's introduction in the HTML --- doc/templates/errors.html | 4 ++++ tools/specparser.py | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'doc/templates') diff --git a/doc/templates/errors.html b/doc/templates/errors.html index 0a4d52c9..82c08058 100644 --- a/doc/templates/errors.html +++ b/doc/templates/errors.html @@ -33,6 +33,10 @@
+ #if $spec.errors_section + $spec.errors_section.get_docstring() + #end if +

Errors

diff --git a/tools/specparser.py b/tools/specparser.py index 7937c131..6d87f14e 100644 --- a/tools/specparser.py +++ b/tools/specparser.py @@ -810,6 +810,10 @@ class Section(Base, SectionBase): def get_root_namespace(self): return None +class ErrorsSection(Section): + def validate(self): + pass + class Spec(SectionBase): def __init__(self, dom, spec_namespace): # build a dictionary of errors in this spec @@ -818,8 +822,11 @@ class Spec(SectionBase): self.errors = build_dict(self, Error, errorsnode.getAttribute('namespace'), errorsnode.getElementsByTagNameNS(XMLNS_TP, 'error')) + self.errors_section = ErrorsSection(self, None, errorsnode, + spec_namespace) except IndexError: self.errors = {} + self.errors_section = None self.sorted_errors = sorted(self.errors.values(), key=lambda e: e.name) -- cgit v1.2.3