[gobject-introspection/wip/doctool-improvements: 14/14] doc: Put documentation templates into their own directories



commit 8b23c6c8755bca0b0c58b25ee3c4b06c06d72bcd
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jan 9 03:11:06 2013 -0500

    doc: Put documentation templates into their own directories
    
    Instead of cluttering up the giscanner directory, put templates
    into their own files, with each language having its own templates
    in its own directory for comfort.

 Makefile-giscanner.am                              |   36 ++++++++++----------
 .../{ => doctemplates/C}/mallard-C-class.tmpl      |    0
 .../{ => doctemplates/C}/mallard-C-default.tmpl    |    0
 giscanner/{ => doctemplates/C}/mallard-C-enum.tmpl |    0
 .../{ => doctemplates/C}/mallard-C-function.tmpl   |    0
 .../{ => doctemplates/C}/mallard-C-namespace.tmpl  |    0
 .../{ => doctemplates/C}/mallard-C-property.tmpl   |    0
 .../{ => doctemplates/C}/mallard-C-record.tmpl     |    0
 .../{ => doctemplates/C}/mallard-C-signal.tmpl     |    0
 .../{ => doctemplates/C}/mallard-C-vfunc.tmpl      |    0
 .../Python}/mallard-Python-class.tmpl              |    0
 .../Python}/mallard-Python-default.tmpl            |    0
 .../Python}/mallard-Python-enum.tmpl               |    0
 .../Python}/mallard-Python-function.tmpl           |    0
 .../Python}/mallard-Python-namespace.tmpl          |    0
 .../Python}/mallard-Python-property.tmpl           |    0
 .../Python}/mallard-Python-record.tmpl             |    0
 .../Python}/mallard-Python-signal.tmpl             |    0
 .../Python}/mallard-Python-vfunc.tmpl              |    0
 giscanner/mallardwriter.py                         |    6 ++-
 20 files changed, 22 insertions(+), 20 deletions(-)
---
diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am
index 2bb9b6d..ef99904 100644
--- a/Makefile-giscanner.am
+++ b/Makefile-giscanner.am
@@ -42,24 +42,24 @@ pkgpyexec_PYTHON =			\
 	giscanner/libtoolimporter.py	\
 	giscanner/odict.py		\
 	giscanner/mallardwriter.py	\
-	giscanner/mallard-C-class.tmpl	\
-	giscanner/mallard-C-default.tmpl	\
-	giscanner/mallard-C-enum.tmpl	\
-	giscanner/mallard-C-function.tmpl	\
-	giscanner/mallard-C-namespace.tmpl	\
-	giscanner/mallard-C-property.tmpl	\
-	giscanner/mallard-C-record.tmpl	\
-	giscanner/mallard-C-signal.tmpl	\
-	giscanner/mallard-C-vfunc.tmpl	\
-	giscanner/mallard-Python-class.tmpl	\
-	giscanner/mallard-Python-default.tmpl	\
-	giscanner/mallard-Python-enum.tmpl	\
-	giscanner/mallard-Python-function.tmpl	\
-	giscanner/mallard-Python-namespace.tmpl	\
-	giscanner/mallard-Python-property.tmpl	\
-	giscanner/mallard-Python-record.tmpl	\
-	giscanner/mallard-Python-signal.tmpl	\
-	giscanner/mallard-Python-vfunc.tmpl	\
+	giscanner/doctemplates/C/mallard-C-class.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-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-default.tmpl	\
+	giscanner/doctemplates/Python/mallard-Python-enum.tmpl	\
+	giscanner/doctemplates/Python/mallard-Python-function.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/maintransformer.py	\
 	giscanner/message.py		\
 	giscanner/shlibs.py		\
