From 8b23c6c8755bca0b0c58b25ee3c4b06c06d72bcd Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 9 Jan 2013 03:11:06 -0500 Subject: 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 ++++---- giscanner/doctemplates/C/mallard-C-class.tmpl | 48 +++++++++++ giscanner/doctemplates/C/mallard-C-default.tmpl | 11 +++ giscanner/doctemplates/C/mallard-C-enum.tmpl | 12 +++ giscanner/doctemplates/C/mallard-C-function.tmpl | 95 ++++++++++++++++++++++ giscanner/doctemplates/C/mallard-C-namespace.tmpl | 19 +++++ giscanner/doctemplates/C/mallard-C-property.tmpl | 13 +++ giscanner/doctemplates/C/mallard-C-record.tmpl | 12 +++ giscanner/doctemplates/C/mallard-C-signal.tmpl | 13 +++ giscanner/doctemplates/C/mallard-C-vfunc.tmpl | 35 ++++++++ .../doctemplates/Python/mallard-Python-class.tmpl | 66 +++++++++++++++ .../Python/mallard-Python-default.tmpl | 11 +++ .../doctemplates/Python/mallard-Python-enum.tmpl | 23 ++++++ .../Python/mallard-Python-function.tmpl | 82 +++++++++++++++++++ .../Python/mallard-Python-namespace.tmpl | 19 +++++ .../Python/mallard-Python-property.tmpl | 16 ++++ .../doctemplates/Python/mallard-Python-record.tmpl | 12 +++ .../doctemplates/Python/mallard-Python-signal.tmpl | 52 ++++++++++++ .../doctemplates/Python/mallard-Python-vfunc.tmpl | 46 +++++++++++ giscanner/mallard-C-class.tmpl | 48 ----------- giscanner/mallard-C-default.tmpl | 11 --- giscanner/mallard-C-enum.tmpl | 12 --- giscanner/mallard-C-function.tmpl | 95 ---------------------- giscanner/mallard-C-namespace.tmpl | 19 ----- giscanner/mallard-C-property.tmpl | 13 --- giscanner/mallard-C-record.tmpl | 12 --- giscanner/mallard-C-signal.tmpl | 13 --- giscanner/mallard-C-vfunc.tmpl | 35 -------- giscanner/mallard-Python-class.tmpl | 66 --------------- giscanner/mallard-Python-default.tmpl | 11 --- giscanner/mallard-Python-enum.tmpl | 23 ------ giscanner/mallard-Python-function.tmpl | 82 ------------------- giscanner/mallard-Python-namespace.tmpl | 19 ----- giscanner/mallard-Python-property.tmpl | 16 ---- giscanner/mallard-Python-record.tmpl | 12 --- giscanner/mallard-Python-signal.tmpl | 52 ------------ giscanner/mallard-Python-vfunc.tmpl | 46 ----------- giscanner/mallardwriter.py | 6 +- 38 files changed, 607 insertions(+), 605 deletions(-) create mode 100644 giscanner/doctemplates/C/mallard-C-class.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-default.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-enum.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-function.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-namespace.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-property.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-record.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-signal.tmpl create mode 100644 giscanner/doctemplates/C/mallard-C-vfunc.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-class.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-default.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-enum.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-function.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-namespace.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-property.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-record.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-signal.tmpl create mode 100644 giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl delete mode 100644 giscanner/mallard-C-class.tmpl delete mode 100644 giscanner/mallard-C-default.tmpl delete mode 100644 giscanner/mallard-C-enum.tmpl delete mode 100644 giscanner/mallard-C-function.tmpl delete mode 100644 giscanner/mallard-C-namespace.tmpl delete mode 100644 giscanner/mallard-C-property.tmpl delete mode 100644 giscanner/mallard-C-record.tmpl delete mode 100644 giscanner/mallard-C-signal.tmpl delete mode 100644 giscanner/mallard-C-vfunc.tmpl delete mode 100644 giscanner/mallard-Python-class.tmpl delete mode 100644 giscanner/mallard-Python-default.tmpl delete mode 100644 giscanner/mallard-Python-enum.tmpl delete mode 100644 giscanner/mallard-Python-function.tmpl delete mode 100644 giscanner/mallard-Python-namespace.tmpl delete mode 100644 giscanner/mallard-Python-property.tmpl delete mode 100644 giscanner/mallard-Python-record.tmpl delete mode 100644 giscanner/mallard-Python-signal.tmpl delete mode 100644 giscanner/mallard-Python-vfunc.tmpl diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am index 2bb9b6d8..ef99904f 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/doctemplates/C/mallard-C-class.tmpl b/giscanner/doctemplates/C/mallard-C-class.tmpl new file mode 100644 index 00000000..b0f703f9 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-class.tmpl @@ -0,0 +1,48 @@ + + + + + + ${node.ctype} +${formatter.format(node, node.doc)} +% if node.version: +

