Skip to content
This repository was archived by the owner on May 11, 2021. It is now read-only.

Commit 26b217e

Browse files
committed
Build v0.4.4
1 parent 9d2e275 commit 26b217e

File tree

4 files changed

+29
-21
lines changed

4 files changed

+29
-21
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# v0.4.4 (2014/04/30)
2+
- Fixed not able to parse js block comment symbol

chalkboard.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/*
23
@chalk overview
34
@name Chalkboard.js
@@ -20,28 +21,28 @@ An npm package that generate better documentation
2021
2122
@example
2223
```
23-
#
24-
# @chalk overview
25-
# @name example
26-
# @description
27-
# This is an example description for an example in readme.
28-
# @param {String} name Just a random name
29-
# @param {Boolean} work Does this actually work?
30-
# @returns {String} Just another value
31-
#
24+
*
25+
* @chalk overview
26+
* @name example
27+
* @description
28+
* This is an example description for an example in readme.
29+
* @param {String} name Just a random name
30+
* @param {Boolean} work Does this actually work?
31+
* @returns {String} Just another value
32+
*
3233
```
3334
3435
@TODO
3536
[TODO Wiki](https://github.com/adrianlee44/chalkboard/wiki/TODO)
36-
*/
37+
*/
3738

3839

3940
/*
4041
@chalk overview
4142
@name Supported Tags
4243
@description
4344
[Wiki Page](https://github.com/adrianlee44/chalkboard/wiki/Supported-Tags)
44-
*/
45+
*/
4546

4647

4748
/*
@@ -54,7 +55,7 @@ To do so, install the module with:
5455
```
5556
npm install -g chalkboard
5657
```
57-
*/
58+
*/
5859

5960

6061
/*
@@ -70,8 +71,7 @@ npm install -g chalkboard
7071
-f, --format [TYPE] Output format. Default to markdown
7172
-p, --private Parse comments for private functions and varibles
7273
-h, --header Only parse the first comment block
73-
*/
74-
74+
*/
7575

7676
(function() {
7777
var NEW_LINE, chalkboard, commentRegex, compile, configure, cwd, defaults, definitions, format, languages, lib, packages, parse, pkg, processFiles, requirePkg, util, write, _, _i, _len;

lib/util.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121
}
2222
return str[0].toUpperCase() + str.slice(1);
2323
},
24+
escape: function(text) {
25+
return text.replace(/[-[\]{}()*+?.,\\\/^$|#\s]/g, "\\$&");
26+
},
2427
repeatChar: function(char, count) {
2528
if (count == null) {
2629
count = 0;
2730
}
2831
return Array(count + 1).join(char);
2932
},
3033
getLanguages: function(source, options) {
31-
var ext, lang, regex;
34+
var ext, lang, regex, symbol;
3235
if (options == null) {
3336
options = {};
3437
}
@@ -37,15 +40,18 @@
3740
if (lang == null) {
3841
return null;
3942
}
40-
regex = "^\\s*(?:" + lang.symbol + "){1,2}" + commentRegexStr;
43+
symbol = util.escape(lang.symbol);
44+
regex = "^\\s*(?:" + symbol + "){1,2}" + commentRegexStr;
4145
lang.commentRegex = new RegExp(regex);
42-
lang.lineRegex = new RegExp("^\\s*(?:" + lang.symbol + "){1,2}\\s+(.*)");
43-
lang.blockRegex = new RegExp(lang.block);
46+
lang.lineRegex = new RegExp("^\\s*(?:" + symbol + "){1,2}\\s+(.*)");
47+
if (lang.block != null) {
48+
lang.blockRegex = new RegExp(util.escape(lang.block));
49+
}
4450
if (lang.start != null) {
45-
lang.startRegex = new RegExp(lang.start);
51+
lang.startRegex = new RegExp(util.escape(lang.start));
4652
}
4753
if (lang.end != null) {
48-
lang.endRegex = new RegExp(lang.end);
54+
lang.endRegex = new RegExp(util.escape(lang.end));
4955
}
5056
return lang;
5157
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "chalkboard",
33
"description": "Documentation generator for coffeescript",
4-
"version": "0.4.3",
4+
"version": "0.4.4",
55
"homepage": "https://github.com/adrianlee44/chalkboard",
66
"author": {
77
"name": "Adrian Lee",

0 commit comments

Comments
 (0)