File tree 5 files changed +70
-2
lines changed
5 files changed +70
-2
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,15 @@ class GitHubHTMLTranslator(HTMLTranslator):
66
66
# see also: http://bit.ly/1exfq2h (warning! sourceforge link.)
67
67
def depart_document (self , node ):
68
68
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
71
71
72
72
# technique for visiting sections, without generating additional divs
73
73
# see also: http://bit.ly/NHtyRx
74
+ # the a is to support ::contents with ::sectnums: http://git.io/N1yC
74
75
def visit_section (self , node ):
76
+ id_attribute = node .attributes ['ids' ][0 ]
77
+ self .body .append ('<a name="%s"></a>\n ' % id_attribute )
75
78
self .section_level += 1
76
79
77
80
def depart_section (self , node ):
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ <h2>Subtitle</h2>
8
8
< li > < a href ="#field-list "> Field list</ a > </ li >
9
9
</ ul >
10
10
</ div >
11
+ < a name ="header-2 "> </ a >
11
12
< h2 > < a href ="#id1 "> Header 2</ a > </ h2 >
12
13
< ol >
13
14
< li > Blah blah < code > code</ code > blah</ li >
@@ -46,6 +47,7 @@ <h2><a href="#id1">Header 2</a></h2>
46
47
< a href ="https://scan.coverity.com/projects/621 "> < img alt ="Coverity Scan Build Status " src ="https://scan.coverity.com/projects/621/badge.svg ">
47
48
</ a >
48
49
< img alt ="Coverity Scan Build Status " src ="https://scan.coverity.com/projects/621/badge.svg ">
50
+ < a name ="field-list "> </ a >
49
51
< h2 > < a href ="#id2 "> Field list</ a > </ h2 >
50
52
< table frame ="void " rules ="none ">
51
53
Original file line number Diff line number Diff line change 1
1
< h1 > Header 1</ h1 >
2
2
< p > Example text.</ p >
3
+ < a name ="header-2 "> </ a >
3
4
< h2 > Header 2</ h2 >
4
5
< ol >
5
6
< 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