Since ${node.version}

+% endif + + Hierarchy + + + GObjectObject + + + + + Constructors + + + Methods + + + Functions + + + Properties + + + Signals + + + Other + +
diff --git a/giscanner/doctemplates/C/mallard-C-default.tmpl b/giscanner/doctemplates/C/mallard-C-default.tmpl new file mode 100644 index 00000000..8326343e --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-default.tmpl @@ -0,0 +1,11 @@ + + + + + ${namespace.name}.${node.name} +${formatter.format(node, node.doc)} + diff --git a/giscanner/doctemplates/C/mallard-C-enum.tmpl b/giscanner/doctemplates/C/mallard-C-enum.tmpl new file mode 100644 index 00000000..b59f27e6 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-enum.tmpl @@ -0,0 +1,12 @@ + + + + + + ${node.namespace.name}.${node.name} +${formatter.format(node, node.doc)} + diff --git a/giscanner/doctemplates/C/mallard-C-function.tmpl b/giscanner/doctemplates/C/mallard-C-function.tmpl new file mode 100644 index 00000000..051fb0b0 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-function.tmpl @@ -0,0 +1,95 @@ + +<% +page_style = 'function' +if node.is_constructor: + page_style = 'constructor' +elif node.is_method: + page_style = 'method' +%> + + +% if node.parent is not None: + +% else: + +% endif + + + ${formatter.format_type(node.retval.type) | x} + + ${node.symbol} +% if node.is_method: + + ${node.parent.ctype} * + self + +% endif +% for arg in node.parameters: +% if arg.type.ctype == '': + +% else: + + ${formatter.format_type(arg.type) | x} + ${arg.argname} + +% endif +% endfor + + + ${node.symbol} + +${node.retval.type.ctype} ${node.symbol} (\ +% if node.is_method: +${node.parent.ctype} *self\ +%endif +% if len(node.parameters) == 0: +% if not node.is_method: +void\ +%endif +); +% elif node.is_method: +, +% endif +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +% if ix != 0: +${' ' * (len(formatter.format_type(node.retval.type)) + len(node.symbol) + 3)}\ +% endif +% if arg.type.ctype == '': +...\ +% else: +${formatter.format_type(arg.type) | x} ${arg.argname}\ +% endif +% if ix == len(node.parameters) - 1: +); +% else: +, +%endif +% endfor + +${formatter.format(node, node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval: + + + + +% endif +

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff --git a/giscanner/doctemplates/C/mallard-C-namespace.tmpl b/giscanner/doctemplates/C/mallard-C-namespace.tmpl new file mode 100644 index 00000000..284ba238 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-namespace.tmpl @@ -0,0 +1,19 @@ + + + + + ${node.name} Documentation + + Classes + + + Functions + + + Other + + diff --git a/giscanner/doctemplates/C/mallard-C-property.tmpl b/giscanner/doctemplates/C/mallard-C-property.tmpl new file mode 100644 index 00000000..a4719952 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-property.tmpl @@ -0,0 +1,13 @@ + + + + + ${node.name} + + ${node.parent.ctype}:${node.name} +${formatter.format(node, node.doc)} + diff --git a/giscanner/doctemplates/C/mallard-C-record.tmpl b/giscanner/doctemplates/C/mallard-C-record.tmpl new file mode 100644 index 00000000..1c7223a8 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-record.tmpl @@ -0,0 +1,12 @@ + + + + + + ${node.namespace.name}${node.name} +${formatter.format(node, node.doc)} + diff --git a/giscanner/doctemplates/C/mallard-C-signal.tmpl b/giscanner/doctemplates/C/mallard-C-signal.tmpl new file mode 100644 index 00000000..69ecaad4 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-signal.tmpl @@ -0,0 +1,13 @@ + + + + + ${node.name} + + ${node.parent.ctype}::${node.name} +${formatter.format(node, node.doc)} + diff --git a/giscanner/doctemplates/C/mallard-C-vfunc.tmpl b/giscanner/doctemplates/C/mallard-C-vfunc.tmpl new file mode 100644 index 00000000..a35c7b52 --- /dev/null +++ b/giscanner/doctemplates/C/mallard-C-vfunc.tmpl @@ -0,0 +1,35 @@ + + + + + + ${node.name} + + +${formatter.format(node, node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval: + + + + +% endif +

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff --git a/giscanner/doctemplates/Python/mallard-Python-class.tmpl b/giscanner/doctemplates/Python/mallard-Python-class.tmpl new file mode 100644 index 00000000..6edf25db --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-class.tmpl @@ -0,0 +1,66 @@ + + + + + + ${namespace.name}.${node.name} +${formatter.format(node, node.doc)} + + +from gi.repository import ${namespace.name} + +${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(\ +% for property_, ix in zip(node.properties, range(len(node.properties))): +% if property_.construct or property_.construct_only or property_.writable: +${property_.name.replace('-', '_')}=value\ +% if ix != len(node.properties) - 1: +, \ +% endif +% endif +% endfor +)\ + + +% if node.version: +

Since ${node.version}

+% endif + + Hierarchy + +% for class_ in formatter.get_class_hierarchy(node): + + ${class_.namespace.name}.${class_.name} +% endfor +% for class_ in formatter.get_class_hierarchy(node): + +% endfor + + + + Methods + + + Functions + + + Properties + + + Signals + + + Virtual functions + + + Other + +
diff --git a/giscanner/doctemplates/Python/mallard-Python-default.tmpl b/giscanner/doctemplates/Python/mallard-Python-default.tmpl new file mode 100644 index 00000000..87791059 --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-default.tmpl @@ -0,0 +1,11 @@ + + + + + ${namespace.name}.${node.name} +${formatter.format(node, node.doc)} + diff --git a/giscanner/doctemplates/Python/mallard-Python-enum.tmpl b/giscanner/doctemplates/Python/mallard-Python-enum.tmpl new file mode 100644 index 00000000..9e44ede9 --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-enum.tmpl @@ -0,0 +1,23 @@ + + + + + + ${node.namespace.name}.${node.name} + ${formatter.format(node, node.doc)} +% if node.members: + +% for member, ix in zip(node.members, range(len(node.members))): + + + + +% endfor +

${node.name}.${member.name.upper()} :

${formatter.format(node, member.doc)}
+% endif + +
diff --git a/giscanner/doctemplates/Python/mallard-Python-function.tmpl b/giscanner/doctemplates/Python/mallard-Python-function.tmpl new file mode 100644 index 00000000..5ccc800a --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-function.tmpl @@ -0,0 +1,82 @@ + +<% +page_style = 'function' +if node.is_constructor: + page_style = 'constructor' +elif node.is_method: + page_style = 'method' +%> + + +% if node.parent is not None: + +% else: + +% endif + + + ${formatter.format_type(node.retval.type) | x} + + ${node.symbol} +% if node.is_method: + + ${node.parent.ctype} * + self + +% endif +% for arg in node.parameters: +% if arg.type.ctype == '': + +% else: + + ${formatter.format_type(arg.type) | x} + ${arg.argname} + +% endif +% endfor + + + ${node.name} + +% if len(node.parameters) != 0: +@accepts(\ +${', '.join((formatter.format_type(arg.type) for arg in node.parameters))}\ +) +% endif +@returns(${formatter.format_type(node.retval.type) | x}) +def \ +${node.name}(\ +% if node.is_method: +self, \ +% endif +${', '.join((arg.argname for arg in node.parameters))}\ +): + # Python wrapper for ${node.symbol}() + +${formatter.format(node, node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval and node.retval.type.ctype != 'void': + + + + +% endif +

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff --git a/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl b/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl new file mode 100644 index 00000000..935cd440 --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl @@ -0,0 +1,19 @@ + + + + + ${node.name} Documentation + + Classes + + + Functions + + + Other + + diff --git a/giscanner/doctemplates/Python/mallard-Python-property.tmpl b/giscanner/doctemplates/Python/mallard-Python-property.tmpl new file mode 100644 index 00000000..7ef72ccb --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-property.tmpl @@ -0,0 +1,16 @@ + + + + + ${node.name} + + ${namespace.name}.${node.parent.name}:${node.name} + +"${node.name}" ${formatter.format_type(node.type)} : ${formatter.format_property_flags(node)} + +${formatter.format(node, node.doc)} + diff --git a/giscanner/doctemplates/Python/mallard-Python-record.tmpl b/giscanner/doctemplates/Python/mallard-Python-record.tmpl new file mode 100644 index 00000000..1b00e3be --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-record.tmpl @@ -0,0 +1,12 @@ + + + + + + ${node.namespace.name}${node.name} +

${node.doc}

+
diff --git a/giscanner/doctemplates/Python/mallard-Python-signal.tmpl b/giscanner/doctemplates/Python/mallard-Python-signal.tmpl new file mode 100644 index 00000000..f26934fb --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-signal.tmpl @@ -0,0 +1,52 @@ + + + + + ${node.name} + + ${namespace.name}.${node.parent.name}::${node.name} + +def callback(${formatter.to_underscores(node.parent.name).lower()}, \ +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +${arg.argname}, \ +% endfor +user_param1, ...) + +${formatter.format(node, node.doc)} + + + + + + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor + + + + + + + + +% if node.retval and \ + node.retval.type.ctype != 'void' and \ + node.retval.type.ctype is not None: + + + + +% endif +

${formatter.to_underscores(node.parent.name).lower()} :

instance of ${namespace.name}.${node.parent.name} that is emitting the signal

${arg.argname} :

${formatter.format(node, arg.doc)}

user_param1 :

first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Returns :

${node.retval.type.ctype} ${formatter.format(node, node.retval.doc)}
+% if node.version: +

Since ${node.version}

+% endif +
diff --git a/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl b/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl new file mode 100644 index 00000000..0c93abbc --- /dev/null +++ b/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl @@ -0,0 +1,46 @@ + + + + + ${node.name} + + ${namespace.name}.${node.parent.name}.${node.name} + +% if len(node.parameters) != 0: +@accepts(\ +${', '.join((formatter.format_type(arg.type) for arg in node.parameters))}\ +) +% endif +@returns(${formatter.format_type(node.retval.type) | x}) +def \ +do_${node.name}(self, \ +${', '.join((arg.argname for arg in node.parameters))}\ +): + +${formatter.format(node, node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval and node.retval.type.ctype != 'void': + + + + +% endif +

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff --git a/giscanner/mallard-C-class.tmpl b/giscanner/mallard-C-class.tmpl deleted file mode 100644 index b0f703f9..00000000 --- a/giscanner/mallard-C-class.tmpl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - ${node.ctype} -${formatter.format(node, node.doc)} -% if node.version: -

Since ${node.version}

-% endif - - Hierarchy - - - GObjectObject - - - - - Constructors - - - Methods - - - Functions - - - Properties - - - Signals - - - Other - -
diff --git a/giscanner/mallard-C-default.tmpl b/giscanner/mallard-C-default.tmpl deleted file mode 100644 index 8326343e..00000000 --- a/giscanner/mallard-C-default.tmpl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - ${namespace.name}.${node.name} -${formatter.format(node, node.doc)} - diff --git a/giscanner/mallard-C-enum.tmpl b/giscanner/mallard-C-enum.tmpl deleted file mode 100644 index b59f27e6..00000000 --- a/giscanner/mallard-C-enum.tmpl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - ${node.namespace.name}.${node.name} -${formatter.format(node, node.doc)} - diff --git a/giscanner/mallard-C-function.tmpl b/giscanner/mallard-C-function.tmpl deleted file mode 100644 index 051fb0b0..00000000 --- a/giscanner/mallard-C-function.tmpl +++ /dev/null @@ -1,95 +0,0 @@ - -<% -page_style = 'function' -if node.is_constructor: - page_style = 'constructor' -elif node.is_method: - page_style = 'method' -%> - - -% if node.parent is not None: - -% else: - -% endif - - - ${formatter.format_type(node.retval.type) | x} - - ${node.symbol} -% if node.is_method: - - ${node.parent.ctype} * - self - -% endif -% for arg in node.parameters: -% if arg.type.ctype == '': - -% else: - - ${formatter.format_type(arg.type) | x} - ${arg.argname} - -% endif -% endfor - - - ${node.symbol} - -${node.retval.type.ctype} ${node.symbol} (\ -% if node.is_method: -${node.parent.ctype} *self\ -%endif -% if len(node.parameters) == 0: -% if not node.is_method: -void\ -%endif -); -% elif node.is_method: -, -% endif -% for arg, ix in zip(node.parameters, range(len(node.parameters))): -% if ix != 0: -${' ' * (len(formatter.format_type(node.retval.type)) + len(node.symbol) + 3)}\ -% endif -% if arg.type.ctype == '': -...\ -% else: -${formatter.format_type(arg.type) | x} ${arg.argname}\ -% endif -% if ix == len(node.parameters) - 1: -); -% else: -, -%endif -% endfor - -${formatter.format(node, node.doc)} - -% if node.parameters or node.retval: - -% for arg, ix in zip(node.parameters, range(len(node.parameters))): - - - - -% endfor -% if node.retval: - - - - -% endif -

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
-% endif -% if node.version: -

Since ${node.version}

-% endif -
diff --git a/giscanner/mallard-C-namespace.tmpl b/giscanner/mallard-C-namespace.tmpl deleted file mode 100644 index 284ba238..00000000 --- a/giscanner/mallard-C-namespace.tmpl +++ /dev/null @@ -1,19 +0,0 @@ - - - - - ${node.name} Documentation - - Classes - - - Functions - - - Other - - diff --git a/giscanner/mallard-C-property.tmpl b/giscanner/mallard-C-property.tmpl deleted file mode 100644 index a4719952..00000000 --- a/giscanner/mallard-C-property.tmpl +++ /dev/null @@ -1,13 +0,0 @@ - - - - - ${node.name} - - ${node.parent.ctype}:${node.name} -${formatter.format(node, node.doc)} - diff --git a/giscanner/mallard-C-record.tmpl b/giscanner/mallard-C-record.tmpl deleted file mode 100644 index 1c7223a8..00000000 --- a/giscanner/mallard-C-record.tmpl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - ${node.namespace.name}${node.name} -${formatter.format(node, node.doc)} - diff --git a/giscanner/mallard-C-signal.tmpl b/giscanner/mallard-C-signal.tmpl deleted file mode 100644 index 69ecaad4..00000000 --- a/giscanner/mallard-C-signal.tmpl +++ /dev/null @@ -1,13 +0,0 @@ - - - - - ${node.name} - - ${node.parent.ctype}::${node.name} -${formatter.format(node, node.doc)} - diff --git a/giscanner/mallard-C-vfunc.tmpl b/giscanner/mallard-C-vfunc.tmpl deleted file mode 100644 index a35c7b52..00000000 --- a/giscanner/mallard-C-vfunc.tmpl +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ${node.name} - - -${formatter.format(node, node.doc)} - -% if node.parameters or node.retval: - -% for arg, ix in zip(node.parameters, range(len(node.parameters))): - - - - -% endfor -% if node.retval: - - - - -% endif -

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
-% endif -% if node.version: -

Since ${node.version}

-% endif -
diff --git a/giscanner/mallard-Python-class.tmpl b/giscanner/mallard-Python-class.tmpl deleted file mode 100644 index 6edf25db..00000000 --- a/giscanner/mallard-Python-class.tmpl +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - ${namespace.name}.${node.name} -${formatter.format(node, node.doc)} - - -from gi.repository import ${namespace.name} - -${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(\ -% for property_, ix in zip(node.properties, range(len(node.properties))): -% if property_.construct or property_.construct_only or property_.writable: -${property_.name.replace('-', '_')}=value\ -% if ix != len(node.properties) - 1: -, \ -% endif -% endif -% endfor -)\ - - -% if node.version: -

Since ${node.version}

-% endif - - Hierarchy - -% for class_ in formatter.get_class_hierarchy(node): - - ${class_.namespace.name}.${class_.name} -% endfor -% for class_ in formatter.get_class_hierarchy(node): - -% endfor - - - - Methods - - - Functions - - - Properties - - - Signals - - - Virtual functions - - - Other - -
diff --git a/giscanner/mallard-Python-default.tmpl b/giscanner/mallard-Python-default.tmpl deleted file mode 100644 index 87791059..00000000 --- a/giscanner/mallard-Python-default.tmpl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - ${namespace.name}.${node.name} -${formatter.format(node, node.doc)} - diff --git a/giscanner/mallard-Python-enum.tmpl b/giscanner/mallard-Python-enum.tmpl deleted file mode 100644 index 9e44ede9..00000000 --- a/giscanner/mallard-Python-enum.tmpl +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - ${node.namespace.name}.${node.name} - ${formatter.format(node, node.doc)} -% if node.members: - -% for member, ix in zip(node.members, range(len(node.members))): - - - - -% endfor -

${node.name}.${member.name.upper()} :

${formatter.format(node, member.doc)}
-% endif - -
diff --git a/giscanner/mallard-Python-function.tmpl b/giscanner/mallard-Python-function.tmpl deleted file mode 100644 index 5ccc800a..00000000 --- a/giscanner/mallard-Python-function.tmpl +++ /dev/null @@ -1,82 +0,0 @@ - -<% -page_style = 'function' -if node.is_constructor: - page_style = 'constructor' -elif node.is_method: - page_style = 'method' -%> - - -% if node.parent is not None: - -% else: - -% endif - - - ${formatter.format_type(node.retval.type) | x} - - ${node.symbol} -% if node.is_method: - - ${node.parent.ctype} * - self - -% endif -% for arg in node.parameters: -% if arg.type.ctype == '': - -% else: - - ${formatter.format_type(arg.type) | x} - ${arg.argname} - -% endif -% endfor - - - ${node.name} - -% if len(node.parameters) != 0: -@accepts(\ -${', '.join((formatter.format_type(arg.type) for arg in node.parameters))}\ -) -% endif -@returns(${formatter.format_type(node.retval.type) | x}) -def \ -${node.name}(\ -% if node.is_method: -self, \ -% endif -${', '.join((arg.argname for arg in node.parameters))}\ -): - # Python wrapper for ${node.symbol}() - -${formatter.format(node, node.doc)} - -% if node.parameters or node.retval: - -% for arg, ix in zip(node.parameters, range(len(node.parameters))): - - - - -% endfor -% if node.retval and node.retval.type.ctype != 'void': - - - - -% endif -

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
-% endif -% if node.version: -

Since ${node.version}

-% endif -
diff --git a/giscanner/mallard-Python-namespace.tmpl b/giscanner/mallard-Python-namespace.tmpl deleted file mode 100644 index 935cd440..00000000 --- a/giscanner/mallard-Python-namespace.tmpl +++ /dev/null @@ -1,19 +0,0 @@ - - - - - ${node.name} Documentation - - Classes - - - Functions - - - Other - - diff --git a/giscanner/mallard-Python-property.tmpl b/giscanner/mallard-Python-property.tmpl deleted file mode 100644 index 7ef72ccb..00000000 --- a/giscanner/mallard-Python-property.tmpl +++ /dev/null @@ -1,16 +0,0 @@ - - - - - ${node.name} - - ${namespace.name}.${node.parent.name}:${node.name} - -"${node.name}" ${formatter.format_type(node.type)} : ${formatter.format_property_flags(node)} - -${formatter.format(node, node.doc)} - diff --git a/giscanner/mallard-Python-record.tmpl b/giscanner/mallard-Python-record.tmpl deleted file mode 100644 index 1b00e3be..00000000 --- a/giscanner/mallard-Python-record.tmpl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - ${node.namespace.name}${node.name} -

${node.doc}

-
diff --git a/giscanner/mallard-Python-signal.tmpl b/giscanner/mallard-Python-signal.tmpl deleted file mode 100644 index f26934fb..00000000 --- a/giscanner/mallard-Python-signal.tmpl +++ /dev/null @@ -1,52 +0,0 @@ - - - - - ${node.name} - - ${namespace.name}.${node.parent.name}::${node.name} - -def callback(${formatter.to_underscores(node.parent.name).lower()}, \ -% for arg, ix in zip(node.parameters, range(len(node.parameters))): -${arg.argname}, \ -% endfor -user_param1, ...) - -${formatter.format(node, node.doc)} - - - - - - -% for arg, ix in zip(node.parameters, range(len(node.parameters))): - - - - -% endfor - - - - - - - - -% if node.retval and \ - node.retval.type.ctype != 'void' and \ - node.retval.type.ctype is not None: - - - - -% endif -

${formatter.to_underscores(node.parent.name).lower()} :

instance of ${namespace.name}.${node.parent.name} that is emitting the signal

${arg.argname} :

${formatter.format(node, arg.doc)}

user_param1 :

first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Returns :

${node.retval.type.ctype} ${formatter.format(node, node.retval.doc)}
-% if node.version: -

Since ${node.version}

-% endif -
diff --git a/giscanner/mallard-Python-vfunc.tmpl b/giscanner/mallard-Python-vfunc.tmpl deleted file mode 100644 index 0c93abbc..00000000 --- a/giscanner/mallard-Python-vfunc.tmpl +++ /dev/null @@ -1,46 +0,0 @@ - - - - - ${node.name} - - ${namespace.name}.${node.parent.name}.${node.name} - -% if len(node.parameters) != 0: -@accepts(\ -${', '.join((formatter.format_type(arg.type) for arg in node.parameters))}\ -) -% endif -@returns(${formatter.format_type(node.retval.type) | x}) -def \ -do_${node.name}(self, \ -${', '.join((arg.argname for arg in node.parameters))}\ -): - -${formatter.format(node, node.doc)} - -% if node.parameters or node.retval: - -% for arg, ix in zip(node.parameters, range(len(node.parameters))): - - - - -% endfor -% if node.retval and node.retval.type.ctype != 'void': - - - - -% endif -

${arg.argname} :

${formatter.format(node, arg.doc)}

Returns :

${formatter.format(node, node.retval.doc)}
-% endif -% if node.version: -

Since ${node.version}

-% endif -
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py index c8ab67dd..801df088 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(), -- cgit v1.2.1