git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4af561
)
ovsdb-doc: Implement new <option>, <ol> tags.
author
Ben Pfaff
<blp@nicira.com>
Wed, 22 Sep 2010 23:34:05 +0000
(16:34 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Thu, 23 Sep 2010 18:45:35 +0000
(11:45 -0700)
ovsdb/ovsdb-doc.in
patch
|
blob
|
history
diff --git
a/ovsdb/ovsdb-doc.in
b/ovsdb/ovsdb-doc.in
index
90de452
..
9e0a318
100755
(executable)
--- a/
ovsdb/ovsdb-doc.in
+++ b/
ovsdb/ovsdb-doc.in
@@
-43,7
+43,7
@@
def inlineXmlToNroff(node, font):
if node.nodeType == node.TEXT_NODE:
return textToNroff(node.data, font)
elif node.nodeType == node.ELEMENT_NODE:
if node.nodeType == node.TEXT_NODE:
return textToNroff(node.data, font)
elif node.nodeType == node.ELEMENT_NODE:
- if node.tagName
== 'code' or node.tagName == 'em'
:
+ if node.tagName
in ['code', 'em', 'option']
:
s = r'\fB'
for child in node.childNodes:
s += inlineXmlToNroff(child, r'\fB')
s = r'\fB'
for child in node.childNodes:
s += inlineXmlToNroff(child, r'\fB')
@@
-76,17
+76,23
@@
def blockXmlToNroff(nodes, para='.PP'):
s += textToNroff(node.data)
s = s.lstrip()
elif node.nodeType == node.ELEMENT_NODE:
s += textToNroff(node.data)
s = s.lstrip()
elif node.nodeType == node.ELEMENT_NODE:
- if node.tagName
== 'ul'
:
+ if node.tagName
in ['ul', 'ol']
:
if s != "":
s += "\n"
s += ".RS\n"
if s != "":
s += "\n"
s += ".RS\n"
+ i = 0
for liNode in node.childNodes:
if (liNode.nodeType == node.ELEMENT_NODE
and liNode.tagName == 'li'):
for liNode in node.childNodes:
if (liNode.nodeType == node.ELEMENT_NODE
and liNode.tagName == 'li'):
- s += ".IP \\(bu\n" + blockXmlToNroff(liNode.childNodes, ".IP")
+ i += 1
+ if node.tagName == 'ul':
+ s += ".IP \\bu\n"
+ else:
+ s += ".IP %d. .25in\n" % i
+ s += blockXmlToNroff(liNode.childNodes, ".IP")
elif (liNode.nodeType != node.TEXT_NODE
or not liNode.data.isspace()):
elif (liNode.nodeType != node.TEXT_NODE
or not liNode.data.isspace()):
- raise error.Error("<
ul> element may only have <li> children"
)
+ raise error.Error("<
%s> element may only have <li> children" % node.tagName
)
s += ".RE\n"
elif node.tagName == 'dl':
if s != "":
s += ".RE\n"
elif node.tagName == 'dl':
if s != "":