CoolFace
Apppublic

lerobot/robot-learning-tutorial

sourceHugging Faceupdated 1y agoView on Hugging Face
508likes
output-container.mjs24 linesDownload Raw Back to remark
1// Transform `:::output ... :::` into a <section class="code-output"> wrapper2// Requires remark-directive to be applied before this plugin3 4export default function remarkOutputContainer() {5  return (tree) => {6    const visit = (node) => {7      if (!node || typeof node !== 'object') return;8 9      if (node.type === 'containerDirective' && node.name === 'output') {10        node.data = node.data || {};11        node.data.hName = 'section';12        node.data.hProperties = { className: ['code-output'] };13      }14 15      const children = Array.isArray(node.children) ? node.children : [];16      for (const child of children) visit(child);17    };18 19    visit(tree);20  };21}22 23 24