diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-01-31 18:44:09 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-02-01 19:47:41 -0500 |
commit | 44dea29977be349304a905e01b3ec89f7bdc6168 (patch) | |
tree | b81a817f9642a788813e7f28d80f3bef4ac6f30c | |
parent | 217916ca496827aa494d956787e2700b21c66aaa (diff) | |
download | gobject-introspection-44dea29977be349304a905e01b3ec89f7bdc6168.tar.gz |
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.
34 files changed, 49 insertions, 50 deletions
diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am index 35eac1d6..b5864392 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 index a627ace4..22a086cc 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 00000000..a03d2825 --- /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 00000000..b66ae926 --- /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 00000000..1523e0df --- /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 index 84cace06..01c653b9 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/mallard-C-constructor.tmpl b/giscanner/doctemplates/C/mallard-C-constructor.tmpl deleted file mode 100644 index f373dfbe..00000000 --- a/giscanner/doctemplates/C/mallard-C-constructor.tmpl +++ /dev/null @@ -1 +0,0 @@ -<%inherit file="mallard-C-function.tmpl"/> diff --git a/giscanner/doctemplates/C/mallard-C-default.tmpl b/giscanner/doctemplates/C/mallard-C-default.tmpl deleted file mode 100644 index 991f29be..00000000 --- a/giscanner/doctemplates/C/mallard-C-default.tmpl +++ /dev/null @@ -1 +0,0 @@ -<%inherit file="mallard-base.tmpl"/> diff --git a/giscanner/doctemplates/C/mallard-C-enum.tmpl b/giscanner/doctemplates/C/mallard-C-enum.tmpl deleted file mode 100644 index cfe71c15..00000000 --- a/giscanner/doctemplates/C/mallard-C-enum.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -<%! page_type="guide" %>\ -<%inherit file="mallard-base.tmpl"/> diff --git a/giscanner/doctemplates/C/mallard-C-method.tmpl b/giscanner/doctemplates/C/mallard-C-method.tmpl deleted file mode 100644 index f373dfbe..00000000 --- a/giscanner/doctemplates/C/mallard-C-method.tmpl +++ /dev/null @@ -1 +0,0 @@ -<%inherit file="mallard-C-function.tmpl"/> diff --git a/giscanner/doctemplates/C/mallard-C-record.tmpl b/giscanner/doctemplates/C/mallard-C-record.tmpl deleted file mode 100644 index 991f29be..00000000 --- a/giscanner/doctemplates/C/mallard-C-record.tmpl +++ /dev/null @@ -1 +0,0 @@ -<%inherit file="mallard-base.tmpl"/> diff --git a/giscanner/doctemplates/C/method.tmpl b/giscanner/doctemplates/C/method.tmpl new file mode 100644 index 00000000..a03d2825 --- /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 index 28cd4708..10745fae 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 index cceb62de..e3eb0511 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 00000000..b66ae926 --- /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 index cceb62de..e3eb0511 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 index 34c25b19..902b8864 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 index f4de812d..41e6e499 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 00000000..a03d2825 --- /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 00000000..b66ae926 --- /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 index 69d2c339..840f79f5 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 index 65adb1d7..467cfcbe 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/mallard-Python-constructor.tmpl b/giscanner/doctemplates/Python/mallard-Python-constructor.tmpl deleted file mode 100644 index 0b740414..00000000 --- a/giscanner/doctemplates/Python/mallard-Python-constructor.tmpl +++ /dev/null @@ -1 +0,0 @@ -<%inherit file="mallard-Python-function.tmpl"/> diff --git a/giscanner/doctemplates/Python/mallard-Python-default.tmpl b/giscanner/doctemplates/Python/mallard-Python-default.tmpl deleted file mode 100644 index 991f29be..00000000 --- a/giscanner/doctemplates/Python/mallard-Python-default.tmpl +++ /dev/null @@ -1 +0,0 @@ -<%inherit file="mallard-base.tmpl"/> diff --git a/giscanner/doctemplates/Python/mallard-Python-method.tmpl b/giscanner/doctemplates/Python/mallard-Python-method.tmpl deleted file mode 100644 index 0b740414..00000000 --- a/giscanner/doctemplates/Python/mallard-Python-method.tmpl +++ /dev/null @@ -1 +0,0 @@ -<%inherit file="mallard-Python-function.tmpl"/> diff --git a/giscanner/doctemplates/Python/mallard-Python-record.tmpl b/giscanner/doctemplates/Python/mallard-Python-record.tmpl deleted file mode 100644 index cfe71c15..00000000 --- a/giscanner/doctemplates/Python/mallard-Python-record.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -<%! page_type="guide" %>\ -<%inherit file="mallard-base.tmpl"/> diff --git a/giscanner/doctemplates/Python/method.tmpl b/giscanner/doctemplates/Python/method.tmpl new file mode 100644 index 00000000..a03d2825 --- /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 index 28cd4708..10745fae 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 index 32d673b2..f05bc820 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 00000000..1523e0df --- /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 index 8c721b94..9b277466 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 index cf51f7c7..65f856a5 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 index e40739c3..e40739c3 100644 --- a/giscanner/doctemplates/mallard-base.tmpl +++ b/giscanner/doctemplates/base.tmpl diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py index 2d435aa3..b00de1f4 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) |