feat: Update markdown renderer
This commit is contained in:
1 parent
cae8011d68
commit
6bfdcaca2f
2 files changed
+21
No files matched your search
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import MarkdownHeader from '$lib/components/markdown/MarkdownHeader.svelte'
|
||||||
import MarkdownLink from '$lib/components/markdown/MarkdownLink.svelte'
|
import MarkdownLink from '$lib/components/markdown/MarkdownLink.svelte'
|
||||||
import SvelteMarkdown from 'svelte-markdown'
|
import SvelteMarkdown from 'svelte-markdown'
|
||||||
|
|
||||||
@@ -9,5 +10,6 @@
|
|||||||
{source}
|
{source}
|
||||||
renderers={{
|
renderers={{
|
||||||
link: MarkdownLink,
|
link: MarkdownLink,
|
||||||
|
heading: MarkdownHeader,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let depth: Number
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if depth == 1}
|
||||||
|
<h1 class="font-bold text-3xl"><slot /></h1>
|
||||||
|
{:else if depth == 2}
|
||||||
|
<h2 class="font-bold text-2xl"><slot /></h2>
|
||||||
|
{:else if depth == 3}
|
||||||
|
<h3 class="font-bold text-xl"><slot /></h3>
|
||||||
|
{:else if depth == 4}
|
||||||
|
<h4 class="font-bold text-lg"><slot /></h4>
|
||||||
|
{:else if depth == 5}
|
||||||
|
<h5 class="font-bold text-base"><slot /></h5>
|
||||||
|
{:else if depth == 6}
|
||||||
|
<h6 class="font-bold text-sm"><slot /></h6>
|
||||||
|
{:else}
|
||||||
|
<slot />
|
||||||
|
{/if}
|
||||||
Reference in new issue
Block a user