spacedocs 0.0.2 → 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 (41) hide show
  1. data/README.md +6 -2
  2. data/{source → lib}/class.html.haml +1 -4
  3. data/{source → lib}/index.html.haml +2 -2
  4. data/{dox → lib/node_modules/dox}/History.md +0 -0
  5. data/{dox → lib/node_modules/dox}/Makefile +0 -0
  6. data/{dox → lib/node_modules/dox}/Readme.md +0 -0
  7. data/{dox → lib/node_modules/dox}/bin/dox +0 -0
  8. data/{dox → lib/node_modules/dox}/index.js +0 -0
  9. data/{dox → lib/node_modules/dox}/lib/dox.js +1 -10
  10. data/{dox → lib/node_modules/dox}/lib/utils.js +0 -0
  11. data/lib/node_modules/dox/node_modules/commander/History.md +99 -0
  12. data/lib/node_modules/dox/node_modules/commander/Makefile +7 -0
  13. data/lib/node_modules/dox/node_modules/commander/Readme.md +263 -0
  14. data/lib/node_modules/dox/node_modules/commander/index.js +2 -0
  15. data/lib/node_modules/dox/node_modules/commander/lib/commander.js +992 -0
  16. data/lib/node_modules/dox/node_modules/commander/package.json +38 -0
  17. data/lib/node_modules/dox/node_modules/github-flavored-markdown/README.md +17 -0
  18. data/lib/node_modules/dox/node_modules/github-flavored-markdown/_config.yml +3 -0
  19. data/lib/node_modules/dox/node_modules/github-flavored-markdown/_layouts/default.html +77 -0
  20. data/lib/node_modules/dox/node_modules/github-flavored-markdown/code.rb +67 -0
  21. data/lib/node_modules/dox/node_modules/github-flavored-markdown/images/gfm.png +0 -0
  22. data/lib/node_modules/dox/node_modules/github-flavored-markdown/index.md +78 -0
  23. data/lib/node_modules/dox/node_modules/github-flavored-markdown/package.json +27 -0
  24. data/lib/node_modules/dox/node_modules/github-flavored-markdown/preview.md +27 -0
  25. data/lib/node_modules/dox/node_modules/github-flavored-markdown/sample_content.html +169 -0
  26. data/lib/node_modules/dox/node_modules/github-flavored-markdown/scripts/preview.js +18 -0
  27. data/lib/node_modules/dox/node_modules/github-flavored-markdown/scripts/showdown.js +1414 -0
  28. data/lib/node_modules/dox/node_modules/github-flavored-markdown/stylesheets/screen.css +20 -0
  29. data/lib/node_modules/dox/package.json +43 -0
  30. data/lib/spacedocs.rb +42 -53
  31. data/lib/{assets/stylesheets/spacedocs/docs.css.sass → spacedocs.sass} +0 -0
  32. data/lib/spacedocs/version.rb +1 -1
  33. metadata +116 -25
  34. data/dox/package.json +0 -16
  35. data/dox/test/dox.test.js +0 -287
  36. data/dox/test/fixtures/a.js +0 -12
  37. data/dox/test/fixtures/b.js +0 -26
  38. data/dox/test/fixtures/c.js +0 -266
  39. data/dox/test/fixtures/d.js +0 -15
  40. data/dox/test/fixtures/titles.js +0 -14
  41. data/lib/spacedocs/engine.rb +0 -6
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Spacedocs
2
2
 
3
- TODO: Write a gem description
3
+ Generate beautiful html and css for your JavaDoc'd source code.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,11 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ `Spacedocs.doc(output_path, source_file)` generates html files at `output_path/docs` based on JavaDoc style comments from `source_file`
22
+
23
+ If you don't feel like writing your own css
24
+
25
+ `Spacedocs.generate_css(output_path)` generates a default stylesheet at `output_path/docs/stylesheets`
22
26
 
23
27
  ## Contributing
24
28
 
@@ -6,10 +6,7 @@
6
6
 
7
7
  %title= class_name
8
8
 
9
- - if dev
10
- %link(href="/stylesheets/spacedocs/docs.css" media="screen, projection" rel="stylesheet" type="text/css")
11
- - else
12
- %link(href="/assets/spacedocs/docs.css" media="screen, projection" rel="stylesheet" type="text/css")
9
+ %link(href="stylesheets/spacedocs.css" media="screen, projection" rel="stylesheet" type="text/css")
13
10
 
