fix(aio): convert API and content docs to JSON
This commit is contained in:

committed by
Igor Minar

parent
5e9474d24c
commit
dfed388139
@ -0,0 +1,20 @@
|
||||
module.exports = function convertToJsonProcessor() {
|
||||
|
||||
return {
|
||||
$runAfter: ['checkUnbalancedBackTicks'],
|
||||
$runBefore: ['writeFilesProcessor'],
|
||||
docTypes: [],
|
||||
$process: function(docs) {
|
||||
const docTypes = this.docTypes
|
||||
docs.forEach((doc) => {
|
||||
if (docTypes.indexOf(doc.docType) !== -1) {
|
||||
const output = {
|
||||
title: doc.title || doc.name,
|
||||
content: doc.renderedContent
|
||||
};
|
||||
doc.renderedContent = JSON.stringify(output, null, 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user