devpage-core 0.2.3

devpage's core: documents, rendering, link checking, comments and designs, with no I/O runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
// Markdown source, highlighted, beside what it renders to.
export default function Example({ title, source, sourceHtml, children }: { title?: string; source: string; sourceHtml?: string; children?: any }) {
  return (
    <figure className="example">
      {title ? <figcaption>{title}</figcaption> : null}
      <pre className="example-source">
        {sourceHtml !== undefined ? <code dangerouslySetInnerHTML={{ __html: sourceHtml }} /> : <code>{source}</code>}
      </pre>
      <div className="example-result">{children}</div>
    </figure>
  );
}