diff --git a/giscanner/mallard-C-class.tmpl b/giscanner/doctemplates/C/mallard-C-class.tmpl
similarity index 100%
rename from giscanner/mallard-C-class.tmpl
rename to giscanner/doctemplates/C/mallard-C-class.tmpl
diff --git a/giscanner/mallard-C-default.tmpl b/giscanner/doctemplates/C/mallard-C-default.tmpl
similarity index 100%
rename from giscanner/mallard-C-default.tmpl
rename to giscanner/doctemplates/C/mallard-C-default.tmpl
diff --git a/giscanner/mallard-C-enum.tmpl b/giscanner/doctemplates/C/mallard-C-enum.tmpl
similarity index 100%
rename from giscanner/mallard-C-enum.tmpl
rename to giscanner/doctemplates/C/mallard-C-enum.tmpl
diff --git a/giscanner/mallard-C-function.tmpl b/giscanner/doctemplates/C/mallard-C-function.tmpl
similarity index 100%
rename from giscanner/mallard-C-function.tmpl
rename to giscanner/doctemplates/C/mallard-C-function.tmpl
diff --git a/giscanner/mallard-C-namespace.tmpl b/giscanner/doctemplates/C/mallard-C-namespace.tmpl
similarity index 100%
rename from giscanner/mallard-C-namespace.tmpl
rename to giscanner/doctemplates/C/mallard-C-namespace.tmpl
diff --git a/giscanner/mallard-C-property.tmpl b/giscanner/doctemplates/C/mallard-C-property.tmpl
similarity index 100%
rename from giscanner/mallard-C-property.tmpl
rename to giscanner/doctemplates/C/mallard-C-property.tmpl
diff --git a/giscanner/mallard-C-record.tmpl b/giscanner/doctemplates/C/mallard-C-record.tmpl
similarity index 100%
rename from giscanner/mallard-C-record.tmpl
rename to giscanner/doctemplates/C/mallard-C-record.tmpl
diff --git a/giscanner/mallard-C-signal.tmpl b/giscanner/doctemplates/C/mallard-C-signal.tmpl
similarity index 100%
rename from giscanner/mallard-C-signal.tmpl
rename to giscanner/doctemplates/C/mallard-C-signal.tmpl
diff --git a/giscanner/mallard-C-vfunc.tmpl b/giscanner/doctemplates/C/mallard-C-vfunc.tmpl
similarity index 100%
rename from giscanner/mallard-C-vfunc.tmpl
rename to giscanner/doctemplates/C/mallard-C-vfunc.tmpl
diff --git a/giscanner/mallard-Python-class.tmpl b/giscanner/doctemplates/Python/mallard-Python-class.tmpl
similarity index 100%
rename from giscanner/mallard-Python-class.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-class.tmpl
diff --git a/giscanner/mallard-Python-default.tmpl b/giscanner/doctemplates/Python/mallard-Python-default.tmpl
similarity index 100%
rename from giscanner/mallard-Python-default.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-default.tmpl
diff --git a/giscanner/mallard-Python-enum.tmpl b/giscanner/doctemplates/Python/mallard-Python-enum.tmpl
similarity index 100%
rename from giscanner/mallard-Python-enum.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-enum.tmpl
diff --git a/giscanner/mallard-Python-function.tmpl b/giscanner/doctemplates/Python/mallard-Python-function.tmpl
similarity index 100%
rename from giscanner/mallard-Python-function.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-function.tmpl
diff --git a/giscanner/mallard-Python-namespace.tmpl b/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl
similarity index 100%
rename from giscanner/mallard-Python-namespace.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-namespace.tmpl
diff --git a/giscanner/mallard-Python-property.tmpl b/giscanner/doctemplates/Python/mallard-Python-property.tmpl
similarity index 100%
rename from giscanner/mallard-Python-property.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-property.tmpl
diff --git a/giscanner/mallard-Python-record.tmpl b/giscanner/doctemplates/Python/mallard-Python-record.tmpl
similarity index 100%
rename from giscanner/mallard-Python-record.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-record.tmpl
diff --git a/giscanner/mallard-Python-signal.tmpl b/giscanner/doctemplates/Python/mallard-Python-signal.tmpl
similarity index 100%
rename from giscanner/mallard-Python-signal.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-signal.tmpl
diff --git a/giscanner/mallard-Python-vfunc.tmpl b/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
similarity index 100%
rename from giscanner/mallard-Python-vfunc.tmpl
rename to giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py
index c8ab67d..801df08 100644
--- a/giscanner/mallardwriter.py
+++ b/giscanner/mallardwriter.py
@@ -413,9 +413,11 @@ class MallardWriter(object):
     def _get_template_lookup(self):
         if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ:
             top_srcdir = os.environ['UNINSTALLED_INTROSPECTION_SRCDIR']
-            template_dir = os.path.join(top_srcdir, 'giscanner')
+            srcdir = os.path.join(top_srcdir, 'giscanner')
         else:
-            template_dir = os.path.dirname(__file__)
+            srcdir = os.path.dirname(__file__)
+
+        template_dir = os.path.join(srcdir, 'doctemplates', self._language)
 
         return TemplateLookup(directories=[template_dir],
                               module_directory=tempfile.gettempdir(),



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