25 lines
672 B
JavaScript
25 lines
672 B
JavaScript
import formatSource from "./format-source.js";
|
|
|
|
formatSource(
|
|
`
|
|
\<script type="module">
|
|
import { loadAndParseTwtxtFile } from "/web/dist/twtxt-lib.js";
|
|
|
|
// run in an IIFE (or event listener) to avoid issues with top-level await
|
|
(async () => {
|
|
try {
|
|
const parsedFile = await loadAndParseTwtxtFile(
|
|
"/twtxt-demos/demo-hipster-twtxt.txt",
|
|
);
|
|
|
|
console.log(parsedFile);
|
|
|
|
} catch (err) {
|
|
console.error(err);
|
|
}
|
|
})();
|
|
<\/script>
|
|
`,
|
|
"tabOverview-example",
|
|
);
|