Custom types for asides #2068
-
What version of
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Thanks for the idea @essential-randomness! I guess this is specifically about adding extra directives. Asides currently have a couple of components:
So I guess a feature like this would need that too and assumes people want customisation but not much customisation (because basically the asides would still have the same format). The alternative might be a generic Astro integration which maps remark directives to whatever user-defined components you provide. Then that doesn’t need to be built into Starlight and gives more flexibility. Was chatting about that with @OliverSpeir the other day.
The other types all come with translations for their default labels, so presumably this should work the same somehow. Definitely a tricky aspect about designing an API to support this! |
Beta Was this translation helpful? Give feedback.
-
Yeah allowing custom components Having the current remark component accept more props would be cool too like a background color and icon etc so you can customize on the fly as well |
Beta Was this translation helpful? Give feedback.
-
For the default label, one could use the name of the aside type (e.g. "question" or " For colors, what docusaurus did was adding a class to the aside which was the name of the new type. This allows people to override styling with their own custom ones. I don't know what your custom styling for asides is like, but I assume any would be fine. "Customizing but not too much" is the idea here. I wouldn't want to define a new component from scratch. The idea of custom directives is interesting, but for this specific issue only if I could still reuse Starlight's Aside somehow. I don't really want to create a new Aside component and have it clutter my components folder, or keep it up to date with how Starlights's look like. With that said, I do think it's an interesting idea, and I might consider helping according to how much work it is :P |
Beta Was this translation helpful? Give feedback.
-
I would personally much prefer just extending the current Astro component to allow further customization. The DX of complex markdown directives were always way over-complicated imo. |
Beta Was this translation helpful? Give feedback.
-
Adding @delucis's ![]() |
Beta Was this translation helpful? Give feedback.
Adding @delucis's
starlight-markdown-blocks
plugin to the conversation which provides an easy but very powerful approach to extend Starlight’s Markdown asides syntax with custom block types.