[gtk-doc] mkhtml2: add converter for 'preface' chunks
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkhtml2: add converter for 'preface' chunks
- Date: Sun, 25 Mar 2018 18:10:19 +0000 (UTC)
commit 0ae9950c247f71b6db7c4bc25ea0f5ef1521227c
Author: Stefan Sauer <ensonic users sf net>
Date: Sun Mar 25 19:55:35 2018 +0200
mkhtml2: add converter for 'preface' chunks
gtkdoc/mkhtml2.py | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gtkdoc/mkhtml2.py b/gtkdoc/mkhtml2.py
index 1b5d29f..3477c6d 100644
--- a/gtkdoc/mkhtml2.py
+++ b/gtkdoc/mkhtml2.py
@@ -873,6 +873,25 @@ def convert_index(ctx):
return result
+def convert_preface(ctx):
+ node = ctx['node']
+ result = [
+ HTML_HEADER % (node.title + ": " + node.root.title, generate_head_links(ctx)),
+ generate_basic_nav(ctx),
+ '<div class="preface">',
+ ]
+ title = node.xml.find('title')
+ if title is not None:
+ result.append('<div class="titlepage"><h2 class="title"><a name="%s"></a>%s</h2></div>' % (
+ get_id(node), title.text))
+ node.xml.remove(title)
+ convert_inner(ctx, node.xml, result)
+ result.append("""</div>
+</body>
+</html>""")
+ return result
+
+
def convert_refentry(ctx):
node = ctx['node']
node_id = get_id(node)
@@ -909,6 +928,7 @@ convert_chunks = {
'book': convert_book,
'chapter': convert_chapter,
'index': convert_index,
+ 'preface': convert_preface,
'refentry': convert_refentry,
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]