[gobject-introspection] doctool: Rename templates to exclude mallard/the language



commit 44dea29977be349304a905e01b3ec89f7bdc6168
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jan 31 18:44:09 2013 -0500

    doctool: Rename templates to exclude mallard/the language
    
    As templates are in their own directory and segregated into language
    already, this is sort of repeating the issue. At the same time, always
    explicitly use relative ("./") or absolute ("/") lookups for templates.
    
    We want to eventually have base templates to share between languages, so
    to do so without namespace clashes makes sense.

 Makefile-giscanner.am                              |   46 ++++++++++----------
 .../C/{mallard-C-class.tmpl => class.tmpl}         |    2 +-
 giscanner/doctemplates/C/constructor.tmpl          |    1 +
 giscanner/doctemplates/C/default.tmpl              |    1 +
 giscanner/doctemplates/C/enum.tmpl                 |    2 +
 .../C/{mallard-C-function.tmpl => function.tmpl}   |    2 +-
 .../doctemplates/C/mallard-C-constructor.tmpl      |    1 -
 giscanner/doctemplates/C/mallard-C-default.tmpl    |    1 -
 giscanner/doctemplates/C/mallard-C-enum.tmpl       |    2 -
 giscanner/doctemplates/C/mallard-C-method.tmpl     |    1 -
 giscanner/doctemplates/C/mallard-C-record.tmpl     |    1 -
 giscanner/doctemplates/C/method.tmpl               |    1 +
 .../C/{mallard-C-namespace.tmpl => namespace.tmpl} |    2 +-
 .../C/{mallard-C-property.tmpl => property.tmpl}   |    2 +-
 giscanner/doctemplates/C/record.tmpl               |    1 +
 .../C/{mallard-C-signal.tmpl => signal.tmpl}       |    2 +-
 .../C/{mallard-C-vfunc.tmpl => vfunc.tmpl}         |    2 +-
 .../{mallard-Python-class.tmpl => class.tmpl}      |    2 +-
 giscanner/doctemplates/Python/constructor.tmpl     |    1 +
 giscanner/doctemplates/Python/default.tmpl         |    1 +
 .../Python/{mallard-Python-enum.tmpl => enum.tmpl} |    2 +-
 ...{mallard-Python-function.tmpl => function.tmpl} |    2 +-
 .../Python/mallard-Python-constructor.tmpl         |    1 -
 .../Python/mallard-Python-default.tmpl             |    1 -
 .../doctemplates/Python/mallard-Python-method.tmpl |    1 -
 .../doctemplates/Python/mallard-Python-record.tmpl |    2 -
 giscanner/doctemplates/Python/method.tmpl          |    1 +
 ...allard-Python-namespace.tmpl => namespace.tmpl} |    2 +-
 ...{mallard-Python-property.tmpl => property.tmpl} |    2 +-
 giscanner/doctemplates/Python/record.tmpl          |    2 +
 .../{mallard-Python-signal.tmpl => signal.tmpl}    |    2 +-
 .../{mallard-Python-vfunc.tmpl => vfunc.tmpl}      |    2 +-
 .../doctemplates/{mallard-base.tmpl => base.tmpl}  |    0
 giscanner/mallardwriter.py                         |    5 +-
 34 files changed, 49 insertions(+), 50 deletions(-)
---
diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am
index 35eac1d..b586439 100644
--- a/Makefile-giscanner.am
+++ b/Makefile-giscanner.am
@@ -54,29 +54,29 @@ pkgpyexec_PYTHON =		\
 
 templatedir = $(pkglibdir)
 nobase_template_DATA =		\
