Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
feat: support resource explanation rendering
Browse files Browse the repository at this point in the history
Support resource explanation rendering of rspec api documentation.
See more details in zipmark/rspec_api_documentation#269 .
  • Loading branch information
yachun-ikala committed Jul 10, 2016
1 parent bfa6d94 commit e0dcc9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/apitome/docs/_all_examples.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% resources.each do |resource| %>
<section class="example" id="<%= id_for(resource['name']) %>">
<h1 class="resource-name"><%= resource['name'] %></h1>

<%= render partial: 'resource_explanation', locals: { explanation: resource['explanation'] } if resource['explanation'] %>

<% resource['examples'].each do |example| %>
<% link = example['link'].gsub('.json', '') %>
<article id="<%= id_for(link) %>">
Expand Down
3 changes: 3 additions & 0 deletions app/views/apitome/docs/_resource_explanation.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<article class="resource_explanation">
<%= raw rendered_markdown(explanation.strip_heredoc) %>
</article>

0 comments on commit e0dcc9b

Please sign in to comment.