padrino-apidoc 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccd35a498c1c7b20bc693cd15e2fe87b6d443226
4
- data.tar.gz: ec5d76af295e75e4863ac8108d320ab2174348ea
3
+ metadata.gz: 0acc216029e5da3a75ca42d7c8fa94caa6e88cd9
4
+ data.tar.gz: fbd304c036cb03a25c2356a26afdceb4259ccc90
5
5
  SHA512:
6
- metadata.gz: 5461b336311bf0724f462efcdbb5cc26e15e2ee612262bf084214eade50979d47bf9ab23357f7317bdcbd69f44d7163860250adfcd569c4da3616bfe65b953c5
7
- data.tar.gz: cc595dd0590572bc1916a1adb74dc5547618a0e9871a7195323d77f31b325d489a9e15fc802fa5cae702c9a2762d784269b002ff0a19ab9d2e98fc62f593510a
6
+ metadata.gz: 97702e848c83461eab93adc3a558af70ad6915b40357abcf9de8ccdaf7361171ebb25b25aadca0fb4cbc4b134051340925b9393a94056cf2cb8e645936b47bf5
7
+ data.tar.gz: 8d613215123b19d3d79c5b00a804079f2fae36957db298c7f746008d798a8b059825674360f7e7d26067c6fea051dec5a0e8e261d45125c7b0b8ffb0d3da2a77
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ *0.0.5* (February 19, 2014)
2
+
3
+ * Updated docs to reflect how to setup views
4
+ * updated midwire-common gem version
5
+
1
6
  *0.0.4* (December 31, 2013)
2
7
 
3
8
  * Fixed section rendering
data/README.md CHANGED
@@ -23,6 +23,10 @@ Or install it yourself as:
23
23
 
24
24
  ## Usage
25
25
 
26
+ ### Templates
27
+
28
+ Copy the 'views' directory in this gem to your PADRINO_ROOT/config directory. Feel free to edit the HAML view templates as you see fit.
29
+
26
30
  ### Documentation Syntax
27
31
 
28
32
  ## Section Name
@@ -48,10 +52,14 @@ Or install it yourself as:
48
52
  # "workers": 0
49
53
  # }
50
54
 
55
+ ### Mounting the Sub-App
56
+
51
57
  At the end of your config/apps.rb file:
52
58
 
53
59
  Padrino.mount('Padrino::Apidoc::App').to('/docs')
54
60
 
61
+ ### Viewing Docs
62
+
55
63
  Navigate to 'localhost:9292/docs' or whatever hostname/port you are running on.
56
64
 
57
65
  ## Contributing
@@ -1,5 +1,5 @@
1
1
  module Padrino
2
2
  module Apidoc
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "pry"
24
24
  spec.add_development_dependency "pry-nav"
25
- spec.add_development_dependency "midwire_common", '~> 0.1.6'
25
+ spec.add_development_dependency "midwire_common", '~> 0.1.7'
26
26
 
27
27
  spec.add_dependency 'padrino'
28
28
  end
