Skip to content

Commit

Permalink
Add support for Perl files (pm)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfisher committed Jul 9, 2014
1 parent e591c6b commit 4fe7280
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/apidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var argv = optimist

.option("f", {
alias: "file-filters",
"default": ".*\\.(coffee|cs|dart|erl|go|java|js|php?|py|rb|ts)$",
"default": ".*\\.(coffee|cs|dart|erl|go|java|js|php?|py|rb|ts|pm)$",
describe: "RegEx-Filter to select files that should be parsed (multiple -f can be used)."
})

Expand Down
2 changes: 1 addition & 1 deletion lib/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var fs = require("fs-extra");
// Options
var _defaultOptions = {
excludeFilters: [],
includeFilters: [ ".*\\.(coffee|cs|dart|erl|go|java|js|php?|py|rb|ts)$" ],
includeFilters: [ ".*\\.(coffee|cs|dart|erl|go|java|js|php?|py|rb|ts|pm)$" ],

src: path.join(__dirname, "../example/"),
dest: path.join(__dirname, "../doc/"),
Expand Down
7 changes: 7 additions & 0 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ Parser.prototype._findBlocks = function()
inlineRegExp = /^(\t+)?[ ]?/gm;
break;

case ".pm":
// Find document blocks between "#**" and "#**"
docBlocksRegExp = /#\*\*\uffff?(.+?)#\*\*/g;
// Remove not needed " # " and " " (tabs) at the beginning
inlineRegExp = /^(\s+)?(#)[ ]?/gm;
break;

default:
// Find document blocks between "/**" and "*/"
docBlocksRegExp = /\/\*\*\uffff?(.+?)\*\//g;
Expand Down

0 comments on commit 4fe7280

Please sign in to comment.