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 +4 -4
- data/CHANGELOG +5 -0
- data/README.md +8 -0
- data/lib/padrino/apidoc/version.rb +1 -1
- data/padrino-apidoc.gemspec +1 -1
- data/views/docs.sass +107 -0
- data/views/index.haml +13 -0
- data/views/layouts/apidoc.haml +16 -0
- data/views/section.haml +28 -0
- data/views/toc.haml +4 -0
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0acc216029e5da3a75ca42d7c8fa94caa6e88cd9
|
4
|
+
data.tar.gz: fbd304c036cb03a25c2356a26afdceb4259ccc90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97702e848c83461eab93adc3a558af70ad6915b40357abcf9de8ccdaf7361171ebb25b25aadca0fb4cbc4b134051340925b9393a94056cf2cb8e645936b47bf5
|
7
|
+
data.tar.gz: 8d613215123b19d3d79c5b00a804079f2fae36957db298c7f746008d798a8b059825674360f7e7d26067c6fea051dec5a0e8e261d45125c7b0b8ffb0d3da2a77
|
data/CHANGELOG
CHANGED
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
|
data/padrino-apidoc.gemspec
CHANGED
@@ -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.
|
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]
|
data/views/section.haml
ADDED
@@ -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
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
|
+
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:
|
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.
|
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.
|
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
|