Skip to content

Commit

Permalink
Map h1 (# Foo) in markdown to SectionDivider. Still need to set id
Browse files Browse the repository at this point in the history
  • Loading branch information
techniq committed Dec 23, 2021
1 parent fbd9992 commit aef3557
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/docs/Header1.svelte
@@ -0,0 +1,16 @@
<script>
import SectionDivider from '$lib/components/SectionDivider.svelte';
console.log($$props);
</script>

<!--
TODO:
- [ ] Set id based on slot value
- Needed for #examples, #api, etc
- Maybe possible to set/get props from markdown/mdsvex
- Example: `#API { id: 'api' }
-->
<SectionDivider {...$$restProps}>
<slot />
</SectionDivider>
3 changes: 2 additions & 1 deletion src/docs/Layout.svelte
Expand Up @@ -2,13 +2,14 @@
// Custom components: https://mdsvex.com/docs#custom-components
import blockquote from './Blockquote.svelte';
import a from './Link.svelte';
import h1 from './Header1.svelte';
// Used by injected info via svelte preprocessor
import { mdiFileDocumentEditOutline } from '@mdi/js';
import Button from '$lib/components/Button.svelte';
import Tooltip from '$lib/components/Tooltip.svelte';
export { a, blockquote };
export { a, blockquote, h1 };
</script>

<script>
Expand Down

0 comments on commit aef3557

Please sign in to comment.