From 7d662950e11a5f40bf09c7d176979f94e232b535 Mon Sep 17 00:00:00 2001 From: Alex Neises Date: Tue, 30 May 2017 14:26:21 -0500 Subject: [PATCH 1/2] Removed length attribute. --- templates/default.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/default.md b/templates/default.md index 1356159..df3f29c 100644 --- a/templates/default.md +++ b/templates/default.md @@ -5,9 +5,9 @@ <% groupOrder.forEach(function (group) { -%> - [<%= group %>](#<%=: group | mlink %>) - <% nameOrder[group].forEach(function (sub) { -%> + <% nameOrder[group].forEach(function (sub) { -%> - [<%= data[group][sub][0].title %>](#<%=: data[group][sub][0].title | mlink %>) - <% }); -%> + <% }); -%> <% }); %> @@ -23,9 +23,9 @@ <%-: data[group][sub][0].description | undef %> - <%-: data[group][sub][0].type | upcase %> <%= data[group][sub][0].url %> + <%-: data[group][sub][0].type | upcase %> <%= data[group][sub][0].url %> -<% if (data[group][sub][0].header && data[group][sub][0].header.fields.Header.length) { -%> +<% if (data[group][sub][0].header && data[group][sub][0].header.fields.Header) { -%> ### Headers | Name | Type | Description | @@ -35,7 +35,7 @@ <% }); //forech parameter -%> <% } //if parameters -%> -<% if (data[group][sub][0].header && data[group][sub][0].header.examples.length) { -%> +<% if (data[group][sub][0].header && data[group][sub][0].header.examples) { -%> ### Header Examples From a9bc4ca5165b4d9bf51e26d666efca950ad4d92d Mon Sep 17 00:00:00 2001 From: Alex Neises Date: Tue, 30 May 2017 15:07:10 -0500 Subject: [PATCH 2/2] Updated template to my liking. --- templates/default.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/templates/default.md b/templates/default.md index df3f29c..aa5a4c0 100644 --- a/templates/default.md +++ b/templates/default.md @@ -6,7 +6,7 @@ <% groupOrder.forEach(function (group) { -%> - [<%= group %>](#<%=: group | mlink %>) <% nameOrder[group].forEach(function (sub) { -%> -- [<%= data[group][sub][0].title %>](#<%=: data[group][sub][0].title | mlink %>) +- [<%= data[group][sub][0].name %>](#<%=: data[group][sub][0].name | mlink %>) <% }); -%> <% }); %> @@ -18,14 +18,16 @@ # <%= group %> <% nameOrder[group].forEach(function (sub) { -%> -## <%= data[group][sub][0].title %> -[Back to top](#top) +## <%= data[group][sub][0].name %> +<%= data[group][sub][0].title %> <%-: data[group][sub][0].description | undef %> <%-: data[group][sub][0].type | upcase %> <%= data[group][sub][0].url %> <% if (data[group][sub][0].header && data[group][sub][0].header.fields.Header) { -%> + + ### Headers | Name | Type | Description | @@ -40,9 +42,7 @@ ### Header Examples <% data[group][sub][0].header.examples.forEach(function (example) { -%> -<%= example.title %> - -``` +```json <%- example.content %> ``` <% }); //foreach example -%> @@ -52,7 +52,7 @@ <% Object.keys(data[group][sub][0].parameter.fields).forEach(function(g) { -%> -### <%= g %> Parameters +### Parameters | Name | Type | Description | |:---------|:-----------|:--------------------------------------| @@ -67,13 +67,14 @@ _Allowed values: <%- param.allowedValues %>_<% } %>| <% }); //forech (group) parameter -%> <% }); //forech param parameter -%> <% } //if parameters -%> -<% if (data[group][sub][0].examples && data[group][sub][0].examples.length) { -%> -### Examples -<% data[group][sub][0].examples.forEach(function (example) { -%> -<%= example.title %> +<% if (data[group][sub][0].parameter && data[group][sub][0].parameter.examples.length) { -%> -``` + +### Parameter Examples + +<% data[group][sub][0].parameter.examples.forEach(function (example) { -%> +```json <%- example.content %> ``` <% }); //foreach example -%> @@ -85,7 +86,7 @@ _Allowed values: <%- param.allowedValues %>_<% } %>| <% data[group][sub][0].success.examples.forEach(function (example) { -%> <%= example.title %> -``` +```json <%- example.content %> ``` <% }); //foreach success example -%> @@ -115,10 +116,11 @@ _Allowed values: <%- param.allowedValues %>_<% } %>| <% data[group][sub][0].error.examples.forEach(function (example) { -%> <%= example.title %> -``` +```json <%- example.content %> ``` <% }); //foreach error example -%> <% } //if examples -%> +[Back to top](#top) <% }); //foreach sub -%> <% }); //foreach group -%>