UNPKG

solidjs-show-code

Version:

Code viewer for solidJs

10 lines (9 loc) 324 B
import { tokenise } from '../functions/tokeniser'; import { buildHtmlTree } from '../functions/htmlBuilder'; const CodeView = (props) => { const tokens = tokenise(props.code); return (<div style={{ padding: '10px' }}> {buildHtmlTree(tokens, props.styleSheet)} </div>); }; export default CodeView;