Skip to content

Commit

Permalink
It seems .rst.txt is an acceptable rst extension
Browse files Browse the repository at this point in the history
blasted windows users
  • Loading branch information
tekkub authored and defunkt committed Mar 22, 2010
1 parent 31ed995 commit 5b98a3a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -17,11 +17,11 @@ Once your script is in place, edit `lib/github/markups.rb` and tell
GitHub Markup about it. Again we look to [rest2html][r2hc] for
guidance:

command(:rest2html, /rest|rst/)
command(:rest2html, /re?st(.txt)?/)

Here we're telling GitHub Markup of the existence of a `rest2html`
command which should be used for any file ending in `rest` or
`rst`. Any regular expression will do.
command which should be used for any file ending in `rest`,
`rst`, `rest.txt` or `rst.txt`. Any regular expression will do.

Finally add your tests. Create a `README.extension` in `test/markups`
along with a `README.extension.html`. As you may imagine, the
Expand Down
2 changes: 1 addition & 1 deletion lib/github/markups.rb
Expand Up @@ -14,7 +14,7 @@
Orgmode::Parser.new(content).to_html
end

command(:rest2html, /rest|rst/)
command(:rest2html, /re?st(.txt)?/)

command('asciidoc -s --backend=xhtml11 -o - -', /asciidoc/)

Expand Down
2 changes: 1 addition & 1 deletion test/markup_test.rb
Expand Up @@ -6,7 +6,7 @@
class MarkupTest < Test::Unit::TestCase
Dir['test/markups/README.*'].each do |readme|
next if readme =~ /html$/
markup = readme.split('.').last
markup = readme.split('/').last.gsub(/^README\./, '')

define_method "test_#{markup}" do
expected = File.read("#{readme}.html")
Expand Down
13 changes: 13 additions & 0 deletions test/markups/README.rst.txt
@@ -0,0 +1,13 @@
Header 1
========

Example text.

Header 2
--------

1. Blah blah ``code`` blah

2. More ``code``, hooray


14 changes: 14 additions & 0 deletions test/markups/README.rst.txt.html
@@ -0,0 +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>
</ol>
</div>
</div>
</div>

0 comments on commit 5b98a3a

Please sign in to comment.