This blog renders markdown by
HTML::Pipeline that uses the Ruby library of CommonMark1: CommonMarker, which is GitHub’s fork of the reference parser for CommonMark.
CommonMark spec does not have specifications for Ruby Markup. For CommonMarker and the majority of the internet, you write the Ruby markup HTML directly in your markdown document:
However, I was blogging many Japanese posts which I would need to write a lot of HTML. It would be much nicer to have something easy to write the ruby markup.
I found this thread on CommonMark forum. They are discussing adding ruby syntax support in Markdown but they haven’t concluded yet. So I build my own. This is what I ended up using on this site:
<ruby> 漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp> </ruby>
Which looks like:
This works great for me because:
It looks like Markdown
It does not need to type any special brackets
It works when you want to add links
You can annotate each Kanji separately:
They can link separately:
Or link together:
It is open sourced at JuanitoFatas/html-pipeline-ruby_markup. Let me know if you have any feedback!