roxiness / routify

Automated Svelte routes
https://routify.dev
1.88k stars 88 forks source link

Support for markdown #79

Closed Wolfr closed 4 years ago

Wolfr commented 4 years ago

I want to write a slide deck in Svelte, there are several packages that allow you to write markdown in Svelte, but both of these rely on having different file formats, which will not be picked up by the Router.

https://alexxnb.github.io/svelte-preprocess-markdown/ https://github.com/pngwn/MDsveX

Do you have any ideas on supporting markdown preprocessing in the context of a Routify project?

rixo commented 4 years ago

Would just need to add an extensions option to Routify to let it index *.md files in pages folder, as far as I can tell.

Seems like a very good idea.

Wolfr commented 4 years ago

I ended up with this for my slides deck, this project contains a custom router that is very small, I would love to be able to use Routify for this purpose. But it might be too specialized.

https://github.com/Wolfr/svelte-slides

jakobrosenberg commented 4 years ago

That should be very straight forward. A _layout.svelte which listens to keypresses and a function that goes back and forth in a list of urls. Animations could be handled by wrapping each page in a transition component or by using a decorator.

jakobrosenberg commented 4 years ago

This was added a few releases ago.

From the CLI: -e, --extensions <names> Comma separated extensions (default: ["html","svelte"])

Extensions can also be set in Rollup with an array or comma separated string.

If there are any issues, let me know and I'll reopen the issue.