learn.svelte.dev
learn.svelte.dev copied to clipboard
links between tutorials and reference docs
good point from @FractalHQ, we don't do a good job of connecting the different parts of the docs
I could tackle this one with some <a href="link/to#docs" target="_blank">
wrappers (unless there's a better way to open in new tab w. md) like:
We actually have the ability to render <a>
elements however we like — we can basically add a new link
method here alongside code
...
https://github.com/sveltejs/learn.svelte.dev/blob/4114ff1d174de67596c5769c308d67e1e6fb2a78/src/lib/server/markdown.js#L32-L34
...and e.g. add _target="blank"
to any external links, or even use aliases like [motion]($docs/whatever)
. That way we can keep the authored markdown neat and tidy. The marked
API is a bit chaotic but the details are here: https://marked.js.org/using_pro#renderer
So I've added doc-links to the Svelte and Advanced Svelte sections. Should I hold off on the Kit sections for now and open a PR for what's here?
I added the marked anchor tag bit here:
https://github.com/sveltejs/learn.svelte.dev/blob/6c1ecddc92fb835af76c1c9dce87f8930e32f515/src/lib/server/markdown.js#L117-L128