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

Add MDsveX support #6

Closed
rdela opened this issue May 17, 2019 · 6 comments
Closed

Add MDsveX support #6

rdela opened this issue May 17, 2019 · 6 comments

Comments

@rdela
Copy link
Contributor

rdela commented May 17, 2019

https://github.com/pngwn/MDsveX

A markdown preprocessor for Svelte components. Basically MDX for Svelte.

Sapper: Add support for custom route file extensions
sveltejs/sapper#632

Alternatively, focus efforts on Sapper?
https://twitter.com/Rich_Harris/status/1128822261815894016

Although, as I understand it, Scant has a more ambitious scope, wanting to support a plugin system and other things that Sapper does not currently provide. @voldemortensen thoughts?

Cc @pngwn @mrkishi @Conduitry @Rich-Harris

@rdela
Copy link
Contributor Author

rdela commented May 17, 2019

Cc @vedam @arxpoetica @LorbusChris

@pngwn
Copy link

pngwn commented May 17, 2019

I took a quick glance at the MD parsing here and it looks like markdown files are parsed and stored as JSON. This won't work with MDsveX because MDsveX is just a preprocessor, it converts the file into a valid Svelte component that needs to be instantiated like a normal component. I assume Scant creates a little API from which it loads the JSON, I think that would need to be modified for it to work with MDsveX.

All this said, (hopefully) Sapper will have custom route extensions soon and you'll esentially be able to build a static site that also allows md/mdx files as routes file (which will become pages). I don't know about the efficiency trade-offs between loading a blob of JSON and sticking it in a page, and instantiating a new component so I won't comment on that but it will be possible.

@rdela
Copy link
Contributor Author

rdela commented May 17, 2019

Cc @lukeed 🐧.svex

@voldemortensen
Copy link
Contributor

I really like this idea. At first glance the problem to solve would be how to get posts routed without having to configure a route for every single blog post.

@rdela
Copy link
Contributor Author

rdela commented May 18, 2019

Prior art from https://github.com/sveltejs/sapper-template/tree/blog-from-markdown-files (this branch is still on Svelte v2):

"create blog posts from markdown files" commit
sveltejs/sapper-template@0fa6c9f

Comparison against current sapper-template master:
https://github.com/sveltejs/sapper-template/compare/blog-from-markdown-files

@rdela
Copy link
Contributor Author

rdela commented May 19, 2019

I just added a commit on a PR I had open on the blog-from-markdown-files branch to bring it up to Svelte v3 and Sapper v0.27.

PR: sveltejs/sapper-template#109
Code: https://github.com/rdela/sapper-template/tree/discordian-blog-from-markdown-files

@rdela rdela closed this as completed Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants