apitome 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. checksums.yaml +15 -0
  2. data/MIT.LICENSE +22 -0
  3. data/README.md +21 -0
  4. data/app/assets/javascripts/apitome/application.js +16 -0
  5. data/app/assets/stylesheets/apitome/application.css +120 -0
  6. data/app/controllers/apitome/docs_controller.rb +63 -0
  7. data/app/views/apitome/docs/_all_examples.html.erb +10 -0
  8. data/app/views/apitome/docs/_body.html.erb +4 -0
  9. data/app/views/apitome/docs/_curl.html.erb +4 -0
  10. data/app/views/apitome/docs/_example.html.erb +25 -0
  11. data/app/views/apitome/docs/_explanation.html.erb +3 -0
  12. data/app/views/apitome/docs/_header.html.erb +7 -0
  13. data/app/views/apitome/docs/_headers.html.erb +4 -0
  14. data/app/views/apitome/docs/_navigation.html.erb +28 -0
  15. data/app/views/apitome/docs/_params.html.erb +27 -0
  16. data/app/views/apitome/docs/_query.html.erb +4 -0
  17. data/app/views/apitome/docs/_route.html.erb +4 -0
  18. data/app/views/apitome/docs/_status.html.erb +4 -0
  19. data/app/views/apitome/docs/index.html.erb +6 -0
  20. data/app/views/apitome/docs/show.html.erb +1 -0
  21. data/app/views/layouts/apitome/application.html.erb +30 -0
  22. data/config/routes.rb +4 -0
  23. data/lib/apitome.rb +7 -0
  24. data/lib/apitome/configuration.rb +30 -0
  25. data/lib/apitome/engine.rb +18 -0
  26. data/lib/apitome/exceptions.rb +3 -0
  27. data/lib/apitome/version.rb +3 -0
  28. data/spec/apitome/configuration_spec.rb +0 -0
  29. data/spec/apitome/engine_spec.rb +0 -0
  30. data/spec/dummy/Rakefile +7 -0
  31. data/spec/dummy/config.ru +15 -0
  32. data/spec/dummy/config/application.rb +16 -0
  33. data/spec/dummy/config/boot.rb +7 -0
  34. data/spec/dummy/config/environment.rb +5 -0
  35. data/spec/dummy/config/environments/development.rb +27 -0
  36. data/spec/dummy/config/environments/test.rb +29 -0
  37. data/spec/dummy/config/initializers/apitome.rb +6 -0
  38. data/spec/dummy/config/routes.rb +2 -0
  39. data/spec/dummy/doc/api.md +20 -0
  40. data/spec/dummy/doc/api/access_tokens/generating_an_access_token.json +47 -0
  41. data/spec/dummy/doc/api/alerts/listing_alert_types.json +33 -0
  42. data/spec/dummy/doc/api/alerts/listing_alerts.json +52 -0
  43. data/spec/dummy/doc/api/index.json +29 -0
  44. data/spec/dummy/log/development.log +18075 -0
  45. data/spec/dummy/public/favicon.ico +0 -0
  46. data/spec/dummy/script/rails +6 -0
  47. data/spec/dummy/tmp/cache/assets/development/sprockets/038ff9775f572c3dfc1a380247c59890 +0 -0
  48. data/spec/dummy/tmp/cache/assets/development/sprockets/03fdbedf7c517a2e1feda524c52a652a +0 -0
  49. data/spec/dummy/tmp/cache/assets/development/sprockets/07b6695ed44671a8d213823bc763b378 +0 -0
  50. data/spec/dummy/tmp/cache/assets/development/sprockets/0f10ed0a447d44a80afcc427e858ddf1 +0 -0
  51. data/spec/dummy/tmp/cache/assets/development/sprockets/3c0d7839d05fa6264e540e4612e76d8e +0 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/54ddec13d8230a77be44f49bba9ab063 +0 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/82a9467461d6cbd74f0c38002037d366 +0 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/82b46b5876ec191ffb4ee1f73b9037cf +0 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/833c936b0961f9bc9f6821682b662c28 +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/86d22f0e7f750dbdf5b602b99e7c51c8 +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/898d7a0610dc79a7141e7b570b77a951 +0 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/8eb01b8f553b48d4712bc6df728f05ed +0 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/98be05ccb93e3f09cd213ad66be4afd5 +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/a4636c23002ad75a90567e067a4a87b2 +0 -0
  61. data/spec/dummy/tmp/cache/assets/development/sprockets/a7dbf6dc1b06132961af53b0dc4bd187 +0 -0
  62. data/spec/dummy/tmp/cache/assets/development/sprockets/b7fc26490932e9ef364d72f46116f29a +0 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/d9052716353aa1cde34614ee79e75fc2 +0 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/dab2b969e1e0d90b3b2325566486eca9 +0 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/dfd8cd5b3aa5e4d8e14f8b26118e94f3 +0 -0
  66. data/spec/dummy/tmp/cache/assets/development/sprockets/e71d75c9c50c9552b2c6a42957e853fd +0 -0
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/fa138ab5e008fb2d4c75be6c6558677b +0 -0
  68. data/vendor/assets/javascripts/apitome/bootstrap.min.LICENSE +176 -0
  69. data/vendor/assets/javascripts/apitome/bootstrap.min.js +6 -0
  70. data/vendor/assets/javascripts/apitome/highlight.min.LICENSE +24 -0
  71. data/vendor/assets/javascripts/apitome/highlight.min.js +1 -0
  72. data/vendor/assets/javascripts/apitome/jquery-2.0.3.min.js +6 -0
  73. data/vendor/assets/stylesheets/apitome/bootstrap.min.css +9 -0
  74. data/vendor/assets/stylesheets/apitome/highlight_themes/arta.css +158 -0
  75. data/vendor/assets/stylesheets/apitome/highlight_themes/ascetic.css +50 -0
  76. data/vendor/assets/stylesheets/apitome/highlight_themes/brown_paper.css +104 -0
  77. data/vendor/assets/stylesheets/apitome/highlight_themes/brown_papersq.png +0 -0
  78. data/vendor/assets/stylesheets/apitome/highlight_themes/dark.css +103 -0
  79. data/vendor/assets/stylesheets/apitome/highlight_themes/default.css +135 -0
  80. data/vendor/assets/stylesheets/apitome/highlight_themes/far.css +111 -0
  81. data/vendor/assets/stylesheets/apitome/highlight_themes/github.css +127 -0
  82. data/vendor/assets/stylesheets/apitome/highlight_themes/googlecode.css +144 -0
  83. data/vendor/assets/stylesheets/apitome/highlight_themes/idea.css +121 -0
  84. data/vendor/assets/stylesheets/apitome/highlight_themes/ir_black.css +104 -0
  85. data/vendor/assets/stylesheets/apitome/highlight_themes/magula.css +121 -0
  86. data/vendor/assets/stylesheets/apitome/highlight_themes/monokai.css +114 -0
  87. data/vendor/assets/stylesheets/apitome/highlight_themes/pojoaque.css +104 -0
  88. data/vendor/assets/stylesheets/apitome/highlight_themes/pojoaque.jpg +0 -0
  89. data/vendor/assets/stylesheets/apitome/highlight_themes/rainbow.css +114 -0
  90. data/vendor/assets/stylesheets/apitome/highlight_themes/school_book.css +111 -0
  91. data/vendor/assets/stylesheets/apitome/highlight_themes/school_book.png +0 -0
  92. data/vendor/assets/stylesheets/apitome/highlight_themes/solarized_dark.css +88 -0
  93. data/vendor/assets/stylesheets/apitome/highlight_themes/solarized_light.css +88 -0
  94. data/vendor/assets/stylesheets/apitome/highlight_themes/sunburst.css +158 -0
  95. data/vendor/assets/stylesheets/apitome/highlight_themes/tomorrow-night-blue.css +52 -0
  96. data/vendor/assets/stylesheets/apitome/highlight_themes/tomorrow-night-bright.css +51 -0
  97. data/vendor/assets/stylesheets/apitome/highlight_themes/tomorrow-night-eighties.css +51 -0
  98. data/vendor/assets/stylesheets/apitome/highlight_themes/tomorrow-night.css +52 -0
  99. data/vendor/assets/stylesheets/apitome/highlight_themes/tomorrow.css +49 -0
  100. data/vendor/assets/stylesheets/apitome/highlight_themes/vs.css +86 -0
  101. data/vendor/assets/stylesheets/apitome/highlight_themes/xcode.css +154 -0
  102. data/vendor/assets/stylesheets/apitome/highlight_themes/zenburn.css +115 -0
  103. metadata +233 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjBhMmIwYWE5MTk1ODg5Njg3Zjg3ZTYyZGZlNjMxNmZkYjkxODEwNg==
5
+ data.tar.gz: !binary |-
6
+ YmZlY2NjYzczOTZlNmQ1YWVjZDhhYWRmNWIzMTc4N2IwOTE4NDY1YQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OGQ4ZDQ3YjQyMzM2MjU0ZmQ0ZDkwNTVhOThjYTIwMTEzOTg4ZGRkMDdhNGFm
10
+ ODlkNDMyODlkZTIzNzEwM2E2MzBhNWM5MTNiM2E0YmFlZmY2ZmY2MjgzZmEz
11
+ ZDBiY2U1OTkwMjk3YmRkZDNiYzgxYWZkY2JiZjNjMjhiMjgzNGQ=
12
+ data.tar.gz: !binary |-
13
+ ODY2NWU2ZTlhNzhhNmNhMDkyZGQyOTg2ZjY4MDlhY2NkZDQ2ZjYyMjA2ZmRm
14
+ MTBkNTBjMDY1N2Y2OGU3ZWYxOGZkNDgwM2NjZjg5ZTM0OGFmNzRhNWQwM2Vm
15
+ NjMxNjc4Nzk0YzEzMjE1MmQ1OGMxMzBmNWYxMmQ1MGQ2YTdhNzY=
data/MIT.LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright 2013 Jeremy Jackson / ModeSet
2
+
3
+ https://github.com/modeset/teaspoon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ Apitome
2
+ =======
3
+
4
+
5
+
6
+ `spec_helper.rb`
7
+ ```ruby
8
+ RspecApiDocumentation.configure do |config|
9
+ config.format = :json
10
+ end
11
+ ```
12
+
13
+ ## License
14
+
15
+ Licensed under the [MIT License](http://creativecommons.org/licenses/MIT/)
16
+
17
+ Copyright 2013 [Mode Set](https://github.com/modeset)
18
+
19
+
20
+ ## Make Code Not War
21
+ ![crest](https://secure.gravatar.com/avatar/aa8ea677b07f626479fd280049b0e19f?s=75)
@@ -0,0 +1,16 @@
1
+ //= require apitome/jquery-2.0.3.min
2
+ //= require apitome/bootstrap.min
3
+ //= require apitome/highlight.min
4
+
5
+ hljs.initHighlightingOnLoad();
6
+
7
+ jQuery(function(){
8
+ $(document.body).scrollspy({target: '.sidebar', offset: $('.navbar').outerHeight(true)});
9
+ var $sideBar = $('.single-page .sidebar');
10
+ $sideBar.affix({
11
+ offset: {
12
+ top: function () { return this.top = $sideBar.offset().top - $('.docs-nav').height() - 30 }
13
+ }
14
+ })
15
+ });
16
+
@@ -0,0 +1,120 @@
1
+ /*
2
+ *= require apitome/bootstrap.min
3
+ *= require apitome/highlight_themes/default
4
+ */
5
+
6
+ body {
7
+ position: relative;
8
+ padding-top: 50px;
9
+ }
10
+
11
+ h1,
12
+ h2 {
13
+ margin-top: 30px;
14
+ }
15
+ pre code {
16
+ padding: 0;
17
+ background: transparent;
18
+ }
19
+ .table code {
20
+ font-size: 13px;
21
+ font-weight: normal;
22
+ }
23
+
24
+ .docs-nav {
25
+ text-shadow: 0 -1px 0 rgba(0,0,0,.15);
26
+ background-color: #eee;
27
+ border-color: #ddd;
28
+ border-top: 4px solid #009dc4;
29
+ box-shadow: 0 1px 0 rgba(255,255,255,.1);
30
+ margin-bottom: 25px;
31
+ }
32
+ .docs-nav .navbar-brand {
33
+ margin: 0;
34
+ }
35
+ .docs-nav .navbar-brand a {
36
+ color: #333;
37
+ text-decoration: none;
38
+ }
39
+
40
+ .sidebar.affix {
41
+ position: static;
42
+ }
43
+ .sidenav {
44
+ margin-top: 30px;
45
+ margin-bottom: 30px;
46
+ padding-top: 10px;
47
+ padding-bottom: 10px;
48
+ text-shadow: 0 1px 0 #fff;
49
+ background-color: #f7f5fa;
50
+ border-radius: 5px;
51
+ }
52
+ .sidebar .nav > li > a {
53
+ display: block;
54
+ color: #716b7a;
55
+ padding: 5px 20px;
56
+ }
57
+ .sidebar .nav > li > a:hover,
58
+ .sidebar .nav > li > a:focus {
59
+ text-decoration: none;
60
+ background-color: #e5e3e9;
61
+ border-right: 1px solid #dbd8e0;
62
+ }
63
+ .sidebar .nav > .active > a,
64
+ .sidebar .nav > .active:hover > a,
65
+ .sidebar .nav > .active:focus > a {
66
+ font-weight: bold;
67
+ color: #333;
68
+ background-color: transparent;
69
+ border-right: 1px solid #009dc4;
70
+ }
71
+ .sidebar .nav .nav {
72
+ margin-bottom: 8px;
73
+ }
74
+ .sidebar .nav .nav > li > a {
75
+ padding-top: 3px;
76
+ padding-bottom: 3px;
77
+ padding-left: 30px;
78
+ font-size: 90%;
79
+ }
80
+
81
+ body.single-page .docs-section section.readme article {
82
+ margin-top: -50px;
83
+ margin-bottom: -20px;
84
+ }
85
+ body.single-page .docs-section section article {
86
+ padding-top: 50px;
87
+ }
88
+
89
+ @media screen and (min-width: 992px) {
90
+ .sidebar.affix {
91
+ position: fixed;
92
+ top: 80px;
93
+ }
94
+ .sidebar.affix,
95
+ .sidebar.affix-bottom {
96
+ width: 283px;
97
+ }
98
+ .sidebar.affix-bottom {
99
+ position: absolute;
100
+ }
101
+ .sidebar.affix .sidenav,
102
+ .sidebar.affix-bottom .sidenav {
103
+ margin-top: 0;
104
+ margin-bottom: 0;
105
+ }
106
+ body.single-page .sidebar .nav .nav {
107
+ display: none;
108
+ }
109
+ body.single-page .sidebar .nav > .active > ul {
110
+ display: block;
111
+ }
112
+ }
113
+
114
+ @media screen and (min-width: 1200px) {
115
+ .sidebar.affix,
116
+ .sidebar.affix-bottom {
117
+ width: 350px;
118
+ }
119
+ }
120
+
@@ -0,0 +1,63 @@
1
+ class Apitome::DocsController < ActionController::Base
2
+
3
+ layout Apitome.configuration.layout
4
+
5
+ helper_method :resources, :example, :formatted_body, :param_headers, :param_extras, :formatted_readme, :set_example, :id_for
6
+
7
+ def index
8
+ end
9
+
10
+ def show
11
+ end
12
+
13
+ private
14
+
15
+ def file_for(file)
16
+ file = Apitome.configuration.root.join(Apitome.configuration.doc_path, file)
17
+ raise Apitome::FileNotFound unless File.exists?(file)
18
+ File.read(file)
19
+ end
20
+
21
+ def resources
22
+ @resources ||= JSON.parse(file_for('index.json'))['resources']
23
+ end
24
+
25
+ def example
26
+ @example ||= JSON.parse(file_for("#{params[:path]}.json"))
27
+ end
28
+
29
+ def set_example(resource)
30
+ @example = JSON.parse(file_for("#{resource}.json"))
31
+ end
32
+
33
+ def formatted_readme
34
+ file = Apitome.configuration.root.join(Apitome.configuration.doc_path, Apitome.configuration.readme)
35
+ GitHub::Markdown.render_gfm(file_for(file))
36
+ end
37
+
38
+ def formatted_body(body, type)
39
+ if type =~ /json/
40
+ JSON.pretty_generate(JSON.parse(body))
41
+ else
42
+ body
43
+ end
44
+ end
45
+
46
+ def param_headers(params)
47
+ titles = %w{Name Description}
48
+ titles += param_extras(params)
49
+ end
50
+
51
+ def param_extras(params)
52
+ extras = []
53
+ for param in params
54
+ extras += param.reject{ |k,v| %w{name description required scope}.include?(k) }.keys
55
+ end
56
+ extras.uniq
57
+ end
58
+
59
+ def id_for(str)
60
+ str.gsub(/\.json$/, '').underscore.gsub(/[^0-9a-z]+/i, '-')
61
+ end
62
+
63
+ end
@@ -0,0 +1,10 @@
1
+ <% resources.each do |resource| %>
2
+ <section class="example" id="<%= id_for(resource['name']) %>">
3
+ <% resource['examples'].each do |example| %>
4
+ <article id="<%= id_for(example['link'].gsub('.json', '')) %>">
5
+ <% set_example(example['link'].gsub('.json', '')) %>
6
+ <%= render partial: 'example' %>
7
+ </article>
8
+ <% end %>
9
+ </section>
10
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <section class="body">
2
+ <h4>Body</h4>
3
+ <pre><code class="<%= type %>"><%= formatted_body(body, type) %></code></pre>
4
+ </section>
@@ -0,0 +1,4 @@
1
+ <section class="curl">
2
+ <h4>cURL</h4>
3
+ <pre><%= request['curl'] %></pre>
4
+ </section>
@@ -0,0 +1,25 @@
1
+ <h2><%= example['resource'] %> API</h2>
2
+ <h3><%= example['description'] %></h3>
3
+
4
+ <%= render partial: 'apitome/docs/explanation', locals: {explaination: example['explanation']} if example['explanation'] %>
5
+ <%= render partial: 'apitome/docs/params', locals: {params: example['parameters']} if example['parameters'].size > 0 %>
6
+
7
+ <% example['requests'].each_with_index do |request, index| %>
8
+ <div id="<%= "request-#{index}" %>">
9
+ <h3>Request</h3>
10
+ <div class="request">
11
+ <%= render partial: 'apitome/docs/route', locals: {request: request, index: index} %>
12
+ <%= render partial: 'apitome/docs/headers', locals: {request: request, index: index, headers: request['request_headers']} %>
13
+ <%= render partial: 'apitome/docs/query', locals: {request: request, index: index} unless request['request_query_parameters'].empty? %>
14
+ <%= render partial: 'apitome/docs/body', locals: {request: request, index: index, body: request['request_body'], type: request['request_content_type']} if request['request_body'] %>
15
+ <%= render partial: 'apitome/docs/curl', locals: {request: request, index: index} if request['curl'] %>
16
+ </div>
17
+
18
+ <h3>Response</h3>
19
+ <div class="response">
20
+ <%= render partial: 'apitome/docs/status', locals: {request: request, index: index} %>
21
+ <%= render partial: 'apitome/docs/headers', locals: {request: request, index: index, headers: request['response_headers']} %>
22
+ <%= render partial: 'apitome/docs/body', locals: {request: request, index: index, body: request['response_body'], type: request['response_content_type']} if request['response_body'] %>
23
+ </div>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <p class="explanation">
2
+ <%= raw example['explanation'] %>
3
+ </p>
@@ -0,0 +1,7 @@
1
+ <header class="navbar navbar-fixed-top docs-nav" role="banner">
2
+ <div class="container">
3
+ <div class="navbar-header">
4
+ <h1 class="navbar-brand"><a href="<%= Apitome.configuration.mount_at %>"><%= Apitome.configuration.title %></a></h1>
5
+ </div>
6
+ </div>
7
+ </header>
@@ -0,0 +1,4 @@
1
+ <section class="headers">
2
+ <h4>Headers</h4>
3
+ <pre><code class="http"><%= headers.map{ |k,v| "#{k}: #{v}" }.join("\n") %></code></pre>
4
+ </section>
@@ -0,0 +1,28 @@
1
+ <ul class="nav sidenav">
2
+ <li>
3
+ <% if Apitome.configuration.single_page %>
4
+ <a href="#readme">README</a>
5
+ <% else %>
6
+ <a href="<%= Apitome.configuration.mount_at %>">README</a>
7
+ <% end %>
8
+ </li>
9
+ <% resources.each do |resource| %>
10
+ <li>
11
+ <% if Apitome.configuration.single_page %>
12
+ <a href="#<%= id_for(resource['examples'].first['link']) %>"><%= resource['name'] %></a>
13
+ <ul class="nav">
14
+ <% resource['examples'].each do |example| %>
15
+ <li><%= link_to example['description'], "##{id_for(example['link'])}" %></li>
16
+ <% end %>
17
+ </ul>
18
+ <% else %>
19
+ <li><%= link_to resource['name'], "#{Apitome.configuration.mount_at}/#{resource['examples'].first['link'].gsub(/\.json$/, '')}" %></li>
20
+ <ul class="nav">
21
+ <% resource['examples'].each do |example| %>
22
+ <li><%= link_to example['description'], "#{Apitome.configuration.mount_at}/#{example['link'].gsub(/\.json$/, '')}" %></li>
23
+ <% end %>
24
+ </ul>
25
+ <% end %>
26
+ </li>
27
+ <% end %>
28
+ </ul>
@@ -0,0 +1,27 @@
1
+ <section class="params">
2
+ <h3>Parameters</h3>
3
+ <div class="table-responsive">
4
+ <table class="table table-bordered">
5
+ <tr>
6
+ <% param_headers(params).each do |title| %>
7
+ <th><%= title %></th>
8
+ <% end %>
9
+ </tr>
10
+ <% params.each do |param| %>
11
+ <tr>
12
+ <td class="name <%= param['required'] ? 'required' : '' %>">
13
+ <% if param['scope'] %>
14
+ <%= "#{param['scope']}[#{param['name']}]" %>
15
+ <% else %>
16
+ <%= param['name'] %>
17
+ <% end %>
18
+ </td>
19
+ <td class="description"><%= param['description'] %></td>
20
+ <% param_extras(params).each do |extra| %>
21
+ <td class="extra"><%= param[extra] %></td>
22
+ <% end %>
23
+ </tr>
24
+ <% end %>
25
+ </table>
26
+ </div>
27
+ </section>
@@ -0,0 +1,4 @@
1
+ <section class="query-parameters">
2
+ <h4>Query Parameters</h4>
3
+ <pre><%= request['request_query_parameters'].map{ |k,v| "#{k}=#{v}" }.join("\n") %></pre>
4
+ </section>
@@ -0,0 +1,4 @@
1
+ <section class="route">
2
+ <h4>Route</h4>
3
+ <pre><%= "#{request['request_method']} #{request['request_path']}" %></pre>
4
+ </section>
@@ -0,0 +1,4 @@
1
+ <section class="status">
2
+ <h4>Status</h4>
3
+ <pre><code class="http"><%= request['response_status'] %></code></pre>
4
+ </section>
@@ -0,0 +1,6 @@
1
+ <section class="readme" id="readme">
2
+ <article>
3
+ <%= raw formatted_readme %>
4
+ </article>
5
+ </section>
6
+ <%= render 'all_examples' if Apitome.configuration.single_page %>
@@ -0,0 +1 @@
1
+ <%= render 'example' %>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= Apitome.configuration.title %></title>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <%= stylesheet_link_tag Apitome.configuration.css_override || 'apitome/application', media: 'all' %>
7
+ <%= javascript_include_tag Apitome.configuration.js_override || 'apitome/application' %>
8
+ </head>
9
+ <body class="<%= Apitome.configuration.single_page ? 'single-page' : '' %>">
10
+
11
+ <div class="container">
12
+ <%= render 'header' %>
13
+ <div class="container docs-container">
14
+ <div class="row">
15
+ <div class="col-md-4">
16
+ <div id="sidebar" class="sidebar hidden-print" role="complementary">
17
+ <%= render 'navigation' %>
18
+ </div>
19
+ </div>
20
+ <div class="col-md-8" role="main">
21
+ <div class="docs-section">
22
+ <%= yield %>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+
29
+ </body>
30
+ </html>