-	giscanner/doctemplates/mallard-base.tmpl	\
-	giscanner/doctemplates/C/mallard-C-class.tmpl	\
-	giscanner/doctemplates/C/mallard-C-constructor.tmpl	\
-	giscanner/doctemplates/C/mallard-C-default.tmpl	\
-	giscanner/doctemplates/C/mallard-C-enum.tmpl	\
-	giscanner/doctemplates/C/mallard-C-function.tmpl	\
-	giscanner/doctemplates/C/mallard-C-method.tmpl		\
-	giscanner/doctemplates/C/mallard-C-namespace.tmpl	\
-	giscanner/doctemplates/C/mallard-C-property.tmpl	\
-	giscanner/doctemplates/C/mallard-C-record.tmpl	\
-	giscanner/doctemplates/C/mallard-C-signal.tmpl	\
-	giscanner/doctemplates/C/mallard-C-vfunc.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-class.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-constructor.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-default.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-enum.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-function.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-method.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-namespace.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-property.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-record.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-signal.tmpl	\
-	giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
+	giscanner/doctemplates/base.tmpl	\
+	giscanner/doctemplates/C/class.tmpl	\
+	giscanner/doctemplates/C/constructor.tmpl	\
+	giscanner/doctemplates/C/default.tmpl	\
+	giscanner/doctemplates/C/enum.tmpl	\
+	giscanner/doctemplates/C/function.tmpl	\
+	giscanner/doctemplates/C/method.tmpl		\
+	giscanner/doctemplates/C/namespace.tmpl	\
+	giscanner/doctemplates/C/property.tmpl	\
+	giscanner/doctemplates/C/record.tmpl	\
+	giscanner/doctemplates/C/signal.tmpl	\
+	giscanner/doctemplates/C/vfunc.tmpl	\
+	giscanner/doctemplates/Python/class.tmpl	\
+	giscanner/doctemplates/Python/constructor.tmpl	\
+	giscanner/doctemplates/Python/default.tmpl	\
+	giscanner/doctemplates/Python/enum.tmpl	\
+	giscanner/doctemplates/Python/function.tmpl	\
+	giscanner/doctemplates/Python/method.tmpl	\
+	giscanner/doctemplates/Python/namespace.tmpl	\
+	giscanner/doctemplates/Python/property.tmpl	\
+	giscanner/doctemplates/Python/record.tmpl	\
+	giscanner/doctemplates/Python/signal.tmpl	\
+	giscanner/doctemplates/Python/vfunc.tmpl
 
 _giscanner_la_CFLAGS = \
 	$(PYTHON_INCLUDES) \
diff --git a/giscanner/doctemplates/C/mallard-C-class.tmpl b/giscanner/doctemplates/C/class.tmpl
similarity index 96%
rename from giscanner/doctemplates/C/mallard-C-class.tmpl
rename to giscanner/doctemplates/C/class.tmpl
index a627ace..22a086c 100644
--- a/giscanner/doctemplates/C/mallard-C-class.tmpl
+++ b/giscanner/doctemplates/C/class.tmpl
@@ -1,5 +1,5 @@
 <%! page_type="guide" %>\
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="synopsis">
   <synopsis ui:expanded="no">
     <title>Hierarchy</title>
diff --git a/giscanner/doctemplates/C/constructor.tmpl b/giscanner/doctemplates/C/constructor.tmpl
new file mode 100644
index 0000000..a03d282
--- /dev/null
+++ b/giscanner/doctemplates/C/constructor.tmpl
@@ -0,0 +1 @@
+<%inherit file="./function.tmpl"/>
diff --git a/giscanner/doctemplates/C/default.tmpl b/giscanner/doctemplates/C/default.tmpl
new file mode 100644
index 0000000..b66ae92
--- /dev/null
+++ b/giscanner/doctemplates/C/default.tmpl
@@ -0,0 +1 @@
+<%inherit file="/base.tmpl"/>
diff --git a/giscanner/doctemplates/C/enum.tmpl b/giscanner/doctemplates/C/enum.tmpl
new file mode 100644
index 0000000..1523e0d
--- /dev/null
+++ b/giscanner/doctemplates/C/enum.tmpl
@@ -0,0 +1,2 @@
+<%! page_type="guide" %>\
+<%inherit file="/base.tmpl"/>
diff --git a/giscanner/doctemplates/C/mallard-C-function.tmpl b/giscanner/doctemplates/C/function.tmpl
similarity index 98%
rename from giscanner/doctemplates/C/mallard-C-function.tmpl
rename to giscanner/doctemplates/C/function.tmpl
index 84cace0..01c653b 100644
--- a/giscanner/doctemplates/C/mallard-C-function.tmpl
+++ b/giscanner/doctemplates/C/function.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="info">
 % if node.parent is not None:
     <link type="guide" xref="${namespace.name}.${node.parent.name}" group="${page_style}"/>
diff --git a/giscanner/doctemplates/C/method.tmpl b/giscanner/doctemplates/C/method.tmpl
new file mode 100644
index 0000000..a03d282
--- /dev/null
+++ b/giscanner/doctemplates/C/method.tmpl
@@ -0,0 +1 @@
+<%inherit file="./function.tmpl"/>
diff --git a/giscanner/doctemplates/C/mallard-C-namespace.tmpl b/giscanner/doctemplates/C/namespace.tmpl
similarity index 92%
rename from giscanner/doctemplates/C/mallard-C-namespace.tmpl
rename to giscanner/doctemplates/C/namespace.tmpl
index 28cd470..10745fa 100644
--- a/giscanner/doctemplates/C/mallard-C-namespace.tmpl
+++ b/giscanner/doctemplates/C/namespace.tmpl
@@ -1,5 +1,5 @@
 <%! page_type="guide" %>\
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="doc">
 </%block>
 <%block name="links">
