Permalink
Browse files

initial commit

  • Loading branch information...
1 parent 9f1cc62 commit 6510d4bbbab5a7bce98ea1384ad2b7d6f0fb511f @dvv dvv committed Nov 20, 2011
Showing with 8,461 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +3 −0 .npmignore
  3. +4 −0 HISTORY.md
  4. +21 −0 LICENSE
  5. +0 −1 README
  6. +19 −0 README.md
  7. +2 −0 TODO
  8. +78 −0 bin/ndoc
  9. +278 −0 lib/index.js
  10. +641 −0 lib/parser.js
  11. +390 −0 lib/parser.y
  12. +37 −0 lib/util.js
  13. +23 −0 package.json
  14. BIN skeleton/images/alias.png
  15. BIN skeleton/images/class.png
  16. BIN skeleton/images/class_deprecated.png
  17. BIN skeleton/images/class_method.png
  18. BIN skeleton/images/class_property.png
  19. BIN skeleton/images/constant.png
  20. BIN skeleton/images/constructor.png
  21. BIN skeleton/images/deprecated.png
  22. BIN skeleton/images/description.png
  23. BIN skeleton/images/information.png
  24. BIN skeleton/images/instance_method.png
  25. BIN skeleton/images/instance_property.png
  26. BIN skeleton/images/method.png
  27. BIN skeleton/images/method_deprecated.png
  28. BIN skeleton/images/mixin.png
  29. BIN skeleton/images/namespace.png
  30. BIN skeleton/images/property.png
  31. BIN skeleton/images/related_to.png
  32. BIN skeleton/images/search-background.png
  33. BIN skeleton/images/section-background.png
  34. BIN skeleton/images/section.png
  35. BIN skeleton/images/selected-section-background.png
  36. BIN skeleton/images/subclass.png
  37. BIN skeleton/images/superclass.png
  38. BIN skeleton/images/utility.png
  39. +478 −0 skeleton/javascripts/application.js
  40. +4,874 −0 skeleton/javascripts/prototype.js
  41. +506 −0 skeleton/javascripts/tabs.js
  42. +681 −0 skeleton/stylesheets/api.css
  43. +121 −0 skeleton/stylesheets/syntax.css
  44. +8 −0 templates/class.jade
  45. +24 −0 templates/class_relationships.jade
  46. +6 −0 templates/classes.jade
  47. +7 −0 templates/constructor.jade
  48. +5 −0 templates/description.jade
  49. +62 −0 templates/layout.jade
  50. +10 −0 templates/leaf.jade
  51. +57 −0 templates/lib.jade
  52. +10 −0 templates/members.jade
  53. +33 −0 templates/method_signatures.jade
  54. +11 −0 templates/methodized_note.jade
  55. +8 −0 templates/mixin.jade
  56. +6 −0 templates/mixins.jade
  57. +8 −0 templates/namespace.jade
  58. +6 −0 templates/namespaces.jade
  59. +7 −0 templates/related_utilities.jade
  60. +15 −0 templates/relationships.jade
  61. +20 −0 templates/title.jade
View
@@ -0,0 +1,2 @@
+node_modules
+docs
View
@@ -0,0 +1,3 @@
+node_modules
+Makefile
+make.js
View
@@ -0,0 +1,4 @@
+0.0.1 / 2011-11-20
+---------
+
+* First public release
View
21 LICENSE
@@ -0,0 +1,21 @@
+(The MIT License)
+
+Copyright (C) 2011 by Vitaly Puzrin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
1 README
@@ -1 +0,0 @@
-node.js enchanged clone of pdoc
View
@@ -0,0 +1,19 @@
+
+# JavaScript PDoc parser
+
+An attempt to parse [PDoc](http://pdoc.org/syntax.html) with [node.js](http://nodejs.org)
+
+## How to Install
+
+Clone and have fun
+
+## How to use
+
+Go to your project's root directory and run
+
+ ndoc
+ open file://./docs/index.html
+
+## License
+
+[MIT](https://github.com/nodeca/ndoc/blob/master/LICENSE)
View
2 TODO
@@ -0,0 +1,2 @@
+* get rid of prototype.js et al., jquery will do
+* elaborate robuster highlighter
View
@@ -0,0 +1,78 @@
+#!/usr/bin/env node
+'use strict';
+
+var program = require('commander');
+var exec = require('child_process').exec;
+var Util = require('../lib/util');
+var NDoc = require('../lib');
+
+//
+// parse options
+//
+program
+// .version('0.0.1')
+ .option('-s, --source <source>', 'find-compatible pattern to find source files', 'lib')
+ .option('-o, --output <destination>', 'Where to put resulting file(s)', 'docs')
+ .option('-f, --format <format>', 'Output format [html]', 'html')
+ .option('--src_code_text <link>', 'Text for "View source"', 'View source on GitHub &rarr;')
+ .option('-a, --src_code_href <src_code_href>', 'URL of source files root', 'http://localhost/')
+ .option('-i, --index_page <index>', 'Index file name', 'README.md')
+ .option('-t, --title <title>', 'Project title', '')
+ .option('-n, --name <name>', 'Project name')
+ .option('-v, --version <version>', 'Project version')
+ .option('--template <template_root>', 'Root of custom templates', __dirname + '/../templates')
+ .parse(process.argv);
+//console.log(program); process.exit(0);
+
+//
+// collect sources
+//
+var files = [];
+Util.walk(program.source, '\.js$', function(filename, stat, cb) {
+ //console.log('Processing', filename);
+ files.push(filename);
+ cb();
+}, function(err) {
+ if (err) {
+ console.error(err);
+ process.exit(1);
+ }
+ // build tree
+ var ndoc = new NDoc(files, {
+ root: program.source,
+ href: program.src_code_href
+ });
+ //console.log(ndoc.toJSON());
+
+ // output tree
+ var output = program.output;
+ switch (program.format) {
+
+ case 'json':
+ write(output, ndoc.toJSON());
+ break;
+
+ case 'html':
+ Util.remove(output, function(err) {
+ if (err) {
+ console.error(err);
+ process.exit(1);
+ }
+ exec('cp -a "' + __dirname + '/../skeleton" ' + output, function(err, stdout, stderr) {
+ //Util.copy(__dirname + '/../skeleton', output, function(err) {
+ if (err) {
+ console.error(err);
+ process.exit(1);
+ }
+ var html = ndoc.toHTML(program);
+ Util.write(output + '/index.html', html);
+ });
+ });
+ break;
+
+ default:
+ console.error(program.format + ': not supported')
+ process.exit(1);
+
+ }
+});
Oops, something went wrong.

0 comments on commit 6510d4b

Please sign in to comment.