New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use markd for markdown rendering in the compiler #11040
Use markd for markdown rendering in the compiler #11040
Conversation
git-subtree-dir: lib/markd git-subtree-split: edde8d8990452b9a568016f8ef62f3d595e19d99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! And it's so much better than my headlong attempt. Thank you! ❤️
Glad the final chosen approach iswith Hopefully the Readme and License will remind us to submit patches upstream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 💯 Thank you @straight-shoota 🙏
The newly generated docs are already live at https://crystal-lang.org/api/master/ Please let us know about any issues with the new renderer, discovered on https://crystal-lang.org/api/master/ or while building shards. |
Good news! I am happy to make this happened 😄 |
This is a revival of #8174, pulling in https://github.com/icyleaf/markd/ and using it for markdown rendering in the docs generator and playground.
The markdown implementation we're currently using was previously part of the standard library but got yanked because it's broken. We still used it in the compiler. This finally replaces it with a dedicated library that is proven to work well.
To avoid external dependencies for the compiler, the markd shard is vendored into the Crystal repository using
git subtree
. The entire code is embedded in the repository, but it's easy to pull in upstream changes usinggit subtree pull
.The first two commits are just git subtree pulling in the code from markd.
Only the third commit is interesting for review, integrates markd with the compiler and adds specs to make sure the output is as expected and the mentioned bugs are indeed fixed.
The generated docs HTML is mostly identical with the previous implementation, except for some insignificant white space changes and more encoded special characters. And of course, a lot of broken behaviour is fixed.
Resolves #4613
Fixes #7009
Fixes #7463
Fixes #10058
NOTE: This must not be squash merged to keep the commit information for git subtree.