diff --git a/index.html b/index.html index 44ddf67c..336c7428 100644 --- a/index.html +++ b/index.html @@ -108,69 +108,7 @@ - - - - - - - - - - - - +

Dox

JavaScript documentation parser for node. Check out the Github Repo for the source and installation guide.

utils

lib/utils.js
-

Check if the given string of docs appears to be private.

- -

- -
  • param: String str

  • return: Boolean

  • api: public

-
-
exports.isPrivate = function(str) {
-    return str.indexOf('@private') >= 0
-        || str.indexOf('@api private') >= 0;
-}
-
-

Convert the given string of jsdoc to markdown.

- -

- -
  • param: String str

  • return: String

  • api: public

-
-
exports.toMarkdown = function(str) {
-    var first = true;
-    return str
-        .replace(/^((?:[A-Z]\w* ?)+):/gm, '## $1')
-        .replace(/^ *@(\w+) *\{([^}]+)\}( *[^\n]+)?/gm, function(_, key, type, desc){
-            var prefix = '';
-            if (first) {
-                first = false;
-                prefix = '## \n';
-            }
-            return prefix + '\n - **' + key + '**: _' + type.split(/ *[|\/] */).join(' | ') + '_ ' + (desc || '') + '\n';
-        })
-        .replace(/^ *@(\w+) *(\w+)/gm, ' - **$1**: _$2_\n');
-}
-
-

Escape the given string of html.

- -

Examples

- -
escape('<foo>');
-// => "&lt;foo&gt;"
- -

- -
  • param: String html

  • return: String

  • api: public

-
-
exports.escape = function(html){
-    return String(html)
-        .replace(/&(?!\w+;)/g, '&')
-        .replace(/</g, '<')
-        .replace(/>/g, '>')
-        .replace(/"/g, '"');
-}
-

index

lib/index.js
+ + + + + + + + + + +

Dox

JavaScript documentation parser for node. Check out the Github Repo for the source and installation guide.

index

lib/index.js

Module dependencies.

@@ -375,8 +313,8 @@

sys.print('<tr><td><h1>' + title + '</h1>' + desc + '</td><td></td></tr>'); first = false; } - sys.print('<tr class="filename"><td><h2 id="' + file + '">' - + path.basename(file, '.js') + '</h2></td><td>' + sys.print('<tr class="filename"><td><h2 id="' + file + '"><a href="#">' + + path.basename(file, '.js') + '</a></h2></td><td>' + file + '</td></tr>'); sys.print(render(str, file)); --pending || sys.print(foot, '</tbody></table>'); @@ -442,5 +380,67 @@

return html.join('\n'); };

utils

lib/utils.js
+

Check if the given string of docs appears to be private.

+ +

+ +
  • param: String str

  • return: Boolean

  • api: public

+
+
exports.isPrivate = function(str) {
+    return str.indexOf('@private') &gt;= 0
+        || str.indexOf('@api private') &gt;= 0;
+}
+
+

Convert the given string of jsdoc to markdown.

+ +

+ +
  • param: String str

  • return: String

  • api: public

+
+
exports.toMarkdown = function(str) {
+    var first = true;
+    return str
+        .replace(/^((?:[A-Z]\w* ?)+):/gm, '## $1')
+        .replace(/^ *@(\w+) *\{([^}]+)\}( *[^\n]+)?/gm, function(_, key, type, desc){
+            var prefix = '';
+            if (first) {
+                first = false;
+                prefix = '## \n';
+            }
+            return prefix + '\n - **' + key + '**: _' + type.split(/ *[|\/] */).join(' | ') + '_ ' + (desc || '') + '\n';
+        })
+        .replace(/^ *@(\w+) *(\w+)/gm, ' - **$1**: _$2_\n');
+}
+
+

Escape the given string of html.

+ +

Examples

+ +
escape('<foo>');
+// => "&lt;foo&gt;"
+ +

+ +
  • param: String html

  • return: String

  • api: public

+
+
exports.escape = function(html){
+    return String(html)
+        .replace(/&(?!\w+;)/g, '&')
+        .replace(/</g, '<')
+        .replace(/>/g, '>')
+        .replace(/"/g, '"');
+}
+
\ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 59b49800..46c9d011 100644 --- a/lib/index.js +++ b/lib/index.js @@ -198,8 +198,8 @@ exports.parse = function(args){ sys.print('

' + title + '

' + desc + ''); first = false; } - sys.print('

' - + path.basename(file, '.js') + '

' + sys.print('

' + + path.basename(file, '.js') + '

' + file + ''); sys.print(render(str, file)); --pending || sys.print(foot, '');