Files
twtxt-lib/public/demo/overview-example-source.js
2026-02-22 21:26:15 -05:00

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",
);