Revert "chore(docs): add support for language specific notes (#5810)"
This bubbled up in Python comments.
This commit is contained in:
parent
516f13e7ee
commit
c4410d3f4d
|
|
@ -207,7 +207,6 @@ Documentation.Class = class {
|
||||||
member.filterForLanguage(lang);
|
member.filterForLanguage(lang);
|
||||||
membersArray.push(member);
|
membersArray.push(member);
|
||||||
}
|
}
|
||||||
this.spec = filterSpecs(this.spec, lang);
|
|
||||||
this.membersArray = membersArray;
|
this.membersArray = membersArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,7 +340,6 @@ Documentation.Member = class {
|
||||||
argsArray.push(overriddenArg);
|
argsArray.push(overriddenArg);
|
||||||
}
|
}
|
||||||
this.argsArray = argsArray;
|
this.argsArray = argsArray;
|
||||||
this.spec = filterSpecs(this.spec, lang);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clone() {
|
clone() {
|
||||||
|
|
@ -689,16 +687,4 @@ function generateSourceCodeComment(spec) {
|
||||||
return md.render(comments, 120);
|
return md.render(comments, 120);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {MarkdownNode[]} spec
|
|
||||||
* @param {string} lang
|
|
||||||
* @returns {MarkdownNode[]}
|
|
||||||
*/
|
|
||||||
function filterSpecs(spec, lang) {
|
|
||||||
if(!spec)
|
|
||||||
return;
|
|
||||||
return spec.filter(n => n.type !== 'note' || (n.type === 'note' && (!n.codeLang || n.codeLang === lang)));
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Documentation;
|
module.exports = Documentation;
|
||||||
|
|
|
||||||
|
|
@ -141,12 +141,10 @@ function buildTree(lines) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (content.startsWith(':::')) {
|
if (content.startsWith(':::')) {
|
||||||
let noteType = content.substring(3).split(' ');
|
|
||||||
/** @type {MarkdownNode} */
|
/** @type {MarkdownNode} */
|
||||||
const node = {
|
const node = {
|
||||||
type: 'note',
|
type: 'note',
|
||||||
noteType: noteType[0],
|
noteType: content.substring(3)
|
||||||
codeLang: noteType[1]
|
|
||||||
};
|
};
|
||||||
line = lines[++i];
|
line = lines[++i];
|
||||||
const tokens = [];
|
const tokens = [];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue