From 6ed7802ec175480132960a87e34350a4a93b31f9 Mon Sep 17 00:00:00 2001 From: Z Date: Mon, 3 Feb 2014 16:05:40 +0100 Subject: [PATCH 1/2] Add .apib to the list of Markdown file extensions --- lib/github/markup/markdown.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github/markup/markdown.rb b/lib/github/markup/markdown.rb index f4ef99dc..521160cb 100644 --- a/lib/github/markup/markdown.rb +++ b/lib/github/markup/markdown.rb @@ -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 From f6c88c19ba1e4c1e5bba4c13f61a2b6186348a5b Mon Sep 17 00:00:00 2001 From: Z Date: Mon, 3 Feb 2014 16:08:43 +0100 Subject: [PATCH 2/2] Add tests for rendering .apib as Markdown --- test/markup_test.rb | 1 + test/markups/README.apib | 12 ++++++++++++ test/markups/README.apib.html | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 test/markups/README.apib create mode 100644 test/markups/README.apib.html diff --git a/test/markup_test.rb b/test/markup_test.rb index 6f062c39..e2315d16 100644 --- a/test/markup_test.rb +++ b/test/markup_test.rb @@ -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 diff --git a/test/markups/README.apib b/test/markups/README.apib new file mode 100644 index 00000000..1698545a --- /dev/null +++ b/test/markups/README.apib @@ -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! diff --git a/test/markups/README.apib.html b/test/markups/README.apib.html new file mode 100644 index 00000000..2d2b5cf9 --- /dev/null +++ b/test/markups/README.apib.html @@ -0,0 +1,18 @@ +

Example API

+ +

This is an example Web API described in the API Blueprint format.

+ +

Message Resource [/message]

+ +

An example resource.

+ +

Retrieve Message [GET]

+ +

Retrieve the message.

+ +