remove examples

This commit is contained in:
Cory LaViska
2024-06-12 11:06:49 -04:00
parent 847ad26814
commit a884a0c1f0
58 changed files with 3 additions and 8574 deletions

View File

@@ -22,8 +22,6 @@ export function codeExamplesPlugin(options = {}) {
// Look for external links
container.querySelectorAll('code.example').forEach(code => {
const pre = code.closest('pre');
const adjacentPre = pre.nextElementSibling?.localName === 'pre' ? pre.nextElementSibling : null;
const adjacentPreForReact = adjacentPre?.querySelector('code.react') ? adjacentPre.querySelector('code') : null;
const hasButtons = !code.classList.contains('no-buttons');
const isOpen = code.classList.contains('open') || !hasButtons;
const noEdit = code.classList.contains('no-edit');
@@ -41,18 +39,7 @@ export function codeExamplesPlugin(options = {}) {
${preview}
</div>
<div class="code-example-source" id="${id}">
<wa-tab-group>
<wa-tab slot="nav" panel="html">HTML</wa-tab>
<wa-tab-panel name="html">${pre.outerHTML}</wa-tab-panel>
${
adjacentPreForReact
? `
<wa-tab slot="nav" panel="react">React</wa-tab>
<wa-tab-panel name="react">${adjacentPre.outerHTML}</wa-tab-panel>
`
: ''
}
</wa-tab-group>
${pre.outerHTML}
</div>
${
hasButtons
@@ -87,7 +74,6 @@ export function codeExamplesPlugin(options = {}) {
`);
pre.replaceWith(codeExample);
adjacentPre?.remove();
});
return doc.toString();