-
Notifications
You must be signed in to change notification settings - Fork 13
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
convert .md to .adoc #1328
Comments
Python code is here: |
@vinniefalco What is boostlook? CSS that's already applied or something that needs to happen to the asciidoc itself? |
The markdown rendering is doing some stuff that might be lost in this process:
|
BoostLook is the name of a tool which styles the HTML generated by Asciidoctor and Antora, to give them a distinct and consistent look and feel. This is the repository: The look is achieved by enclosing conforming HTML in a div with As for code blocks and youtube embeds, we will need to understand how to express that in Asciidoc markdown. I believe code blocks are already handled. Not sure about the yt embeds. This page might prove helpful: https://docs.asciidoctor.org/asciidoc/latest/macros/audio-and-video/ |
What is the motivation for this? kramdoc doesn't convert our youtube embeds:
output:
That gets converted into a table by asciidoctor. I could do a regex substitution and replace instead before passing to kramdoc? I think that would be buggy and also convert youtube shortcodes in code blocks which would be wrong. I don't see any references to boostlook in this repo. |
If we go down the regex path, this is how asciidoctor wants youtube embeds: https://docs.asciidoctor.org/asciidoc/latest/macros/audio-and-video/#vimeo-and-youtube-videos |
Okay, I think before we get too deep in this we need to first manually port an .md file to adoc. The file should have the elements in question. So we should convert this one: https://raw.githubusercontent.com/boostorg/beast/refs/heads/develop/README.md Then once we agree on the conversion it should be more straightforward to write a script to automate that. Thoughts? |
Looking at the README.md for beast, there are no youtube embeds. It is just an image with a hyperlink. Can we do a straight conversion and keep it that way for now? Is there another Boost library that has an actual youtube embed in the README.md ? |
Just following up on this. We can do this if that’s what you want. I’m not sure if there’s a boost library that has an actual youtube embed in the README.me. If we don’t need to support youtube videos then we can do this. Otherwise, let’s check in on this. cc @rbbeeston |
A straight conversion can't possibly be wrong. If we want more, we can consider that later |
Markdown is a nightmare of a format with multiple incompatible dialects. Mistletoe, the current renderer, implements CommonMark. kramdown does not specify its dialect, but issues indicate it is not compatible with CommonMark: gettalong/kramdown#500 For example, consider this markdown document
mistletoe rendering:
kramdoc-asciidoctor | asciidoctor --embedded rendering:
The meaning has changed entirely! kramdoc doesn't interpret the Even when kramdoc doesn't interpret a symbol differently than CommonMark, it passes symbols through that would be literals in markdown but get processed and replaced by asciidoctor. Here is a difference in rendering of the beast readme. Ignore the style differences, this is with no CSS. First markdown, then kramdoc|asciidoctor: The pipe symbol in the text of the link gets interpreted as a table. Now, assuming you want to continue down this path, I have some questions: I see process_md used in two places: MarkdownTemplateView and Library.get_description. MarkdownTemplateView relies on frontmatter, while get_description strips and ignores it. Do you want both of these code paths to go through kramdown then asciidoctor? Do the markdown files processed by get_description actually have frontmatter that needs to be stripped? |
pandoc is another converter that may give better results because it supports CommonMark |
We only need to care about the dialect of markdown that GitHub uses |
Rob decided that we would only modify get_description and not MarkdownTemplateView. Also, we will not support frontmatter in get_description. We'll look at the output and decide if anything more needs to be done. I will experiment with pandoc to see if we get more usable results than kramdoc |
Use pandoc to convert markdown to asciidoc, then convert the asciidoc to html using asciidoctor. Fixes #1328
When the site renders markdown, such as README.md, it should first convert it to asciidoc, perhaps with this tool:
https://github.com/asciidoctor/kramdown-asciidoc
And then the resulting asciidoc should be rendered with asciidoc passed the "embedded" command line option, and have boostlook applied to its enclosing div.
Note: #1302 needs to be done first
The text was updated successfully, but these errors were encountered: