~ / blog / Svelte and Pandoc

               

  1 minute(s)

This is an example of using a svelte component when using pandoc as a preprocessor.

The following is a button that is a Svelte component that increments a counter when you click on it:

The following is the code I included in the Markdown source file:

<script>
  import Counter from "$lib/components/Counter.svelte";
</script>

<Counter />
<script>
  import Counter from "$lib/components/Counter.svelte";
</script>

<Counter />

You can click on the date in this blog post to see the source markdown file that was used to render this page.