summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOlli Salli <ollisal@gmail.com>2011-08-01 22:50:14 +0300
committerOlli Salli <ollisal@gmail.com>2011-08-01 22:50:14 +0300
commit9f15eb70bc4eac47639ee54a54c82dff51fd7d42 (patch)
tree4cafbea04ae119506165c31b2c8508d71bf166fc /tools
parentba81f24931ddd2ae483c0cd09c1cbf7658709c65 (diff)
Use a single <div class="rationale"> for <tp:rationale>s in generated docs, and style it fully in CSS
This allows easily including similar <div class="rationale"> sections in hand-written docs too and achieve an identical look.
Diffstat (limited to 'tools')
-rw-r--r--tools/libqt4codegen.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/tools/libqt4codegen.py b/tools/libqt4codegen.py
index 481a1447..c508c5c9 100644
--- a/tools/libqt4codegen.py
+++ b/tools/libqt4codegen.py
@@ -167,26 +167,13 @@ def format_docstring(el, indent=' * ', brackets=None, maxwidth=80):
if nested:
raise Xzibit(n, nested[0])
- """
- <div class='rationale'>
- <h5>Rationale:</h5>
- <div/> <- inner_div
- </div>
- """
- outer_div = doc.createElement('div')
- outer_div.setAttribute('class', 'rationale')
-
- h5 = doc.createElement('h5')
- h5.appendChild(doc.createTextNode('Rationale:'))
- outer_div.appendChild(h5)
-
- inner_div = doc.createElement('div')
- outer_div.appendChild(inner_div)
+ div = doc.createElement('div')
+ div.setAttribute('class', 'rationale')
for rationale_body in n.childNodes:
- inner_div.appendChild(rationale_body.cloneNode(True))
+ div.appendChild(rationale_body.cloneNode(True))
- n.parentNode.replaceChild(outer_div, n)
+ n.parentNode.replaceChild(div, n)
if docstring_el.getAttribute('xmlns') == 'http://www.w3.org/1999/xhtml':
splitted = ''.join([el.toxml() for el in docstring_el.childNodes]).strip(' ').strip('\n').split('\n')