Skip to content

Change extension for Markdown from .markdown to .md #366

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

Merged
merged 1 commit into from
Apr 14, 2018
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
doc
tmp
.rvmrc
.ruby-version
Expand Down
28 changes: 14 additions & 14 deletions features/markdown_documentation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Feature: Generate Markdown documentation from test examples
And the exit status should be 0

Scenario: Index file should look like we expect
Then the file "doc/api/index.markdown" should contain exactly:
Then the file "doc/api/index.md" should contain exactly:
"""
# Example API
Example API Description
Expand All @@ -155,19 +155,19 @@ Feature: Generate Markdown documentation from test examples

Getting help

* [Getting welcome message](help/getting_welcome_message.markdown)
* [Getting welcome message](help/getting_welcome_message.md)

## Orders

* [Creating an order](orders/creating_an_order.markdown)
* [Deleting an order](orders/deleting_an_order.markdown)
* [Getting a list of orders](orders/getting_a_list_of_orders.markdown)
* [Getting a specific order](orders/getting_a_specific_order.markdown)
* [Updating an order](orders/updating_an_order.markdown)
* [Creating an order](orders/creating_an_order.md)
* [Deleting an order](orders/deleting_an_order.md)
* [Getting a list of orders](orders/getting_a_list_of_orders.md)
* [Getting a specific order](orders/getting_a_specific_order.md)
* [Updating an order](orders/updating_an_order.md)
"""

Scenario: Example 'Getting a list of orders' file should look like we expect
Then the file "doc/api/orders/getting_a_list_of_orders.markdown" should contain exactly:
Then the file "doc/api/orders/getting_a_list_of_orders.md" should contain exactly:
"""
# Orders API

Expand Down Expand Up @@ -222,7 +222,7 @@ Feature: Generate Markdown documentation from test examples
"""

Scenario: Example 'Creating an order' file should look like we expect
Then the file "doc/api/orders/creating_an_order.markdown" should contain exactly:
Then the file "doc/api/orders/creating_an_order.md" should contain exactly:
"""
# Orders API

Expand Down Expand Up @@ -266,16 +266,16 @@ Feature: Generate Markdown documentation from test examples
"""

Scenario: Example 'Deleting an order' file should be created
Then a file named "doc/api/orders/deleting_an_order.markdown" should exist
Then a file named "doc/api/orders/deleting_an_order.md" should exist

Scenario: Example 'Getting a list of orders' file should be created
Then a file named "doc/api/orders/getting_a_list_of_orders.markdown" should exist
Then a file named "doc/api/orders/getting_a_list_of_orders.md" should exist

Scenario: Example 'Getting a specific order' file should be created
Then a file named "doc/api/orders/getting_a_specific_order.markdown" should exist
Then a file named "doc/api/orders/getting_a_specific_order.md" should exist

Scenario: Example 'Updating an order' file should be created
Then a file named "doc/api/orders/updating_an_order.markdown" should exist
Then a file named "doc/api/orders/updating_an_order.md" should exist

Scenario: Example 'Getting welcome message' file should be created
Then a file named "doc/api/help/getting_welcome_message.markdown" should exist
Then a file named "doc/api/help/getting_welcome_message.md" should exist
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/views/markdown_example.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RspecApiDocumentation
module Views
class MarkdownExample < MarkupExample
EXTENSION = 'markdown'
EXTENSION = 'md'

def initialize(example, configuration)
super
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/writers/markdown_writer.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RspecApiDocumentation
module Writers
class MarkdownWriter < GeneralMarkupWriter
EXTENSION = 'markdown'
EXTENSION = 'md'

def markup_index_class
RspecApiDocumentation::Views::MarkdownIndex
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/markdown_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
FileUtils.mkdir_p(configuration.docs_dir)

writer.write
index_file = File.join(configuration.docs_dir, "index.markdown")
index_file = File.join(configuration.docs_dir, "index.md")
expect(File.exists?(index_file)).to be_truthy
end
end
Expand Down