all repos — markup @ 12ec021736a0dd183d7313d3bf596423c5b5d053

The code we use to render README.your_favorite_markup

Disabled doctitle_xform for rest rendering

Restructured text was previously being rendered so that:

	Header1
	=======

	Some text.

	Header2
	-------

	Some text.

	Header3
	~~~~~~~

	Some more text.

Had a tag pattern of:

	<h1 class="title">Header1</h1>
	...
	<h1>Header2</h1>
	...
	<h2>Header3</h2>

Which does not suit the github css stylesheets well, as the
class="title" is ignored so the first two headings are rendered the same
size. Additionally the github stylesheets add a horizontal rule/line
above <h2> headings which in rst are really level 3 headings in the
source document.

Adding doctitle_xform: False to the render settings results in:

	<h1>Header1</h1>
	...
	<h2>Header2</h2>
	...
	<h3>Header3</h3>

Which suits the github stylesheets much better and matches the markdown
results.

The tests have also been updated to include appropriate headings in the
rst example.
Michael Jones m.pricejones@gmail.com
Mon, 25 Jan 2010 17:24:35 +0000
commit

12ec021736a0dd183d7313d3bf596423c5b5d053

parent

4d2c93af8b1eee9ab8739a925142c06aacd60f01

3 files changed, 20 insertions(+), 2 deletions(-)

jump to
M lib/github/commands/rest2htmllib/github/commands/rest2html

@@ -22,6 +22,7 @@ 'cloak_email_addresses': True,

'file_insertion_enabled': False, 'raw_enabled': False, 'strip_comments': True, + 'doctitle_xform': False, } def main():
M test/markups/README.rsttest/markups/README.rst

@@ -1,3 +1,13 @@

+Header 1 +======== + +Example text. + +Header 2 +-------- + 1. Blah blah ``code`` blah 2. More ``code``, hooray + +
M test/markups/README.rst.htmltest/markups/README.rst.html

@@ -1,7 +1,14 @@

<div class="document"> +<div class="section" id="header-1"> +<h1>Header 1</h1> +<p>Example text.</p> +<div class="section" id="header-2"> +<h2>Header 2</h2> <ol class="arabic simple"> -<li>Blah blah <tt class="docutils literal">code</tt> blah</li> -<li>More <tt class="docutils literal">code</tt>, hooray</li> +<li>Blah blah <tt class="docutils literal"><span class="pre">code</span></tt> blah</li> +<li>More <tt class="docutils literal"><span class="pre">code</span></tt>, hooray</li> </ol> +</div> +</div> </div>