# Introducing cr-cmark-gfm for advanced processing of Github Flavored Markdown

**URL:** <https://forum.crystal-lang.org/t/introducing-cr-cmark-gfm-for-advanced-processing-of-github-flavored-markdown/1241>\
**Category:** Community\
**Created:** [October 14, 2019, 9:26am UTC](https://forum.crystal-lang.org/t/introducing-cr-cmark-gfm-for-advanced-processing-of-github-flavored-markdown/1241 "2019-10-14T09:26:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amauryt](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/amauryt/32/1069_2.png) [@amauryt](https://forum.crystal-lang.org/u/amauryt)\
**Post date:** [October 14, 2019, 9:26am UTC](https://forum.crystal-lang.org/t/introducing-cr-cmark-gfm-for-advanced-processing-of-github-flavored-markdown/1241/1 "2019-10-14T09:26:04Z")

</div>

Hi everyone! I’m new to the Crystal community, but so far my experience has been really positive.

For a project I needed Markdown parsing and manipulation, with support for GFM and custom nodes. Given that I was already using Crystal I decided to create [cr-cmark-gfm](https://github.com/amauryt/cr-cmark-gfm) a shard that binds to the C cmark-gfm library.

Features:

- Simple parsing and rendering of markdown content
- Render any node of the markdown AST in the following formats:
  - HTML
  - XML
  - Plaintext
  - Commonmark (including GFM-only nodes)
  - Groff man pages
  - LaTeX

- Create custom renderers or customize the included crystal HTML renderer, which outputs the same HTML as the library’s C renderer
- Getters and setters for almost all of the properties of AST nodes
- Tree traversal and manipulation
- Directly create and customize nodes

The shard automatically downloads and compiles cmark-gfm and is fully documented, so it should be easy to give it a try.

Let me know what you think. 🙂

---

<div class="post-metadata">

**Author:** ![mavu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/mavu/32/213_2.png) [@mavu](https://forum.crystal-lang.org/u/mavu)\
**Post date:** [October 15, 2019, 7:27am UTC](https://forum.crystal-lang.org/t/introducing-cr-cmark-gfm-for-advanced-processing-of-github-flavored-markdown/1241/2 "2019-10-15T07:27:38Z")

</div>

That looks interesting.

Did you use some binding generator? And how well did that work if so?

---

<div class="post-metadata">

**Author:** ![paulcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/paulcsmith/32/301_2.png) [@paulcsmith](https://forum.crystal-lang.org/u/paulcsmith)\
**Post date:** [October 15, 2019, 3:52pm UTC](https://forum.crystal-lang.org/t/introducing-cr-cmark-gfm-for-advanced-processing-of-github-flavored-markdown/1241/3 "2019-10-15T15:52:11Z")

</div>

Looks awesome! I’m going to give this a go on [https://github.com/luckyframework/website](https://github.com/luckyframework/website)

We’ve wanted some of the features this seems to have. Thanks for making it!

---

<div class="post-metadata">

**Author:** ![amauryt](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/amauryt/32/1069_2.png) [@amauryt](https://forum.crystal-lang.org/u/amauryt)\
**Post date:** [October 16, 2019, 8:01am UTC](https://forum.crystal-lang.org/t/introducing-cr-cmark-gfm-for-advanced-processing-of-github-flavored-markdown/1241/4 "2019-10-16T08:01:51Z")

</div>

I didn’t use a binding generator. However both [crystal-cmark](https://github.com/ysbaddaden/crystal-cmark) and [crystal-cmark-gfm](https://github.com/mamantoha/crystal-cmark-gfm/blob/master/shard.yml), which I list as alternatives, used crystal\_lib. At the beginning I only needed some functions that were well documented on the man 3 pages of the library. However my as my needs grew, especially with the GFM extensions that are not as well documented, I had to rely more and more on the C source code.

---

<div class="post-metadata">

**Author:** ![amauryt](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/amauryt/32/1069_2.png) [@amauryt](https://forum.crystal-lang.org/u/amauryt)\
**Post date:** [October 16, 2019, 8:03am UTC](https://forum.crystal-lang.org/t/introducing-cr-cmark-gfm-for-advanced-processing-of-github-flavored-markdown/1241/5 "2019-10-16T08:03:35Z")

</div>

Hi Paul, love your work with Lucky. Let me know if you need more information or have issues using cr-cmark-gfm. I’ll be glad to help.
