diff --git a/template/index.html b/template/index.html index 364a7460..399807ee 100644 --- a/template/index.html +++ b/template/index.html @@ -137,7 +137,7 @@

{{underscoreToSpace article.group}}{{#if article.title}} - {{article.title}} {{#each article.examples}}

{{title}}

-
{{{content}}}
+
{{content}}
{{/each}} {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields}} @@ -176,7 +176,7 @@

{{__ @key}}

{{/each}} {{#each params.examples}}

{{title}}

-
{{{content}}}
+
{{content}}
{{/each}} {{/if}} diff --git a/test/fixtures/api_data.js b/test/fixtures/api_data.js index abf49c2e..3a3d6b97 100644 --- a/test/fixtures/api_data.js +++ b/test/fixtures/api_data.js @@ -73,6 +73,54 @@ define({ api: [ }, "filename": "test/fixtures/example/title_and_structure.js" }, + { + "type": "get", + "url": "/test/escape", + "title": "Escape Example", + "name": "GetEscape", + "group": "Escape", + "version": "0.6.0", + "description": "

Escape Example data.

", + "examples": [ + { + "title": "Example usage:", + "content": " curl -i http://localhost/escape/text\n curl -i http://localhost/escape/html\n curl -i http://localhost/escape/xml\n" + } + ], + "success": { + "examples": [ + { + "title": "Example Response", + "content": "HTTP/1.1 200 OK {\n field_text: 'text-value',\n field_html: 'html-value',\n field_xml: 'xml-value'\n}\n" + } + ] + }, + "filename": "test/fixtures/example/escape.js" + }, + { + "type": "get", + "url": "/test/escape", + "title": "Escape Example", + "name": "GetEscape", + "group": "Escape", + "version": "0.5.0", + "description": "

Escape Example data - with comparison.

", + "examples": [ + { + "title": "Example usage:", + "content": " curl -i http://localhost/escape/text-old\n curl -i http://localhost/escape/html-old\n curl -i http://localhost/escape/xml-old\n" + } + ], + "success": { + "examples": [ + { + "title": "Example Response", + "content": "HTTP/1.1 200 OK {\n field_text: 'text-value old',\n field_html: 'html-value old',\n field_xml: 'xml-value old'\n}\n" + } + ] + }, + "filename": "test/fixtures/example/escape.js" + }, { "type": "get", "url": "/group/:id", diff --git a/test/fixtures/api_data.json b/test/fixtures/api_data.json index 6d458ed0..3af04af4 100644 --- a/test/fixtures/api_data.json +++ b/test/fixtures/api_data.json @@ -73,6 +73,54 @@ }, "filename": "test/fixtures/example/title_and_structure.js" }, + { + "type": "get", + "url": "/test/escape", + "title": "Escape Example", + "name": "GetEscape", + "group": "Escape", + "version": "0.6.0", + "description": "

Escape Example data.

", + "examples": [ + { + "title": "Example usage:", + "content": " curl -i http://localhost/escape/text\n curl -i http://localhost/escape/html\n curl -i http://localhost/escape/xml\n" + } + ], + "success": { + "examples": [ + { + "title": "Example Response", + "content": "HTTP/1.1 200 OK {\n field_text: 'text-value',\n field_html: 'html-value',\n field_xml: 'xml-value'\n}\n" + } + ] + }, + "filename": "test/fixtures/example/escape.js" + }, + { + "type": "get", + "url": "/test/escape", + "title": "Escape Example", + "name": "GetEscape", + "group": "Escape", + "version": "0.5.0", + "description": "

Escape Example data - with comparison.

", + "examples": [ + { + "title": "Example usage:", + "content": " curl -i http://localhost/escape/text-old\n curl -i http://localhost/escape/html-old\n curl -i http://localhost/escape/xml-old\n" + } + ], + "success": { + "examples": [ + { + "title": "Example Response", + "content": "HTTP/1.1 200 OK {\n field_text: 'text-value old',\n field_html: 'html-value old',\n field_xml: 'xml-value old'\n}\n" + } + ] + }, + "filename": "test/fixtures/example/escape.js" + }, { "type": "get", "url": "/group/:id", diff --git a/test/fixtures/api_project.js b/test/fixtures/api_project.js index 65c7e651..3885552e 100644 --- a/test/fixtures/api_project.js +++ b/test/fixtures/api_project.js @@ -12,6 +12,6 @@ define({ }, "generator": { "version": "0.6.2", - "time": "2014-08-08T13:31:19.377Z" + "time": "2014-08-08T13:56:55.412Z" } }); \ No newline at end of file diff --git a/test/fixtures/api_project.json b/test/fixtures/api_project.json index dd5d2ae4..eabb346c 100644 --- a/test/fixtures/api_project.json +++ b/test/fixtures/api_project.json @@ -12,6 +12,6 @@ }, "generator": { "version": "0.6.2", - "time": "2014-08-08T13:31:19.377Z" + "time": "2014-08-08T13:56:55.412Z" } } \ No newline at end of file diff --git a/test/fixtures/example/escape.js b/test/fixtures/example/escape.js new file mode 100644 index 00000000..d9a4d64a --- /dev/null +++ b/test/fixtures/example/escape.js @@ -0,0 +1,39 @@ +/** + * @api {get} /test/escape Escape Example + * @apiName GetEscape + * @apiGroup Escape + * @apiVersion 0.6.0 + * @apiDescription Escape Example data. + * + * @apiExample Example usage: + * curl -i http://localhost/escape/text + * curl -i http://localhost/escape/html + * curl -i http://localhost/escape/xml + * + * @apiSuccessExample Example Response + * HTTP/1.1 200 OK { + * field_text: 'text-value', + * field_html: 'html-value', + * field_xml: 'xml-value' + * } + */ + +/** + * @api {get} /test/escape Escape Example + * @apiName GetEscape + * @apiGroup Escape + * @apiVersion 0.5.0 + * @apiDescription Escape Example data - with comparison. + * + * @apiExample Example usage: + * curl -i http://localhost/escape/text-old + * curl -i http://localhost/escape/html-old + * curl -i http://localhost/escape/xml-old + * + * @apiSuccessExample Example Response + * HTTP/1.1 200 OK { + * field_text: 'text-value old', + * field_html: 'html-value old', + * field_xml: 'xml-value old' + * } + */