Skip to content

Commit

Permalink
Revert "chore(docs): add support for language specific notes (#5810)"
Browse files Browse the repository at this point in the history
This bubbled up in Python comments.
  • Loading branch information
pavelfeldman committed Mar 18, 2021
1 parent 516f13e commit c4410d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
14 changes: 0 additions & 14 deletions utils/doclint/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ Documentation.Class = class {
member.filterForLanguage(lang);
membersArray.push(member);
}
this.spec = filterSpecs(this.spec, lang);
this.membersArray = membersArray;
}

Expand Down Expand Up @@ -341,7 +340,6 @@ Documentation.Member = class {
argsArray.push(overriddenArg);
}
this.argsArray = argsArray;
this.spec = filterSpecs(this.spec, lang);
}

clone() {
Expand Down Expand Up @@ -689,16 +687,4 @@ function generateSourceCodeComment(spec) {
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;
4 changes: 1 addition & 3 deletions utils/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ function buildTree(lines) {
}

if (content.startsWith(':::')) {
let noteType = content.substring(3).split(' ');
/** @type {MarkdownNode} */
const node = {
type: 'note',
noteType: noteType[0],
codeLang: noteType[1]
noteType: content.substring(3)
};
line = lines[++i];
const tokens = [];
Expand Down

0 comments on commit c4410d3

Please sign in to comment.