data/views/docs.sass ADDED
@@ -0,0 +1,107 @@
1
+ *
2
+ :font-family Helvetica, Arial, sans-serif
3
+
4
+ =code_title
5
+ :display block
6
+ :padding 6px 10px
7
+ :font-weight bold
8
+ :background #ccc
9
+ :color #333
10
+ :margin-left -12px
11
+ :margin-right -12px
12
+ :margin-top -12px
13
+ :margin-bottom 12px
14
+
15
+ h2
16
+ :background #555
17
+ :color #fff
18
+ :border 1px #666 solid
19
+ :padding 10px
20
+ a
21
+ :color #fff
22
+ :text-decoration none
23
+
24
+ .api
25
+ :margin-bottom 24px
26
+ :background #eee
27
+ :border 1px #ccc solid
28
+
29
+ .url
30
+ :padding 6px 10px
31
+ :background #aaa
32
+ :border-bottom 1px #ccc solid
33
+ a
34
+ :color #333
35
+ :font-size 1.6em
36
+ :font-weight bold
37
+ :font-family monospace
38
+
39
+ .description
40
+ :padding 12px
41
+
42
+ code
43
+ :font-family Monaco, monospace
44
+ :white-space pre
45
+ :padding 12px
46
+ :display block
47
+ :overflow auto
48
+
49
+ .params
50
+ :margin-bottom 10px
51
+ :padding 12px
52
+ :display block
53
+ &:before
54
+ +code_title
55
+ :content "Parameters"
56
+ .param
57
+ :line-height 30px
58
+ .name
59
+ :display inline
60
+ :font-weight bold
61
+ :font-family monospace
62
+ :font-size 1.2em
63
+ .type
64
+ :font-weight bold
65
+ :font-size 0.6em
66
+ :color #999
67
+ :display inline-block
68
+ :width 65px
69
+ .required
70
+ :color #333
71
+ .description
72
+ :display inline
73
+
74
+ .request
75
+ &:before
76
+ +code_title
77
+ :content "Request"
78
+
79
+ .response
80
+ &:before
81
+ +code_title
82
+ :content "Response"
83
+
84
+ body
85
+ :margin 0
86
+
87
+ #content
88
+ :width 800px
89
+ :margin-left auto
90
+ :margin-right auto
91
+
92
+ #index
93
+ .section
94
+ :margin-bottom 20px
95
+ .summarydoc
96
+ :border 1px #ccc solid
97
+ :padding 12px
98
+ :margin-top 10px
99
+ :background #eee
100
+ .path
101
+ :margin-bottom 10px
102
+ a
103
+ :font-family monospace
104
+ :font-weight bold
105
+ :font-size 1.4em
106
+ .description
107
+ :color #666
data/views/index.haml ADDED
@@ -0,0 +1,13 @@
1
+ #index
2
+ - sections.each do |section|
3
+
4
+ .section
5
+ %h2
6
+ %a{ :href => "/docs/#{urlize_section(section)}" }= section
7
+
8
+ - docs_in_section(docs, urlize_section(section)).each_with_index do |method, index|
9
+ .summarydoc
10
+ .path
11
+ %a{ :href => "/docs/#{urlize_section(section)}##{index}" }
12
+ = "#{method[:verb].upcase} #{method[:uri]}"
13
+ .description= method[:description]
@@ -0,0 +1,16 @@
1
+ !!! 5
2
+
3
+ %html
4
+
5
+ %head
6
+ %title API Documentation
7
+ %link{ :rel => "stylesheet", :href => "/docs/docs.css" }
8
+
9
+ %body
10
+
11
+ #content
12
+
13
+ %h1
14
+ %a{ :href => '/docs' } API Documentation
15
+
16
+ = yield
@@ -0,0 +1,28 @@
1
+ %h2= section
2
+
3
+ - docs.each_with_index do |doc, index|
4
+
5
+ .api
6
+
7
+ .url
8
+ %a{ :name => index }
9
+ = doc[:verb].upcase
10
+ = doc[:uri]
11
+
12
+ .description
13
+ = doc[:description]
14
+
15
+ - if (doc[:params] || []).length > 0
16
+ .params
17
+ - doc[:params].each do |param|
18
+ .param
19
+ .type{ :class => (param[:required] && "required") }
20
+ = (param[:required]) ? "REQUIRED" : "OPTIONAL"
21
+ .name= escape_html(param[:name])
22
+ .description= param[:description]
23
+
24
+ %code.request
25
+ = code doc[:request]
26
+
27
+ %code.response
28
+ = code doc[:response]
data/views/toc.haml ADDED
@@ -0,0 +1,4 @@
1
+ %ul#toc
2
+
3
+ - sections.each do |section|
4
+ = doc urlize_section(section), section
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-apidoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Blackburn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-31 00:00:00.000000000 Z
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.6
75
+ version: 0.1.7
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: 0.1.6
82
+ version: 0.1.7
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: padrino
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -111,6 +111,11 @@ files:
111
111
  - lib/padrino/apidoc/parser.rb
112
112
  - lib/padrino/apidoc/version.rb
113
113
  - padrino-apidoc.gemspec
114
+ - views/docs.sass
115
+ - views/index.haml
116
+ - views/layouts/apidoc.haml
117
+ - views/section.haml
118
+ - views/toc.haml
114
119
  homepage: ''
115
120
  licenses:
116
121
  - MIT