chore: fix error with doc-shredder not recognizing missing json fragment files.
closes #672
This commit is contained in:
parent
21ad7eff11
commit
661f5fd89f
|
@ -271,7 +271,7 @@ include ../../../_includes/_util-fns
|
|||
#### Example:
|
||||
|
||||
code-example(format="" language="js").
|
||||
+makeJson('styleguide/package.json', null, "Entire package.json file")
|
||||
+makeJson('styleguide/package.1.json', null, "Entire package.json file")
|
||||
|
||||
+makeJson('styleguide/package.1.json', null, "Entire package.json file")
|
||||
|
||||
|
@ -279,7 +279,7 @@ include ../../../_includes/_util-fns
|
|||
A subset of the '.json' file can also be selected.
|
||||
|
||||
code-example(format="" language="js").
|
||||
+makeJson('styleguide/package.json', { paths: 'version, scripts.tsc, scripts.start '}, "Selected parts of the package.json file" )
|
||||
+makeJson('styleguide/package.1.json', { paths: 'version, scripts.tsc, scripts.start '}, "Selected parts of the package.json file" )
|
||||
|
||||
+makeJson('styleguide/package.1.json', { paths: 'version, scripts.tsc, scripts.start '}, "Selected parts of the package.json file" )
|
||||
|
||||
|
@ -287,7 +287,7 @@ include ../../../_includes/_util-fns
|
|||
Styling selected portions of the json is also supported.
|
||||
|
||||
code-example(format="" language="js").
|
||||
+makeJson('styleguide/package.json', {paths: 'dependencies'}, "package.json dependencies", { pnk: [/(\S*traceur.*)/, /(\Sangular2.*)/, /(\Ssystem.*)/ ]})
|
||||
+makeJson('styleguide/package.1.json', {paths: 'dependencies'}, "package.json dependencies", { pnk: [/(\S*traceur.*)/, /(\Sangular2.*)/, /(\Ssystem.*)/ ]})
|
||||
|
||||
+makeJson('styleguide/package.1.json', {paths: 'dependencies'}, "package.json dependencies", { pnk: [/(\S*traceur.*)/, /(\Sangular2.*)/, /(\Ssystem.*)/ ]})
|
||||
|
||||
|
@ -296,7 +296,7 @@ include ../../../_includes/_util-fns
|
|||
|
||||
code-example(format="" language="js").
|
||||
- var styles = { pnk: /(^.*dependencies[\s\S]* \})/gm };
|
||||
+makeJson('styleguide/package.json', {paths: 'name, version, dependencies '}, "Foo", styles )
|
||||
+makeJson('styleguide/package.1.json', {paths: 'name, version, dependencies '}, "Foo", styles )
|
||||
|
||||
- var styles = { pnk: /(^.*dependencies[\s\S]* \})/gm };
|
||||
+makeJson('styleguide/package.1.json', {paths: 'name, version, dependencies '}, "Foo", styles )
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
var path = require('canonical-path');
|
||||
|
||||
module.exports = function extractPathsReader(log) {
|
||||
// regex for makeTabs line
|
||||
var rx = /\s*\+make(?:=Tabs|Example|Json)\(\s*["'](.*?)["']\s*,\s*["'](.*?)["'].*?\)/g
|
||||
// regexs for makeTabs. makeExample and makeJson lines
|
||||
var rx = /\s*\+make(?:=Tabs|Example)\(\s*["'](.*?)["']\s*,\s*["'](.*?)["'].*?\)/g
|
||||
var rxJson = /\s*\+makeJson\(\s*["'](.*?)["']\s*,.*?\)/g
|
||||
return {
|
||||
name: 'extractPathsReader',
|
||||
|
||||
|
@ -24,6 +25,12 @@ module.exports = function extractPathsReader(log) {
|
|||
fragItems.push( { mixinPath: filePath, region: region } );
|
||||
});
|
||||
}
|
||||
while ((r = rxJson.exec(content)) !== null) {
|
||||
var filePaths = r[1].split(',');
|
||||
filePaths.forEach(function(filePath) {
|
||||
fragItems.push( { mixinPath: filePath, region: null } );
|
||||
});
|
||||
}
|
||||
if (fragItems.length) {
|
||||
return [{
|
||||
fragItems: fragItems
|
||||
|
|
Loading…
Reference in New Issue