Skip to content

Commit

Permalink
Merge pull request #379 from cookpad/slate-resource-explanation
Browse files Browse the repository at this point in the history
Slate resource explanation
  • Loading branch information
oestrich authored Apr 20, 2018
2 parents 35bac0b + 866c3ed commit 560c3bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions features/slate_documentation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Feature: Generate Slate documentation from test examples
end
resource 'Orders' do
explanation "An Order represents an amount of money to be paid"
get '/orders' do
response_field :page, "Current page"
Expand Down Expand Up @@ -214,6 +215,8 @@ Feature: Generate Slate documentation from test examples
"""
# Orders
An Order represents an amount of money to be paid
## Creating an order
Expand Down
3 changes: 1 addition & 2 deletions lib/rspec_api_documentation/writers/slate_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ def write
file.write markup_index_class.new(index, configuration).render

IndexHelper.sections(index.examples, @configuration).each do |section|

file.write "# #{section[:resource_name]}\n\n"
section[:examples].sort_by!(&:description) unless configuration.keep_source_order
file.write "#{section[:resource_explanation]}\n\n"

section[:examples].each do |example|
markup_example = markup_example_class.new(example, configuration)
Expand Down

0 comments on commit 560c3bd

Please sign in to comment.