deno-gfm icon indicating copy to clipboard operation
deno-gfm copied to clipboard

Feat: Added CSS class customization

Open CarcajadaArtificial opened this issue 1 year ago • 4 comments

Hello!

I'm really interested in md rendering native to Deno. I think adding CSS classes to the rendered markdown elements would be a fantastic feature. This would allow users to include their own styling without the need to rewrite the whole Marked Render class from scratch. Additionally, I think this works great for Fresh users (or other frameworks) because it gives them a way to add twind classes.

Finally, I think that the requirement of markdown rendering extends further than sites that come from mostly markdown generation (like documentation sites). Frequently, in normal web app sites, I get the requirement of rendering a few static markdown blocks, for user instructions, pieces of documentation, or content that is more convenient to write with a markdown editor. Most of these would like to add their own styling to the rendered content.

I hope my previous arguments convince you of the potential of this feature. Even if you don't see it fit for this project, I would love to hear advice or recommendation. Thank you for reading and for this project.

CarcajadaArtificial avatar Jul 21 '23 23:07 CarcajadaArtificial

@hashrock please take a look

lino-levan avatar Aug 01 '23 00:08 lino-levan

I'm not sure about this feature. I think it might be useful, But It also seems to be an uncommon feature for markdown renderers (please let me know if any renderers implement similar features). I think most of the cases are solved by writing raw html inside markdown and applying raw CSS externally. Also I think this might be something that should be done post-processing the html like rehype-add-classes.

hashrock avatar Aug 01 '23 04:08 hashrock

My old website used react-markdown which had this feature. To be fair, that's a layer on top of unified (but so are we, or at least, we will be).

lino-levan avatar Aug 07 '23 18:08 lino-levan

@lino-levan I like the idea of this but agree with @hashrock that anything that is needed from this is already do-able with html in md and raw css.

If we were to add this, could we do some more tests?

Mrashes avatar Jul 02 '24 02:07 Mrashes