Skip to content

Commit

Permalink
feat: Extracted from #40901
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatkashyap committed Mar 29, 2024
1 parent 46ecf9d commit d5322fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/markdown/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,17 @@ module.exports = async function demoLoader() {
const components = {};
const demoModuleIDs = new Set();
const componentModuleIDs = new Set();
const nonEditableDemos = new Set();
const demoNames = Array.from(
new Set(
docs.en.rendered
.filter((markdownOrComponentConfig) => {
return typeof markdownOrComponentConfig !== 'string' && markdownOrComponentConfig.demo;
})
.map((demoConfig) => {
if (demoConfig.hideToolbar) {
nonEditableDemos.add(demoConfig.demo);
}
return demoConfig.demo;
}),
),
Expand All @@ -150,6 +154,11 @@ module.exports = async function demoLoader() {
'',
)}`;

// Skip non-editable demos
if (nonEditableDemos.has(demoName)) {
return;
}

if (multipleDemoVersionsUsed) {
moduleID = `${moduleID}/system/index.js`;
}
Expand Down

0 comments on commit d5322fe

Please sign in to comment.