double_doc 1.0.5 → 1.0.6
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.
- data/README.md +3 -3
- data/lib/double_doc/html_generator.rb +2 -2
- data/lib/double_doc/task.rb +26 -40
- data/lib/double_doc/version.rb +1 -1
- metadata +109 -72
data/README.md
CHANGED
@@ -90,16 +90,16 @@ The available options are:
|
|
90
90
|
| __html_css__ | You can use your own custom CSS document by specifying it's path here.
|
91
91
|
| __title__ | The title you want in the generated HTML. Defaults to "Documentation".
|
92
92
|
|
93
|
-
If you just want to use double doc to generate your
|
93
|
+
If you just want to use double doc to generate your README.md for github, you should write your documentation in doc/README.md and put his in your Rakefile:
|
94
94
|
|
95
95
|
```ruby
|
96
96
|
require 'double_doc'
|
97
97
|
|
98
|
-
DoubleDoc::Task.new(:doc, :sources => 'doc/
|
98
|
+
DoubleDoc::Task.new(:doc, :sources => 'doc/README.md', :md_destination => '.')
|
99
99
|
```
|
100
100
|
Then all you have to do is to run `rake doc`, and you will have a `readme.md` in the root of your project.
|
101
101
|
|
102
|
-
|
102
|
+
If you have a gh-pages branch set up in your repository, you can event run `rake doc:publish` to generate html documentation and push it to your github pages.
|
103
103
|
|
104
104
|
### Notes
|
105
105
|
DoubleDoc is tested as working on both ruby 1.8.7 and 1.9.3, but does not work on jruby because if it's dependency on redcarpet.
|
@@ -64,7 +64,7 @@ module DoubleDoc
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def copy_assets
|
67
|
-
if @
|
67
|
+
if @stylesheet == 'screen.css'
|
68
68
|
FileUtils.cp(File.expand_path("../../templates/screen.css", File.dirname(__FILE__)), @output_directory)
|
69
69
|
end
|
70
70
|
end
|
@@ -100,4 +100,4 @@ module DoubleDoc
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
end
|
103
|
+
end
|
data/lib/double_doc/task.rb
CHANGED
@@ -31,16 +31,16 @@ module DoubleDoc
|
|
31
31
|
## | __html_css__ | You can use your own custom CSS document by specifying it's path here.
|
32
32
|
## | __title__ | The title you want in the generated HTML. Defaults to "Documentation".
|
33
33
|
##
|
34
|
-
## If you just want to use double doc to generate your
|
34
|
+
## If you just want to use double doc to generate your README.md for github, you should write your documentation in doc/README.md and put his in your Rakefile:
|
35
35
|
##
|
36
36
|
## ```ruby
|
37
37
|
## require 'double_doc'
|
38
38
|
##
|
39
|
-
## DoubleDoc::Task.new(:doc, :sources => 'doc/
|
39
|
+
## DoubleDoc::Task.new(:doc, :sources => 'doc/README.md', :md_destination => '.')
|
40
40
|
## ```
|
41
41
|
## Then all you have to do is to run `rake doc`, and you will have a `readme.md` in the root of your project.
|
42
42
|
##
|
43
|
-
##
|
43
|
+
## If you have a gh-pages branch set up in your repository, you can event run `rake doc:publish` to generate html documentation and push it to your github pages.
|
44
44
|
class Task
|
45
45
|
include Rake::DSL if defined?(Rake::DSL)
|
46
46
|
|
@@ -73,52 +73,38 @@ module DoubleDoc
|
|
73
73
|
|
74
74
|
end
|
75
75
|
|
76
|
-
|
76
|
+
has_github_pages = !`git branch | grep 'gh-pages'`.empty? rescue false
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
78
|
+
if has_github_pages
|
79
|
+
namespace(task_name) do
|
80
|
+
desc "Publish DoubleDoc documentation to Github Pages"
|
81
|
+
task :publish do
|
82
|
+
git_clean = `git status -s`.empty? rescue false
|
83
|
+
raise "Your local git repository needs to be clean for this task to run" unless git_clean
|
82
84
|
|
83
|
-
|
85
|
+
git_branch = `git branch | grep "*"`.match(/\* (.*)/)[1] rescue 'master'
|
84
86
|
|
85
|
-
|
86
|
-
|
87
|
-
|
87
|
+
Dir.mktmpdir do |dir|
|
88
|
+
generate_task.execute(:html_destination => dir)
|
89
|
+
html_files = Dir.glob(Pathname.new(dir) + '*.html')
|
88
90
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
has_github_pages = !`git branch | grep 'gh-pages'`.empty? rescue false
|
93
|
-
|
94
|
-
unless has_github_pages
|
95
|
-
puts "Setting up gh-pages branch"
|
96
|
-
|
97
|
-
`git symbolic-ref HEAD refs/heads/gh-pages`
|
98
|
-
`rm .git/index`
|
99
|
-
`git clean -fdx`
|
100
|
-
else
|
91
|
+
`git add .`
|
92
|
+
`git commit -m 'Updated documentation'`
|
101
93
|
`git checkout gh-pages`
|
102
94
|
`git pull origin gh-pages`
|
95
|
+
`cp #{dir}/* .`
|
96
|
+
if html_files.size == 1
|
97
|
+
`cp #{html_files[0]} index.html`
|
98
|
+
else
|
99
|
+
warn("You should probably generate an index.html")
|
100
|
+
end
|
101
|
+
`git add .`
|
102
|
+
`git commit -m 'Updated Github Pages'`
|
103
|
+
`git push origin gh-pages`
|
104
|
+
`git co #{git_branch}`
|
103
105
|
end
|
104
|
-
|
105
|
-
puts "Publishing your Github Pages"
|
106
|
-
`cp #{dir}/* .`
|
107
|
-
if html_files.size == 1
|
108
|
-
`cp #{html_files[0]} index.html`
|
109
|
-
else
|
110
|
-
warn("You should probably generate an index.html")
|
111
|
-
end
|
112
|
-
|
113
|
-
`git add .`
|
114
|
-
`git commit -m 'Updated Github Pages'`
|
115
|
-
`git push origin gh-pages`
|
116
|
-
`git co #{git_branch}`
|
117
|
-
|
118
|
-
puts "Your Github Pages has been published. You will receive an email from Github when they are online."
|
119
106
|
end
|
120
107
|
end
|
121
|
-
|
122
108
|
end
|
123
109
|
end
|
124
110
|
|
data/lib/double_doc/version.rb
CHANGED
metadata
CHANGED
@@ -1,90 +1,118 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: double_doc
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 6
|
10
|
+
version: 1.0.6
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Mick Staugaard
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2012-02-27 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
22
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
prerelease: false
|
31
|
+
requirement: *id001
|
22
32
|
type: :development
|
33
|
+
name: guard
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
hash: 3
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
23
44
|
prerelease: false
|
24
|
-
|
25
|
-
|
45
|
+
requirement: *id002
|
46
|
+
type: :development
|
26
47
|
name: minitest
|
27
|
-
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
28
50
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
33
|
-
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
version: "0"
|
34
58
|
prerelease: false
|
35
|
-
|
36
|
-
|
59
|
+
requirement: *id003
|
60
|
+
type: :runtime
|
37
61
|
name: rake
|
38
|
-
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
39
64
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
hash: 3
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
version: "0"
|
45
72
|
prerelease: false
|
46
|
-
|
47
|
-
|
73
|
+
requirement: *id004
|
74
|
+
type: :runtime
|
48
75
|
name: erubis
|
49
|
-
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
50
78
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 1
|
83
|
+
segments:
|
84
|
+
- 2
|
85
|
+
- 1
|
86
|
+
version: "2.1"
|
56
87
|
prerelease: false
|
57
|
-
|
58
|
-
|
88
|
+
requirement: *id005
|
89
|
+
type: :runtime
|
59
90
|
name: redcarpet
|
60
|
-
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
61
93
|
none: false
|
62
|
-
requirements:
|
94
|
+
requirements:
|
63
95
|
- - ~>
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
66
|
-
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
hash: 15
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
- 2
|
101
|
+
version: "0.2"
|
67
102
|
prerelease: false
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pygments.rb
|
71
|
-
requirement: &70134689087460 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
|
-
requirements:
|
74
|
-
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0.2'
|
103
|
+
requirement: *id006
|
77
104
|
type: :runtime
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
for your code
|
82
|
-
email:
|
105
|
+
name: pygments.rb
|
106
|
+
description: A simple framework for writing and generating beautiful documentation for your code
|
107
|
+
email:
|
83
108
|
- mick@staugaard.com
|
84
109
|
executables: []
|
110
|
+
|
85
111
|
extensions: []
|
112
|
+
|
86
113
|
extra_rdoc_files: []
|
87
|
-
|
114
|
+
|
115
|
+
files:
|
88
116
|
- lib/double_doc/doc_extractor.rb
|
89
117
|
- lib/double_doc/html_generator.rb
|
90
118
|
- lib/double_doc/html_renderer.rb
|
@@ -101,28 +129,37 @@ files:
|
|
101
129
|
- test/test_helper.rb
|
102
130
|
homepage: http://staugaard.github.com/double_doc
|
103
131
|
licenses: []
|
132
|
+
|
104
133
|
post_install_message:
|
105
134
|
rdoc_options: []
|
106
|
-
|
135
|
+
|
136
|
+
require_paths:
|
107
137
|
- lib
|
108
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
139
|
none: false
|
110
|
-
requirements:
|
111
|
-
- -
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
|
114
|
-
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
hash: 3
|
144
|
+
segments:
|
145
|
+
- 0
|
146
|
+
version: "0"
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
148
|
none: false
|
116
|
-
requirements:
|
117
|
-
- -
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
hash: 3
|
153
|
+
segments:
|
154
|
+
- 0
|
155
|
+
version: "0"
|
120
156
|
requirements: []
|
157
|
+
|
121
158
|
rubyforge_project:
|
122
|
-
rubygems_version: 1.8.
|
159
|
+
rubygems_version: 1.8.15
|
123
160
|
signing_key:
|
124
161
|
specification_version: 3
|
125
162
|
summary: Documentation right where you want it
|
126
|
-
test_files:
|
163
|
+
test_files:
|
127
164
|
- test/doc_extractor_test.rb
|
128
165
|
- test/test_helper.rb
|