14
11
  %script(src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript")
15
12
  %body
@@ -6,11 +6,11 @@
6
6
 
7
7
  %title PixieEngine Documentation
8
8
 
9
- %link(href="/assets/spacedocs/docs.css" media="screen, projection" rel="stylesheet" type="text/css")
9
+ %link(href="stylesheets/spacedocs.css" media="screen, projection" rel="stylesheet" type="text/css")
10
10
  %body
11
11
  %pre
12
12
  %nav
13
13
  -class_names.each do |doc_class|
14
14
  - name = doc_class.gsub('#', '')
15
15
 
16
- %a(href="#{name}.html")= name
16
+ %a(href="#{name}.html")= name
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -22,8 +22,6 @@ exports.version = '0.3.1';
22
22
  */
23
23
 
24
24
  exports.parseComments = function(js, options){
25
- js = js.trim()
26
-
27
25
  options = options || {};
28
26
 
29
27
  var comments = []
@@ -32,8 +30,7 @@ exports.parseComments = function(js, options){
32
30
  , buf = ''
33
31
  , ignore
34
32
  , within
35
- , code
36
- , indent;
33
+ , code;
37
34
 
38
35
  for (var i = 0, len = js.length; i < len; ++i) {
39
36
  // start comment
@@ -53,12 +50,6 @@ exports.parseComments = function(js, options){
53
50
  // end comment
54
51
  } else if (within && '*' == js[i] && '/' == js[i+1]) {
55
52
  i += 2;
56
- lines = buf.split('\n');
57
-
58
- indentLevel = lines[lines.length - 1].length;
59
- indentRegex = new RegExp('^[ \\t]{' + indentLevel + '}', 'gm');
60
- buf = buf.replace(indentRegex, '');
61
-
62
53
  buf = buf.replace(/^[ \t]*\* ?/gm, '');
63
54
  var comment = exports.parseComment(buf, options);
64
55
  comment.ignore = ignore;
File without changes
@@ -0,0 +1,99 @@
1
+
2
+ 0.5.2 / 2012-01-17
3
+ ==================
4
+
5
+ * Added support for 0.7.x
6
+
7
+ 0.5.1 / 2011-12-20
8
+ ==================
9
+
10
+ * Fixed `password()` for recent nodes. Closes #36
11
+
12
+ 0.5.0 / 2011-12-04
13
+ ==================
14
+
15
+ * Added sub-command option support [itay]
16
+
17
+ 0.4.3 / 2011-12-04
18
+ ==================
19
+
20
+ * Fixed custom help ordering. Closes #32
21
+
22
+ 0.4.2 / 2011-11-24
23
+ ==================
24
+
25
+ * Added travis support
26
+ * Fixed: line-buffered input automatically trimmed. Closes #31
27
+
28
+ 0.4.1 / 2011-11-18
29
+ ==================
30
+
31
+ * Removed listening for "close" on --help
32
+
33
+ 0.4.0 / 2011-11-15
34
+ ==================
35
+
36
+ * Added support for `--`. Closes #24
37
+
38
+ 0.3.3 / 2011-11-14
39
+ ==================
40
+
41
+ * Fixed: wait for close event when writing help info [Jerry Hamlet]
42
+
43
+ 0.3.2 / 2011-11-01
44
+ ==================
45
+
46
+ * Fixed long flag definitions with values [felixge]
47
+
48
+ 0.3.1 / 2011-10-31
49
+ ==================
50
+
51
+ * Changed `--version` short flag to `-V` from `-v`
52
+ * Changed `.version()` so it's configurable [felixge]
53
+
54
+ 0.3.0 / 2011-10-31
55
+ ==================
56
+
57
+ * Added support for long flags only. Closes #18
58
+
59
+ 0.2.1 / 2011-10-24
60
+ ==================
61
+
62
+ * "node": ">= 0.4.x < 0.7.0". Closes #20
63
+
64
+ 0.2.0 / 2011-09-26
65
+ ==================
66
+
67
+ * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
68
+
69
+ 0.1.0 / 2011-08-24
70
+ ==================
71
+
72
+ * Added support for custom `--help` output
73
+
74
+ 0.0.5 / 2011-08-18
75
+ ==================
76
+
77
+ * Changed: when the user enters nothing prompt for password again
78
+ * Fixed issue with passwords beginning with numbers [NuckChorris]
79
+
80
+ 0.0.4 / 2011-08-15
81
+ ==================
82
+
83
+ * Fixed `Commander#args`
84
+
85
+ 0.0.3 / 2011-08-15
86
+ ==================
87
+
88
+ * Added default option value support
89
+
90
+ 0.0.2 / 2011-08-15
91
+ ==================
92
+
93
+ * Added mask support to `Command#password(str[, mask], fn)`
94
+ * Added `Command#password(str, fn)`
95
+
96
+ 0.0.1 / 2010-01-03
97
+ ==================
98
+
99
+ * Initial release
@@ -0,0 +1,7 @@
1
+
2
+ TESTS = $(shell find test/test.*.js)
3
+
4
+ test:
5
+ @./test/run $(TESTS)
6
+
7
+ .PHONY: test
@@ -0,0 +1,263 @@
1
+
2
+ # Commander.js
3
+
4
+ The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).
5
+
6
+ [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)
7
+
8
+ ## Installation
9
+
10
+ $ npm install commander
11
+
12
+ ## Option parsing
13
+
14
+ Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
15
+
16
+ ```js
17
+ #!/usr/bin/env node
18
+
19
+ /**
20
+ * Module dependencies.
21
+ */
22
+
23
+ var program = require('commander');
24
+
25
+ program
26
+ .version('0.0.1')
27
+ .option('-p, --peppers', 'Add peppers')
28
+ .option('-P, --pineapple', 'Add pineapple')
29
+ .option('-b, --bbq', 'Add bbq sauce')
30
+ .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
31
+ .parse(process.argv);
32
+
33
+ console.log('you ordered a pizza with:');
34
+ if (program.peppers) console.log(' - peppers');
35
+ if (program.pineapple) console.log(' - pineappe');
36
+ if (program.bbq) console.log(' - bbq');
37
+ console.log(' - %s cheese', program.cheese);
38
+ ```
39
+
40
+ Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
41
+
42
+ ## Automated --help
43
+
44
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
45
+
46
+ ```
47
+ $ ./examples/pizza --help
48
+
49
+ Usage: pizza [options]
50
+
51
+ Options:
52
+
53
+ -v, --version output the version number
54
+ -p, --peppers Add peppers
55
+ -P, --pineapple Add pineappe
56
+ -b, --bbq Add bbq sauce
57
+ -c, --cheese <type> Add the specified type of cheese [marble]
58
+ -h, --help output usage information
59
+
60
+ ```
61
+
62
+ ## Coercion
63
+
64
+ ```js
65
+ function range(val) {
66
+ return val.split('..').map(Number);
67
+ }
68
+
69
+ function list(val) {
70
+ return val.split(',');
71
+ }
72
+
73
+ program
74
+ .version('0.0.1')
75
+ .usage('[options] <file ...>')
76
+ .option('-i, --integer <n>', 'An integer argument', parseInt)
77
+ .option('-f, --float <n>', 'A float argument', parseFloat)
78
+ .option('-r, --range <a>..<b>', 'A range', range)
79
+ .option('-l, --list <items>', 'A list', list)
80
+ .option('-o, --optional [value]', 'An optional value')
81
+ .parse(process.argv);
82
+
83
+ console.log(' int: %j', program.integer);
84
+ console.log(' float: %j', program.float);
85
+ console.log(' optional: %j', program.optional);
86
+ program.range = program.range || [];
87
+ console.log(' range: %j..%j', program.range[0], program.range[1]);
88
+ console.log(' list: %j', program.list);
89
+ console.log(' args: %j', program.args);
90
+ ```
91
+
92
+ ## Custom help
93
+
94
+ You can display arbitrary `-h, --help` information
95
+ by listening for "--help". Commander will automatically
96
+ exit once you are done so that the remainder of your program
97
+ does not execute causing undesired behaviours, for example
98
+ in the following executable "stuff" will not output when
99
+ `--help` is used.
100
+
101
+ ```js
102
+ #!/usr/bin/env node
103
+
104
+ /**
105
+ * Module dependencies.
106
+ */
107
+
108
+ var program = require('../');
109
+
110
+ function list(val) {
111
+ return val.split(',').map(Number);
112
+ }
113
+
114
+ program
115
+ .version('0.0.1')
116
+ .option('-f, --foo', 'enable some foo')
117
+ .option('-b, --bar', 'enable some bar')
118
+ .option('-B, --baz', 'enable some baz');
119
+
120
+ // must be before .parse() since
121
+ // node's emit() is immediate
122
+
123
+ program.on('--help', function(){
124
+ console.log(' Examples:');
125
+ console.log('');
126
+ console.log(' $ custom-help --help');
127
+ console.log(' $ custom-help -h');
128
+ console.log('');
129
+ });
130
+
131
+ program.parse(process.argv);
132
+
133
+ console.log('stuff');
134
+ ```
135
+
136
+ yielding the following help output:
137
+
138
+ ```
139
+
140
+ Usage: custom-help [options]
141
+
142
+ Options:
143
+
144
+ -h, --help output usage information
145
+ -v, --version output the version number
146
+ -f, --foo enable some foo
147
+ -b, --bar enable some bar
148
+ -B, --baz enable some baz
149
+
150
+ Examples:
151
+
152
+ $ custom-help --help
153
+ $ custom-help -h
154
+
155
+ ```
156
+
157
+ ## .prompt(msg, fn)
158
+
159
+ Single-line prompt:
160
+
161
+ ```js
162
+ program.prompt('name: ', function(name){
163
+ console.log('hi %s', name);
164
+ });
165
+ ```
166
+
167
+ Multi-line prompt:
168
+
169
+ ```js
170
+ program.prompt('description:', function(name){
171
+ console.log('hi %s', name);
172
+ });
173
+ ```
174
+
175
+ Coercion:
176
+
177
+ ```js
178
+ program.prompt('Age: ', Number, function(age){
179
+ console.log('age: %j', age);
180
+ });
181
+ ```
182
+
183
+ ```js
184
+ program.prompt('Birthdate: ', Date, function(date){
185
+ console.log('date: %s', date);
186
+ });
187
+ ```
188
+
189
+ ## .password(msg[, mask], fn)
190
+
191
+ Prompt for password without echoing:
192
+
193
+ ```js
194
+ program.password('Password: ', function(pass){
195
+ console.log('got "%s"', pass);
196
+ process.stdin.destroy();
197
+ });
198
+ ```
199
+
200
+ Prompt for password with mask char "*":
201
+
202
+ ```js
203
+ program.password('Password: ', '*', function(pass){
204
+ console.log('got "%s"', pass);
205
+ process.stdin.destroy();
206
+ });
207
+ ```
208
+
209
+ ## .confirm(msg, fn)
210
+
211
+ Confirm with the given `msg`:
212
+
213
+ ```js
214
+ program.confirm('continue? ', function(ok){
215
+ console.log(' got %j', ok);
216
+ });
217
+ ```
218
+
219
+ ## .choose(list, fn)
220
+
221
+ Let the user choose from a `list`:
222
+
223
+ ```js
224
+ var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
225
+
226
+ console.log('Choose the coolest pet:');
227
+ program.choose(list, function(i){
228
+ console.log('you chose %d "%s"', i, list[i]);
229
+ });
230
+ ```
231
+
232
+ ## Links
233
+
234
+ - [API documentation](http://visionmedia.github.com/commander.js/)
235
+ - [ascii tables](https://github.com/LearnBoost/cli-table)
236
+ - [progress bars](https://github.com/visionmedia/node-progress)
237
+ - [more progress bars](https://github.com/substack/node-multimeter)
238
+ - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)
239
+
240
+ ## License
241
+
242
+ (The MIT License)
243
+
244
+ Copyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
245
+
246
+ Permission is hereby granted, free of charge, to any person obtaining
247
+ a copy of this software and associated documentation files (the
248
+ 'Software'), to deal in the Software without restriction, including
249
+ without limitation the rights to use, copy, modify, merge, publish,
250
+ distribute, sublicense, and/or sell copies of the Software, and to
251
+ permit persons to whom the Software is furnished to do so, subject to
252
+ the following conditions:
253
+
254
+ The above copyright notice and this permission notice shall be
255
+ included in all copies or substantial portions of the Software.
256
+
257
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
258
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
259
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
260
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
261
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
262
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
263
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.