diff --git a/giscanner/doctemplates/C/mallard-C-property.tmpl b/giscanner/doctemplates/C/property.tmpl
similarity index 82%
rename from giscanner/doctemplates/C/mallard-C-property.tmpl
rename to giscanner/doctemplates/C/property.tmpl
index cceb62d..e3eb051 100644
--- a/giscanner/doctemplates/C/mallard-C-property.tmpl
+++ b/giscanner/doctemplates/C/property.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="info">
     <link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
     <title type="link" role="topic">${node.name}</title>
diff --git a/giscanner/doctemplates/C/record.tmpl b/giscanner/doctemplates/C/record.tmpl
new file mode 100644
index 0000000..b66ae92
--- /dev/null
+++ b/giscanner/doctemplates/C/record.tmpl
@@ -0,0 +1 @@
+<%inherit file="/base.tmpl"/>
diff --git a/giscanner/doctemplates/C/mallard-C-signal.tmpl b/giscanner/doctemplates/C/signal.tmpl
similarity index 82%
rename from giscanner/doctemplates/C/mallard-C-signal.tmpl
rename to giscanner/doctemplates/C/signal.tmpl
index cceb62d..e3eb051 100644
--- a/giscanner/doctemplates/C/mallard-C-signal.tmpl
+++ b/giscanner/doctemplates/C/signal.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="info">
     <link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
     <title type="link" role="topic">${node.name}</title>
diff --git a/giscanner/doctemplates/C/mallard-C-vfunc.tmpl b/giscanner/doctemplates/C/vfunc.tmpl
similarity index 93%
rename from giscanner/doctemplates/C/mallard-C-vfunc.tmpl
rename to giscanner/doctemplates/C/vfunc.tmpl
index 34c25b1..902b886 100644
--- a/giscanner/doctemplates/C/mallard-C-vfunc.tmpl
+++ b/giscanner/doctemplates/C/vfunc.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="info">
     <link type="guide" xref="${namespace.name}.${node.parent.name}" group="vfunc"/>
 </%block>
diff --git a/giscanner/doctemplates/Python/mallard-Python-class.tmpl b/giscanner/doctemplates/Python/class.tmpl
similarity index 97%
rename from giscanner/doctemplates/Python/mallard-Python-class.tmpl
rename to giscanner/doctemplates/Python/class.tmpl
index f4de812..41e6e49 100644
--- a/giscanner/doctemplates/Python/mallard-Python-class.tmpl
+++ b/giscanner/doctemplates/Python/class.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="synopsis">
   <synopsis><code>
 from gi.repository import ${namespace.name}
diff --git a/giscanner/doctemplates/Python/constructor.tmpl b/giscanner/doctemplates/Python/constructor.tmpl
new file mode 100644
index 0000000..a03d282
--- /dev/null
+++ b/giscanner/doctemplates/Python/constructor.tmpl
@@ -0,0 +1 @@
+<%inherit file="./function.tmpl"/>
diff --git a/giscanner/doctemplates/Python/default.tmpl b/giscanner/doctemplates/Python/default.tmpl
new file mode 100644
index 0000000..b66ae92
--- /dev/null
+++ b/giscanner/doctemplates/Python/default.tmpl
@@ -0,0 +1 @@
+<%inherit file="/base.tmpl"/>
diff --git a/giscanner/doctemplates/Python/mallard-Python-enum.tmpl b/giscanner/doctemplates/Python/enum.tmpl
similarity index 86%
rename from giscanner/doctemplates/Python/mallard-Python-enum.tmpl
rename to giscanner/doctemplates/Python/enum.tmpl
index 69d2c33..840f79f 100644
--- a/giscanner/doctemplates/Python/mallard-Python-enum.tmpl
+++ b/giscanner/doctemplates/Python/enum.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="details">
 % if node.members:
 <dl>
