[telepathy-spec/master] doc-generator: Don't hardcode namespace and spec name

Will Thompson will.thompson at collabora.co.uk
Fri Sep 18 10:30:50 PDT 2009


This makes it easier to re-use the spec documentation tools for
extensions.
---
 Makefile               |    3 ++-
 tools/doc-generator.py |    8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 3e71b70..126f7ff 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,8 @@ test/output/spec.html: $(TEST_XMLS) tools/doc-generator.xsl
 
 doc/spec/index.html: $(XMLS) tools/doc-generator.py tools/specparser.py $(TEMPLATES)
 	@install -d doc
-	$(PYTHON) tools/doc-generator.py spec/all.xml doc/spec/
+	$(PYTHON) tools/doc-generator.py spec/all.xml doc/spec/ telepathy-spec \
+		org.freedesktop.Telepathy
 
 $(INTROSPECT): introspect/%.xml: spec/%.xml tools/spec-to-introspect.xsl
 	@install -d introspect
diff --git a/tools/doc-generator.py b/tools/doc-generator.py
index bd99f38..5fc19ce 100755
--- a/tools/doc-generator.py
+++ b/tools/doc-generator.py
@@ -37,7 +37,7 @@ except ImportError, e:
 
 import specparser
 
-program, spec_file, output_path = sys.argv
+program, spec_file, output_path, project, namespace = sys.argv
 
 template_path = os.path.join(os.path.dirname(program), '../doc/templates')
 
@@ -61,7 +61,7 @@ def load_template(filename):
 
     return template_def
 
-spec = specparser.parse(spec_file, "org.freedesktop.Telepathy")
+spec = specparser.parse(spec_file, namespace)
 
 # write out HTML files for each of the interfaces
 
@@ -95,9 +95,9 @@ render_template('errors.html', namespaces)
 render_template('interfaces.html', namespaces)
 render_template('fullindex.html', namespaces)
 
-dh_namespaces = { 'spec': spec, 'name': 'telepathy-spec' }
+dh_namespaces = { 'spec': spec, 'name': project }
 render_template('devhelp.devhelp2', dh_namespaces,
-    target='telepathy-spec.devhelp2')
+    target=('%s.devhelp2' % project))
 
 # write out the TOC last, because this is the file used as the target in the
 # Makefile.
-- 
1.5.6.5



More information about the telepathy-commits mailing list