feat(aio): code snippet source available & shown when code missing
Tells reader (usually the author) what code file is missing Also when no linenums specified, turn them on if num of lines > 10
This commit is contained in:

committed by
Pete Bacon Darwin

parent
f1f04fa782
commit
7b94f493b9
@ -17,8 +17,6 @@ module.exports = function renderExamples(getExampleRegion) {
|
||||
if (attrMap.path) {
|
||||
// We found a path attribute so look up the example and rebuild the HTML
|
||||
const exampleContent = getExampleRegion(doc, attrMap.path, attrMap.region);
|
||||
delete attrMap.path;
|
||||
delete attrMap.region;
|
||||
attributes = Object.keys(attrMap).map(key => ` ${key}="${attrMap[key].replace(/"/g, '"')}"`).join('');
|
||||
return `<${element}${attributes}>\n${exampleContent}\n</${element}>`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user