Open alexfauquette opened 1 year ago
I vote for the 1st solution though it'll require more work.
I vote for the 1st solution though it'll require more work.
Is there a specific reason? a special use-case you have in mind, an experience you had, or a fealing?
Option 1: sounds clean, but how is it worth the overhead vs. duplicating the content at this stage? Option 2: it won't work for other types of content, this is an image-only solution. Option 3: duplicate the content.
Wondering what is the way to go in cases when we want to reuse .md files that we write for the docs which contain "our" custom syntax.
For example, we reuse the .md file that powers this docs page: https://mui.com/toolpad/examples/admin-app/ as a README.md here: https://github.com/mui/mui-toolpad/blob/master/examples/admin-app/README.md
TL;DR: Problem: To allow .md files reusability. Solution: For the docs markdown parser: Parse custom syntax within comments, and add a directive to ignore lines. (edited)
Option 1 - Use comments
One idea is to potentially allow parsing any custom syntax within comments, so:
could become:
and still be parsed by the docs markdown parser, but ignored when rendering plain markdown. And, for the other way around, we could add a directive like:
allowing us to add lines to the .md that don't get parsed by our parsers.
Option 2 - Use a cusomized
<img />
If the problem only concern the images, we could use special renderer for
<img />
tags in the docs, and let GitHub handle them by itselfMark
<img/>
as special sectionsRender them with React component instead of static HTML
One limitation is that images should be stored in a way that can be handled by both the docs and GitHub. So
src
should be a static url, not a url generated by nextJs or whatever JS magic