Skip to content
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

Extensions are not documented #52

Closed
safinaskar opened this issue Sep 26, 2017 · 4 comments
Closed

Extensions are not documented #52

safinaskar opened this issue Sep 26, 2017 · 4 comments

Comments

@safinaskar
Copy link

https://github.com/github/markup/blob/master/lib/github/markup/markdown.rb contains this:

CommonMarker.render_html(content, :GITHUB_PRE_LANG, [:tagfilter, :autolink, :table, :strikethrough])

What are this :tagfilter, :autolink, :table, :strikethrough? Extensions? Why they are not documented? I tried to grep sources for strikethrough, but I didn't find any documentation. If you don't want to document them, then at least please state its existence. Say in README that there is such thing as extension and one can pass list of extensions as a third argument to CommonMarker.render_html.

Also, it seems that libcmark doesn't support this extensions. So, this means that commonmarker is not simple wrapper for libcmark, commonmarker add significant additions to libcmark. So, this means that very first sentence of README is wrong (i. e. "Ruby wrapper for libcmark, the reference parser for CommonMark"). You should write instead that commonmarker is, say, "wrapper with extensions".

@blackst0ne
Copy link
Contributor

I just came here while searching how to enable the table extension.
+1 from me.

@safinaskar
Copy link
Author

I still don't understand one thing. https://githubengineering.com/a-formal-spec-for-github-markdown/ says that github forked cmark for implementing extensions. So,

  • This commonmarker lib depends on forked cmark. So, this commonmarker don't implement extension on its own, it simply uses extensions from forked cmark?
  • Or this commonmarker lib depends on any cmark and implements extenstions on its own?
  • Or any other option?

@kivikakk
Copy link
Collaborator

commonmarker depends on the forked cmark; see the submodule in the vendor directory.

We (GitHub) use this exact gem as part of github.com; when you require 'commonmarker', you're doing the precise same thing we're doing; the extensions in our forked cmark are consumed through commonmarker.

@safinaskar
Copy link
Author

@kivikakk , thanks a lot for your answer. Please, write this in README. The very first sentence of the current README ("Ruby wrapper for libcmark") is wrong. If you need precise wording, you may take this:

--- README.md	2017-10-13 14:03:56.789326051 +0300
+++ R	2017-10-13 14:07:27.646749515 +0300
@@ -2,8 +2,8 @@
 
 [![Build Status](https://travis-ci.org/gjtorikian/commonmarker.svg)](https://travis-ci.org/gjtorikian/commonmarker) [![Gem Version](https://badge.fury.io/rb/commonmarker.svg)](http://badge.fury.io/rb/commonmarker)
 
-Ruby wrapper for [libcmark](https://github.com/jgm/CommonMark),
-the reference parser for CommonMark. It passes all of the C tests, and is therefore spec-complete. It also provides unique extensions to the CommonMark spec, such as support for tables, strikethroughs, and autolinking.
+Ruby wrapper for [Github's fork of libcmark](https://github.com/github/cmark),
+the reference parser for CommonMark. It passes all of the C tests, and is therefore spec-complete. It also provides unique extensions to the CommonMark spec (using code from Github's fork of libcmark), such as support for tables, strikethroughs, and autolinking.
 
 For more information on available extensions, see [the documentation below](#extensions).
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants