Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render API Blueprint as Markdown #252

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/github/markup/markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Markdown < Implementation
}

def initialize
super(/md|mkdn?|mdwn|mdown|markdown|litcoffee/)
super(/md|mkdn?|mdwn|mdown|markdown|litcoffee|apib/)
end

def load
Expand Down
1 change: 1 addition & 0 deletions test/markup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def test_knows_what_it_can_and_cannot_render
assert_equal true, GitHub::Markup.can_render?('README.markdown')
assert_equal false, GitHub::Markup.can_render?('README.cmd')
assert_equal true, GitHub::Markup.can_render?('README.litcoffee')
assert_equal true, GitHub::Markup.can_render?('README.apib')
end

def test_fails_gracefully_on_missing_commands
Expand Down
12 changes: 12 additions & 0 deletions test/markups/README.apib
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Example API
This is an example Web API described in the [API Blueprint format](https://github.com/apiaryio/api-blueprint).

## Message Resource [/message]
An example resource.

### Retrieve Message [GET]
Retrieve the message.

+ Response 200 (text/plain)

Hello World!
18 changes: 18 additions & 0 deletions test/markups/README.apib.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h1>Example API</h1>

<p>This is an example Web API described in the <a href="https://github.com/apiaryio/api-blueprint">API Blueprint format</a>.</p>

<h2>Message Resource [/message]</h2>

<p>An example resource.</p>

<h3>Retrieve Message [GET]</h3>

<p>Retrieve the message.</p>

<ul>
<li><p>Response 200 (text/plain)</p>

<pre><code>Hello World!
</code></pre></li>
</ul>