lib/templates/real_template.md in smashing_docs-1.0.0 vs lib/templates/real_template.md in smashing_docs-1.1.0
- old
+ new
@@ -1,16 +1,45 @@
+## <%= information[:endpoint_title] || ' ' %>
+
#### <%= request.method %> <%= request.path %>
-<%= information[:note] %>
+<%= information[:about] %>
-| Param | Value |
-| ----- | ----- |
-<%= table_entries = []
- request.params.except(:controller, :action, :format).each do |param, value|
+### Query Parameters
+| Parameter | Value |
+| --------- | ----- |
+<%=
+ table_entries = []
+ request_params = request.params.except(:controller, :action, :format)
+ request_params.each do |param, value|
table_entries << "| #{param} | #{value} |"
end
- table_entries.join("\n") %>
-Response: <%= response.status %>
+ table_entries << "| none | nil |" if table_entries.empty?
+ table_entries.join("\n")
+%>
+
+### Response
+**Status: <%= response.status %>**
+
+**Response Headers**
+
+| Field | Value |
+| ----- | ----- |
+<%=
+table_entries = []
+response.headers.each do |header, value|
+ table_entries << "| #{header} | #{value} |"
+end
+
+table_entries << "| none | nil |" if table_entries.empty?
+table_entries.join("\n")
+%>
+
+**JSON Example**
```json
<%= JSON.pretty_generate(JSON.parse(response.body)) %>
```
+
+<%= information[:note] %>
+
+=================================================================================