apidoc-core
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -152,9 +152,9 @@ var _ = require('lodash'); | ||
function parse(options) { | ||
_.defaults(options, defaults); | ||
options = _.defaults({}, options, defaults); | ||
// extend with custom functions | ||
app.filters = _.defaults(options.filters, app.filters); | ||
app.languages = _.defaults(options.languages, app.languages); | ||
app.parsers = _.defaults(options.parsers, app.parsers); | ||
app.workers = _.defaults(options.workers, app.workers); | ||
app.filters = _.defaults({}, options.filters, app.filters); | ||
app.languages = _.defaults({}, options.languages, app.languages); | ||
app.parsers = _.defaults({}, options.parsers, app.parsers); | ||
app.workers = _.defaults({}, options.workers, app.workers); | ||
@@ -165,6 +165,6 @@ // options | ||
// generator | ||
_.defaults(app.generator, defaultGenerator); | ||
app.generator = _.defaults({}, app.generator, defaultGenerator); | ||
// packageInfos | ||
_.defaults(app.packageInfos, defaultPackageInfos); | ||
app.packageInfos = _.defaults({}, app.packageInfos, defaultPackageInfos); | ||
@@ -171,0 +171,0 @@ var parsedFiles = []; |
@@ -223,15 +223,16 @@ var _ = require('lodash'); | ||
// Markdown | ||
// TODO: put this into converters | ||
if ( values && | ||
app.markdown && | ||
elementParser.markdownFields && | ||
elementParser.markdownFields.length > 0 | ||
) { | ||
for (var markdownIndex = 0; markdownIndex < elementParser.markdownFields.length; markdownIndex += 1) { | ||
var markdownField = elementParser.markdownFields[markdownIndex]; | ||
if (values[markdownField] && app.markdown) { | ||
values[markdownField] = app.markdown(values[markdownField]); | ||
// remove line breaks | ||
values[markdownField] = values[markdownField].replace(/(\r\n|\n|\r)/g, ' '); | ||
// TODO: put this into "converters" | ||
if (values) { | ||
// Markdown | ||
if ( app.markdown && | ||
elementParser.markdownFields && | ||
elementParser.markdownFields.length > 0 | ||
) { | ||
for (var markdownIndex = 0; markdownIndex < elementParser.markdownFields.length; markdownIndex += 1) { | ||
var field = elementParser.markdownFields[markdownIndex]; | ||
if (values[field]) { | ||
values[field] = app.markdown(values[field]); | ||
// remove line breaks | ||
values[field] = values[field].replace(/(\r\n|\n|\r)/g, ' '); | ||
} | ||
} | ||
@@ -238,0 +239,0 @@ } |
@@ -0,1 +1,4 @@ | ||
var trim = require('../utils/trim'); | ||
var unindent = require('../utils/unindent'); | ||
var ParameterError = require('../errors/parameter_error'); | ||
@@ -15,4 +18,3 @@ | ||
// trim | ||
content = content.replace(/^\s*|\s*$/g, ''); | ||
content = trim(content); | ||
@@ -44,3 +46,3 @@ var parseRegExp = /^(\w*)(.*?)(?:\s+|$)(.*)$/gm; | ||
title : title, | ||
description: description | ||
description: unindent(description) | ||
}; | ||
@@ -47,0 +49,0 @@ } |
@@ -0,4 +1,6 @@ | ||
var trim = require('../utils/trim'); | ||
var unindent = require('../utils/unindent'); | ||
function parse(content) { | ||
// trim | ||
var description = content.replace(/^\s*|\s*$/g, ''); | ||
var description = trim(content); | ||
@@ -9,3 +11,3 @@ if (description.length === 0) | ||
return { | ||
description: description | ||
description: unindent(description) | ||
}; | ||
@@ -12,0 +14,0 @@ } |
@@ -0,4 +1,6 @@ | ||
var trim = require('../utils/trim'); | ||
var unindent = require('../utils/unindent'); | ||
function parse(content, source) { | ||
// trim | ||
source = source.replace(/^\s*|\s*$/g, ''); | ||
source = trim(source); | ||
@@ -30,3 +32,3 @@ var title = ''; | ||
title : title, | ||
content: text, | ||
content: unindent(text), | ||
type : type || 'json' | ||
@@ -33,0 +35,0 @@ }; |
@@ -0,4 +1,6 @@ | ||
var trim = require('../utils/trim'); | ||
var unindent = require('../utils/unindent'); | ||
function parse(content) { | ||
// trim | ||
var description = content.replace(/^\s*|\s*$/g, ''); | ||
var description = trim(content); | ||
@@ -9,3 +11,3 @@ if (description.length === 0) | ||
return { | ||
groupDescription: description | ||
groupDescription: unindent(description) | ||
}; | ||
@@ -12,0 +14,0 @@ } |
@@ -0,4 +1,5 @@ | ||
var trim = require('../utils/trim'); | ||
function parse(content) { | ||
// trim | ||
var group = content.replace(/^\s*|\s*$/g, ''); | ||
var group = trim(content); | ||
@@ -5,0 +6,0 @@ if (group.length === 0) |
@@ -0,4 +1,5 @@ | ||
var trim = require('../utils/trim'); | ||
function parse(content) { | ||
// trim | ||
var name = content.replace(/^\s*|\s*$/g, ''); | ||
var name = trim(content); | ||
@@ -5,0 +6,0 @@ if(name.length === 0) |
@@ -0,4 +1,5 @@ | ||
var trim = require('../utils/trim'); | ||
function parse(content) { | ||
// trim | ||
content = content.replace(/^\s*|\s*$/g, ''); | ||
content = trim(content); | ||
@@ -5,0 +6,0 @@ // replace Linebreak with Unicode |
@@ -0,1 +1,4 @@ | ||
var trim = require('../utils/trim'); | ||
var unindent = require('../utils/unindent'); | ||
var group = ''; | ||
@@ -68,4 +71,3 @@ | ||
function parse(content, source, defaultGroup) { | ||
// trim | ||
content = content.replace(/^\s*|\s*$/g, ''); | ||
content = trim(content); | ||
@@ -114,3 +116,3 @@ // replace Linebreak with Unicode | ||
defaultValue : matches[7] || matches[8] || matches[9], | ||
description : matches[10] || '' | ||
description : unindent(matches[10] || '') | ||
}; | ||
@@ -117,0 +119,0 @@ } |
@@ -0,4 +1,5 @@ | ||
var trim = require('../utils/trim'); | ||
function parse(content) { | ||
// trim | ||
var url = content.replace(/^\s*|\s*$/g, ''); | ||
var url = trim(content); | ||
@@ -5,0 +6,0 @@ if(url.length === 0) |
@@ -0,4 +1,5 @@ | ||
var trim = require('../utils/trim'); | ||
function parse(content) { | ||
// trim | ||
var name = content.replace(/^\s*|\s*$/g, ''); | ||
var name = trim(content); | ||
@@ -5,0 +6,0 @@ if (name.length === 0) |
var semver = require('semver'); | ||
var trim = require('../utils/trim'); | ||
var ParameterError = require('../errors/parameter_error'); | ||
function parse(content) { | ||
// trim | ||
content = content.replace(/^\s*|\s*$/g, ''); | ||
content = trim(content); | ||
@@ -8,0 +10,0 @@ if (content.length === 0) |
@@ -0,4 +1,5 @@ | ||
var trim = require('../utils/trim'); | ||
function parse(content) { | ||
// trim | ||
content = content.replace(/^\s*|\s*$/g, ''); | ||
content = trim(content); | ||
@@ -5,0 +6,0 @@ // Search: type, url and title |
{ | ||
"name": "apidoc-core", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "Core parser library to generate apidoc result following the apidoc-spec", | ||
@@ -20,3 +20,3 @@ "author": "Peter Rottmann <rottmann@inveris.de>", | ||
"scripts": { | ||
"test": "npm run jshint && mocha test/", | ||
"test": "npm run jshint && mocha test/**/*_test.js", | ||
"jshint": "jshint lib/ test/" | ||
@@ -23,0 +23,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103790
74
2979