doc_to_dash 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.
- data/.gitignore +2 -1
- data/README.md +9 -5
- data/default_icon.png +0 -0
- data/lib/doc_to_dash.rb +6 -2
- data/lib/doc_to_dash/version.rb +1 -1
- data/lib/doc_to_dash/yard_parser.rb +5 -4
- metadata +3 -2
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# DocToDash
|
2
2
|
|
3
|
-
DocToDash converts documentation files (
|
3
|
+
DocToDash converts documentation files (Rdoc Darkfish / YARD) into a classes and methods docset that can then be loaded into the docset viewing program: Dash.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -42,9 +42,9 @@ Or install it yourself as:
|
|
42
42
|
|
43
43
|
<tr>
|
44
44
|
<td>:icon_path</td>
|
45
|
-
<td
|
45
|
+
<td>../default_icon.png</td>
|
46
46
|
<td>The icon file that will be put in the docset. Shown in Dash.</td>
|
47
|
-
<td>No</td>
|
47
|
+
<td>No (can be nil, will not transfer default_icon.png)</td>
|
48
48
|
</tr>
|
49
49
|
|
50
50
|
<tr>
|
@@ -71,14 +71,14 @@ Or install it yourself as:
|
|
71
71
|
<tr>
|
72
72
|
<td>:parser</td>
|
73
73
|
<td>DocToDash::YardParser</td>
|
74
|
-
<td>Parser to use to pull out classes and modules.
|
74
|
+
<td>Parser to use to pull out classes and modules. DocToDash::YardParser / DocToDash::RdocDarkfishParser.</td>
|
75
75
|
<td>Yes</td>
|
76
76
|
</tr>
|
77
77
|
</table>
|
78
78
|
|
79
79
|
## Usage
|
80
80
|
|
81
|
-
Generate YARD documentation (or
|
81
|
+
Generate YARD documentation (or darkfish rdoc). This below will output your Rails application's YARD documentation to doc/yard:
|
82
82
|
|
83
83
|
$ yardoc app/**/*.rb lib/**/*.rb --protected --private --embed-mixins --output-dir doc/yard/
|
84
84
|
|
@@ -103,3 +103,7 @@ This will create a docset in the docset_output_path then you just need to load t
|
|
103
103
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
104
104
|
4. Push to the branch (`git push origin my-new-feature`)
|
105
105
|
5. Create new Pull Request
|
106
|
+
|
107
|
+
## Thanks
|
108
|
+
|
109
|
+
Default Icon: Crash Test Dummy designed by Luis Prado from The Noun Project
|
data/default_icon.png
ADDED
Binary file
|
data/lib/doc_to_dash.rb
CHANGED
@@ -14,7 +14,7 @@ module DocToDash
|
|
14
14
|
:docset_name => 'DefaultDocset',
|
15
15
|
:docset_output_path => 'doc/', # This is where the actual package will be created.
|
16
16
|
:docset_output_filename => lambda {@options[:docset_name] + '.docset' },
|
17
|
-
:icon_path =>
|
17
|
+
:icon_path => File.expand_path(File.expand_path(File.dirname(__FILE__)) + '/../default_icon.png'), # This is the docset icon that never changes, if you want a default icon just set this to nil.
|
18
18
|
:doc_input_path => nil, # This is the actual docs to copy over to the Docset.
|
19
19
|
:doc_save_folder => 'docs', # This is the directory name it will store under /Contents/Resources/Documents/{this}
|
20
20
|
:verbose => true,
|
@@ -94,7 +94,11 @@ module DocToDash
|
|
94
94
|
def copy_default_files
|
95
95
|
log "Copy default Docset files over."
|
96
96
|
|
97
|
-
|
97
|
+
unless @options[:icon_path].nil?
|
98
|
+
FileUtils.cp @options[:icon_path], @docset_path + '/'
|
99
|
+
FileUtils.mv @docset_path + '/' + File.basename(@options[:icon_path]), @docset_path + '/icon.png'
|
100
|
+
end
|
101
|
+
|
98
102
|
File.open(@docset_path + '/Contents/Info.plist', 'w+') { |file| file.write(default_plist.gsub('{DOCSET_NAME}', @options[:docset_name])) }
|
99
103
|
end
|
100
104
|
|
data/lib/doc_to_dash/version.rb
CHANGED
@@ -2,12 +2,13 @@ module DocToDash
|
|
2
2
|
class YardParser
|
3
3
|
def initialize(doc_directory)
|
4
4
|
@doc_directory = doc_directory
|
5
|
+
|
6
|
+
fix_css_file
|
5
7
|
end
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#end
|
9
|
+
def fix_css_file
|
10
|
+
File.open(@doc_directory + '/css/style.css', 'a') { |file| file.write('#header, .showSource, .inheritanceTree, .inheritName, h2 small { display: none; } .source_code, .fullTree { display: block !important; }') }
|
11
|
+
end
|
11
12
|
|
12
13
|
def parse_classes
|
13
14
|
classes_file = File.read(@doc_directory + '/class_list.html')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doc_to_dash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- README.md
|
58
58
|
- Rakefile
|
59
59
|
- bin/doc_to_dash
|
60
|
+
- default_icon.png
|
60
61
|
- doc_to_dash.gemspec
|
61
62
|
- lib/doc_to_dash.rb
|
62
63
|
- lib/doc_to_dash/rdoc_darkfish_parser.rb
|