site-kit icon indicating copy to clipboard operation
site-kit copied to clipboard

Markdown renderer prevents some translations from outside

Open bleucitron opened this issue 1 year ago • 0 comments

I found two cases where site-kit's markdown renderer is in the way of translating section of the kit site.

I'm not sure there are easy-to-implement solutions to these issues, i'm just pin-pointing them to raise awareness.

One option would be to fork site-kit, but i don't really want to do this. Not a big deal, but annoying.

Config and KitConfig sections

These (relatively not-so-important) sections are not accessible for translation from outside this package.

  • https://kit.svelte.dev/docs/types#public-types-config
  • https://kit.svelte.dev/docs/types#public-types-kitconfig

This is due to this line: https://github.com/sveltejs/site-kit/blob/master/packages/site-kit/src/lib/markdown/renderer.js#L597

/types page h2s

If we translate the h2s in the /types page (like "Public types" for instance), this will break links that are (most certainly) created via site-kit markdown renderer.

For instance, the link to Config interface on this page will break if the h2 "Public types" is translated.

This is (probably) due to one of these lines:

  • https://github.com/sveltejs/site-kit/blob/master/packages/site-kit/src/lib/markdown/renderer.js#L178
  • https://github.com/sveltejs/site-kit/blob/master/packages/site-kit/src/lib/markdown/renderer.js#L199

bleucitron avatar Oct 29 '23 20:10 bleucitron