Skip to content

Commit

Permalink
fix(documentationjs): Updgrade to RC + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Stanislawski committed May 10, 2017
1 parent d36b42c commit e9f0361
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 153 deletions.
2 changes: 1 addition & 1 deletion docgen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"browser-sync": "^2.18.5",
"codemirror": "^5.22.0",
"compression": "^1.6.2",
"documentation": "^4.0.0-beta.18",
"documentation": "^4.0.0-rc.1",
"json-loader": "^0.5.4",
"markdown-it": "^8.2.2",
"markdown-it-anchor": "^2.6.0",
Expand Down
39 changes: 18 additions & 21 deletions docgen/plugins/documentationjs-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,24 @@ function formatAllMD(symbols) {
export default function({rootJSFile}) {
return function(files, metalsmith, done) {
console.log('before documentationjs');
documentation.build(rootJSFile, {}, (e, symbols) => {
if(e) done(e);
else {
// transform all md like structure to html --> type: 'root' using formatMD
const mdFormattedSymbols = formatAllMD(symbols);

mapInstantSearch(
[
findInstantSearchFactory(mdFormattedSymbols),
findInstantSearch(mdFormattedSymbols),
],
mdFormattedSymbols,
files
);
mapConnectors(filterSymbolsByType('Connector', mdFormattedSymbols), mdFormattedSymbols, files),
mapWidgets(filterSymbolsByType('WidgetFactory', mdFormattedSymbols), mdFormattedSymbols, files),

console.log('after documentationjs');
done();
}
});
const out = documentation.build(rootJSFile, {}).then((symbols) => {
// transform all md like structure to html --> type: 'root' using formatMD
const mdFormattedSymbols = formatAllMD(symbols);

mapInstantSearch(
[
findInstantSearchFactory(mdFormattedSymbols),
findInstantSearch(mdFormattedSymbols),
],
mdFormattedSymbols,
files
);
mapConnectors(filterSymbolsByType('Connector', mdFormattedSymbols), mdFormattedSymbols, files),
mapWidgets(filterSymbolsByType('WidgetFactory', mdFormattedSymbols), mdFormattedSymbols, files),

console.log('after documentationjs');
done();
}, (e) => done);
};
}

Expand Down
Loading

0 comments on commit e9f0361

Please sign in to comment.