diff --git a/giscanner/doctemplates/Python/mallard-Python-function.tmpl b/giscanner/doctemplates/Python/function.tmpl
similarity index 97%
rename from giscanner/doctemplates/Python/mallard-Python-function.tmpl
rename to giscanner/doctemplates/Python/function.tmpl
index 65adb1d..467cfcb 100644
--- a/giscanner/doctemplates/Python/mallard-Python-function.tmpl
+++ b/giscanner/doctemplates/Python/function.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="info">
 % if node.parent is not None:
     <link type="guide" xref="${namespace.name}.${node.parent.name}" group="${page_style}"/>
diff --git a/giscanner/doctemplates/Python/method.tmpl b/giscanner/doctemplates/Python/method.tmpl
new file mode 100644
index 0000000..a03d282
--- /dev/null
+++ b/giscanner/doctemplates/Python/method.tmpl
@@ -0,0 +1 @@
+<%inherit file="./function.tmpl"/>
diff --git a/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl b/giscanner/doctemplates/Python/namespace.tmpl
similarity index 92%
rename from giscanner/doctemplates/Python/mallard-Python-namespace.tmpl
rename to giscanner/doctemplates/Python/namespace.tmpl
index 28cd470..10745fa 100644
--- a/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl
+++ b/giscanner/doctemplates/Python/namespace.tmpl
@@ -1,5 +1,5 @@
 <%! page_type="guide" %>\
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="doc">
 </%block>
 <%block name="links">
diff --git a/giscanner/doctemplates/Python/mallard-Python-property.tmpl b/giscanner/doctemplates/Python/property.tmpl
similarity index 91%
rename from giscanner/doctemplates/Python/mallard-Python-property.tmpl
rename to giscanner/doctemplates/Python/property.tmpl
index 32d673b..f05bc82 100644
--- a/giscanner/doctemplates/Python/mallard-Python-property.tmpl
+++ b/giscanner/doctemplates/Python/property.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="info">
     <link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
     <title type="link" role="topic">${node.name}</title>
diff --git a/giscanner/doctemplates/Python/record.tmpl b/giscanner/doctemplates/Python/record.tmpl
new file mode 100644
index 0000000..1523e0d
--- /dev/null
+++ b/giscanner/doctemplates/Python/record.tmpl
@@ -0,0 +1,2 @@
+<%! page_type="guide" %>\
+<%inherit file="/base.tmpl"/>
diff --git a/giscanner/doctemplates/Python/mallard-Python-signal.tmpl b/giscanner/doctemplates/Python/signal.tmpl
similarity index 97%
rename from giscanner/doctemplates/Python/mallard-Python-signal.tmpl
rename to giscanner/doctemplates/Python/signal.tmpl
index 8c721b9..9b27746 100644
--- a/giscanner/doctemplates/Python/mallard-Python-signal.tmpl
+++ b/giscanner/doctemplates/Python/signal.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="info">
     <link type="guide" xref="${namespace.name}.${node.parent.name}" group="signal"/>
     <title type="link" role="topic">${node.name}</title>
diff --git a/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl b/giscanner/doctemplates/Python/vfunc.tmpl
similarity index 95%
rename from giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
rename to giscanner/doctemplates/Python/vfunc.tmpl
index cf51f7c..65f856a 100644
--- a/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
+++ b/giscanner/doctemplates/Python/vfunc.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="mallard-base.tmpl"/>
+<%inherit file="/base.tmpl"/>
 <%block name="synopsis">
 <synopsis><code mime="text/x-python">
 % if len(node.parameters) != 0:
diff --git a/giscanner/doctemplates/mallard-base.tmpl b/giscanner/doctemplates/base.tmpl
similarity index 100%
rename from giscanner/doctemplates/mallard-base.tmpl
rename to giscanner/doctemplates/base.tmpl
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py
index 2d435aa..b00de1f 100644
--- a/giscanner/mallardwriter.py
+++ b/giscanner/mallardwriter.py
@@ -463,9 +463,8 @@ class MallardWriter(object):
             srcdir = os.path.dirname(__file__)
 
         template_dir = os.path.join(srcdir, 'doctemplates')
-        language_dir = os.path.join(template_dir, self._language)
 
-        return TemplateLookup(directories=[template_dir, language_dir],
+        return TemplateLookup(directories=[template_dir],
                               module_directory=tempfile.mkdtemp(),
                               output_encoding='utf-8')
 
@@ -496,7 +495,7 @@ class MallardWriter(object):
         namespace = self._transformer.namespace
 
         node_kind = get_node_kind(node)
-        template_name = 'mallard-%s-%s.tmpl' % (self._language, node_kind)
+        template_name = '%s/%s.tmpl' % (self._language, node_kind)
         page_id = make_page_id(node)
 
         template = self._lookup.get_template(template_name)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]