initial public commit
This commit is contained in:
24
public/demo/overview-example-source.js
Normal file
24
public/demo/overview-example-source.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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",
|
||||
);
|
||||
Reference in New Issue
Block a user