diff --git a/lib/github/commands/rest2html b/lib/github/commands/rest2html index 66ebf42c..f6f8b6e2 100755 --- a/lib/github/commands/rest2html +++ b/lib/github/commands/rest2html @@ -8,6 +8,7 @@ Brandon Keepers Bryan Veloso Chris Wanstrath Dave Abrahams +Garen Torikian Gasper Zejn Michael Jones Sam Whited @@ -50,6 +51,21 @@ SETTINGS = { } class GitHubHTMLTranslator(HTMLTranslator): + # removes the
tag wrapped around docs + # see also: http://bit.ly/1exfq2h (warning! sourceforge link.) + def depart_document(self, node): + HTMLTranslator.depart_document(self, node) + self.html_body.pop(0) + self.html_body.pop() + + # technique for visiting sections, without generating additional divs + # see also: http://bit.ly/NHtyRx + def visit_section(self, node): + self.section_level += 1 + + def depart_section(self, node): + self.section_level -= 1 + def visit_literal_block(self, node): classes = node.attributes['classes'] if len(classes) >= 2 and classes[0] == 'code': diff --git a/test/markups/README.rst.html b/test/markups/README.rst.html index b117e888..5bb052bb 100644 --- a/test/markups/README.rst.html +++ b/test/markups/README.rst.html @@ -1,8 +1,5 @@ -
-

Header 1

Example text.

-

Header 2

  1. Blah blah code blah
  2. @@ -32,6 +29,3 @@

    Header 2

    -
-
-
diff --git a/test/markups/README.rst.txt.html b/test/markups/README.rst.txt.html index 8e26e4f0..e60a5403 100644 --- a/test/markups/README.rst.txt.html +++ b/test/markups/README.rst.txt.html @@ -1,14 +1,7 @@ -
-

Header 1

Example text.

-

Header 2

  1. Blah blah code blah
  2. More code, hooray
-
-
-
-