The Craft Markdown and The GitHub Markdown

✍🏼 Written on Jan 19, 2022    💡 Updated on Jan 19, 2022
❗️ Note: it has been days since this article was written, please be aware of its timeliness
🖥  Note:This article is used to experiment with some issues with the Craft Markdown API, as I think some of its blocks are not converted correctly.

This article demonstrates the Markdown rendering effects on GitHub. This link shows the rendering on the Craft Web client, where the differences between the two are quite noticeable.

TITLES

Title

Subtitle

Heading

CONTENT

Strong

Body

Caption

GROUPS

Page

This is an empty page!

Card

This is an empty Card!


TEXT STYLE

Bold

Italic

Strikethrough

InlineCode

  • [ ] Todo

Toggle

  • Unordered List One

  • Unordered List Two

  1. Ordered List One

  2. Ordered List Two

Align Left

Align Center

Align Right

This is an indented sentence


DECORATIONS

Decorations Focus

Decorations Block

INSERT BLOCK

Plain Text

Table

Image

1
2
3
// Code Block with Javascript language

let CodeBlock = "Hello Craft!";
1
The Formula

Divider👇🏻





NESTING

Decoration Focus & Block

  1. Decoration Focus & List

  2. Decoration Block & List

…too many to show


My Thoughts

Key Points:

  1. Decorations, whether Focus or Block, should be converted to blockquote in Markdown syntax.

  2. Captions have no direct Markdown equivalent and should render as Body text, not as H5.

  3. Code blocks should include the language, like ```javascript.

  4. Nested lists, not flat lists!

Minor Details:

  1. Alignment can be ignored.

  2. Indentation can be ignored.

  3. Formulas… well, ignore those too.

My Plan?

I’ll create an npm package to accurately convert Craft data to GitHub Markdown 🤪.

Any suggestions?

- EOF -
Originally published at: The Craft Markdown and The GitHub Markdown - Xheldon Blog