question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import markdown into svx

See original GitHub issue

Could MDsveX add support for importing markdown files into .svx files?

Would allow for deduplication in a lot of docs sites, I imagine, if you could do

<script>
  import Readme from '../readme.md'
</script>

<Readme />

## More markdown

Foo bar.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pngwncommented, May 9, 2021

Try this:

import adapter from '@sveltejs/adapter-static'
import { mdsvex } from 'mdsvex'

export default {
  extensions: ['.svelte', '.svx', '.md'],
  preprocess: mdsvex({ extensions: ['.md', '.svx'] }),
  kit: {
    adapter: adapter(),
    target: 'body',
  },
}
0reactions
pngwncommented, May 9, 2021

Yes, that would be very welcome. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mdsvex docs!
To import markdown files as components, add .md to both the Svelte compiler and mdsvex extensions: // svelte.config.js import { mdsvex } from...
Read more >
MDSveX: The bridge between Markdown and Svelte
MDSveX helped me find a siiimple way to convert my Svelte app into a full-blown CMS-like website, all without the overhead of an...
Read more >
MDsveX - Adding Interactivity with Svelte Components in ...
mdsvex is a markdown preprocessor for Svelte components. ... The Svelte component code should be saved in a .svx file to be recognized...
Read more >
SvelteKit blog using Markdown, how to avoid a large file ...
Note that import.meta.globEager actually imports all those modules (svx pages) into the executing module -- you just want to loop through them ...
Read more >
mdsvex - npm
It uses markdown-it to parse the markdown, mainly due to the ... the mdsvex preprocessor function is a named import from the mdsvex...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found