[gobject-introspection/mallard-templates] g-ir-doc-tool: Properly link to property pages
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/mallard-templates] g-ir-doc-tool: Properly link to property pages
- Date: Mon, 20 Feb 2012 13:20:49 +0000 (UTC)
commit 3c1bb2b27583d6296a83a84bb4c5a335c268671b
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date: Mon Feb 20 14:20:22 2012 +0100
g-ir-doc-tool: Properly link to property pages
giscanner/mallardwriter.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py
index 23a14a7..65123a8 100644
--- a/giscanner/mallardwriter.py
+++ b/giscanner/mallardwriter.py
@@ -64,6 +64,8 @@ class MallardFormatter(object):
result += self.escape(para[:pos])
rest = para[pos + 1:]
link = re.split('[^a-zA-Z_:-]', rest, maxsplit=1)[0]
+ if link.endswith(':'):
+ link = link[:-1]
if '::' in link:
type_name, signal_name = link.split('::')
if type_name in self._namespace.ctypes:
@@ -73,6 +75,15 @@ class MallardFormatter(object):
else:
xref = link
xref_name = link
+ elif ':' in link:
+ type_name, property_name = link.split(':')
+ if type_name in self._namespace.ctypes:
+ type_ = self._namespace.get_by_ctype(type_name)
+ xref = '%s.%s-%s' % (self._namespace.name, type_.name, property_name)
+ xref_name = '%s.%s:%s' % (self._namespace.name, type_.name, property_name)
+ else:
+ xref = link
+ xref_name = link
elif link in self._namespace.ctypes:
type_ = self._namespace.get_by_ctype(link)
xref = '%s.%s' % (self._namespace.name, type_.name)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]