File tree Expand file tree Collapse file tree 5 files changed +70
-2
lines changed Expand file tree Collapse file tree 5 files changed +70
-2
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,15 @@ class GitHubHTMLTranslator(HTMLTranslator):
6666 # see also: http://bit.ly/1exfq2h (warning! sourceforge link.)
6767 def depart_document (self , node ):
6868 HTMLTranslator .depart_document (self , node )
69- self .html_body .pop (0 )
70- self .html_body .pop ()
69+ self .html_body .pop (0 ) # pop the starting <div> off
70+ self .html_body .pop () # pop the ending </div> off
7171
7272 # technique for visiting sections, without generating additional divs
7373 # see also: http://bit.ly/NHtyRx
74+ # the a is to support ::contents with ::sectnums: http://git.io/N1yC
7475 def visit_section (self , node ):
76+ id_attribute = node .attributes ['ids' ][0 ]
77+ self .body .append ('<a name="%s"></a>\n ' % id_attribute )
7578 self .section_level += 1
7679
7780 def depart_section (self , node ):
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ <h2>Subtitle</h2>
88< li > < a href ="#field-list "> Field list</ a > </ li >
99</ ul >
1010</ div >
11+ < a name ="header-2 "> </ a >
1112< h2 > < a href ="#id1 "> Header 2</ a > </ h2 >
1213< ol >
1314< li > Blah blah < code > code</ code > blah</ li >
@@ -46,6 +47,7 @@ <h2><a href="#id1">Header 2</a></h2>
4647< a href ="https://scan.coverity.com/projects/621 "> < img alt ="Coverity Scan Build Status " src ="https://scan.coverity.com/projects/621/badge.svg ">
4748</ a >
4849< img alt ="Coverity Scan Build Status " src ="https://scan.coverity.com/projects/621/badge.svg ">
50+ < a name ="field-list "> </ a >
4951< h2 > < a href ="#id2 "> Field list</ a > </ h2 >
5052< table frame ="void " rules ="none ">
5153
Original file line number Diff line number Diff line change 11< h1 > Header 1</ h1 >
22< p > Example text.</ p >
3+ < a name ="header-2 "> </ a >
34< h2 > Header 2</ h2 >
45< ol >
56< li > Blah blah < code > code</ code > blah</ li >
Original file line number Diff line number Diff line change 1+ .. contents ::
2+ :backlinks: none
3+
4+ .. sectnum ::
5+
6+ Introduction
7+ ============
8+
9+ What is pycparser?
10+ ------------------
11+
12+ **pycparser ** is a parser for the C language, written in pure Python. It is a
13+ module designed to be easily integrated into applications that need to parse
14+ C source code.
15+
16+ What is it good for?
17+ --------------------
18+
19+ Anything that needs C code to be parsed. The following are some uses for
20+ **pycparser **, taken from real user reports:
21+
22+ * C code obfuscator
23+ * Front-end for various specialized C compilers
24+ * Static code checker
25+ * Automatic unit-test discovery
26+ * Adding specialized extensions to the C language
27+
28+ **pycparser ** is unique in the sense that it's written in pure Python - a very
29+ high level language that's easy to experiment with and tweak. To people familiar
30+ with Lex and Yacc, **pycparser **'s code will be simple to understand.
Original file line number Diff line number Diff line change 1+ < div >
2+ < p > Contents</ p >
3+ < ul >
4+ < li >
5+ < a href ="#introduction "> 1 Introduction</ a > < ul >
6+ < li > < a href ="#what-is-pycparser "> 1.1 What is pycparser?</ a > </ li >
7+ < li > < a href ="#what-is-it-good-for "> 1.2 What is it good for?</ a > </ li >
8+ </ ul >
9+ </ li >
10+ </ ul >
11+ </ div >
12+ < a name ="introduction "> </ a >
13+ < h2 > 1 Introduction</ h2 >
14+ < a name ="what-is-pycparser "> </ a >
15+ < h3 > 1.1 What is pycparser?</ h3 >
16+ < p > < strong > pycparser</ strong > is a parser for the C language, written in pure Python. It is a
17+ module designed to be easily integrated into applications that need to parse
18+ C source code.</ p >
19+ < a name ="what-is-it-good-for "> </ a >
20+ < h3 > 1.2 What is it good for?</ h3 >
21+ < p > Anything that needs C code to be parsed. The following are some uses for
22+ < strong > pycparser</ strong > , taken from real user reports:</ p >
23+ < ul >
24+ < li > C code obfuscator</ li >
25+ < li > Front-end for various specialized C compilers</ li >
26+ < li > Static code checker</ li >
27+ < li > Automatic unit-test discovery</ li >
28+ < li > Adding specialized extensions to the C language</ li >
29+ </ ul >
30+ < p > < strong > pycparser</ strong > is unique in the sense that it's written in pure Python - a very
31+ high level language that's easy to experiment with and tweak. To people familiar
32+ with Lex and Yacc, < strong > pycparser</ strong > 's code will be simple to understand.</ p >
You can’t perform that action at this time.
0 commit comments