示例#1
0
文件: texinfo.py 项目: jklukas/sphinx
 def collect_footnotes(self, node):
     fnotes = {}
     def footnotes_under(n):
         if isinstance(n, nodes.footnote):
             yield n
         else:
             for c in n.children:
                 if isinstance(c, addnodes.start_of_file):
                     continue
                 for k in footnotes_under(c):
                     yield k
     for fn in footnotes_under(node):
         num = fn.children[0].astext().strip()
         fnotes[num] = [collected_footnote(*fn.children), False]
     return fnotes
示例#2
0
 def collect_footnotes(self, node):
     fnotes = {}
     def footnotes_under(n):
         if isinstance(n, nodes.footnote):
             yield n
         else:
             for c in n.children:
                 if isinstance(c, addnodes.start_of_file):
                     continue
                 for k in footnotes_under(c):
                     yield k
     for fn in footnotes_under(node):
         num = fn.children[0].astext().strip()
         fnotes[num] = [collected_footnote(*fn.children), False]
     return fnotes