Closed MatteoRobbiati closed 1 year ago
With the most recent push I have uploaded a working solution for the markdown rendering.
Here we use some plugins for styling the code and the math formulas; in particular rehype-katex
, remark-math
and rehype-highlight
.
In order to show you how it appears, here we have the math's rendering:
and here the code's rendering:
These two solutions are implemented without needing to use any react component into the markdown file. This means that at this point a standard *.mdx
file is correctly fetched and rendered in the procedure written into pages/tutorials/[slug].js
.
This is useful in order to provide people with a simple tool while contributing.
Mathematical formulas are not perfect yet (you can see some errors in the rendering).
I have to understand how to write properly math into the markdown and, once understood, I will write a CONTRIBUTE.md
file in which I want to explain all the "proper manners" for contributions.
What do you think about this?
I will review this late on today, but it looks good enough :)
Sorry for the many messages!
Now also LaTeX is fixed: I removed all the extra \
from the markdown and now all is good.
This is because the plugins don't need any help to render LaTeX (they are created for that).
There are still leftover comments also from the old review
There are still leftover comments also from the old review
Thank you very much for the reviews. I'll try to fix all step by step.
@AleCandido I think that all the modifications are done.
There are some things to be fixed again (remark-gfm
, the extensions and some cleanings must be done).
But I think that this shape is workinig.
@AleCandido I think that all the modifications are done. There are some things to be fixed again (
remark-gfm
, the extensions and some cleanings must be done). But I think that this shape is workinig.
That's fine, just one small remark: next time, when you ask for review, add further features in separate PR (I refer to b51deee). It is more complicate to review a moving target, and if you believe to be ready to go, maybe the further bits do not belong to the same PR :)
That's fine, just one small remark: next time, when you ask for review, add further features in separate PR (I refer to b51deee). It is more complicate to review a moving target, and if you believe to be ready to go, maybe the further bits do not belong to the same PR :)
Yes, you're totally right. Thank you :)
With this PR I present a new method for highlighting the
*.mdx
files. I am using a react module calledSyntaxHighlighter
, which must be used inside the markdown writing. It seems to be more beautiful than the previous output.A remaining problem for displaying the tutorials is the #14.