Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating custom code components #496

Open
Tracked by #587
vargaking opened this issue Mar 5, 2023 · 1 comment
Open
Tracked by #587

Creating custom code components #496

vargaking opened this issue Mar 5, 2023 · 1 comment
Labels
assigned Whether or not this bug has been assigned some to some other issues as a subtask or pre-req
Milestone

Comments

@vargaking
Copy link

I am trying to customize mdsvex and ran into a problem with code snippets.

//layout.svelte
<script lang="ts" context="module">
    import h1 from "./markdown/h1.svelte";
    import h2 from "./markdown/h2.svelte";
    import h3 from "./markdown/h3.svelte";
    import blockquote from "./markdown/blockquote.svelte";
    import code from "./markdown/code.svelte";

    export { h1, h2, h3, blockquote, code };
</script>

<slot></slot>

The headers and blockquotes are compiling without problem. However the code component doesn't.

//code.svelte
<code class="bg-slate-300">
    <slot></slot>
</code>

Another question is how can i make a difference in simple and triple code snippets?

@philipbelesky
Copy link

You may want to checkout this post: #100 (comment)

@pngwn pngwn added this to the 1.0 milestone Feb 23, 2024
@pngwn pngwn mentioned this issue Feb 23, 2024
6 tasks
@pngwn pngwn added the assigned Whether or not this bug has been assigned some to some other issues as a subtask or pre-req label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned Whether or not this bug has been assigned some to some other issues as a subtask or pre-req
Projects
None yet
Development

No branches or pull requests

3 participants