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

Feature Idea, feedback: Task Lists in GFM #126

Closed
brainlid opened this issue Feb 12, 2017 · 7 comments
Closed

Feature Idea, feedback: Task Lists in GFM #126

brainlid opened this issue Feb 12, 2017 · 7 comments

Comments

@brainlid
Copy link

brainlid commented Feb 12, 2017

I would like the Github flavored markdown feature of "Task Lists" to be supported in Earmark.

I am willing to try implementing it. I am proficient with Elixir.

I would like:

  • to find out how open the project is to receiving it as a PR
  • to get an idea of the relative complexity by those familiar with the project
  • pointers of where to begin

My interest is in making the simplest implementation possible. Essentially, detecting the - [ ] text pattern and making an unchecked checkbox and - [x] text for a checked one.

@brainlid
Copy link
Author

I'm using an alternative approach, so I don't need to create this feature myself now.

@walterbm
Copy link

@RobertDober I would be willing to work on this feature if the project maintainers think adding Tasks Lists is a good idea.

Some pointers on where to begin would be greatly appreciated though.

@RobertDober
Copy link
Collaborator

@walterbm It would be a nice feature to have for some applications, however, thinking about Earmark's main job, which is creating exdoc in HTML format, I believe it is not such a great idea.

Firstly, we would break backwards compatibility, and secondly task lists are not used in Elixir code documentation very often ;).

We also strive for some GFM/Common Mark compatibility, although we have tables and IAL and I prefer not to overload markdown with features. However...

...we have created a plugin system for that kind of features. Would you be interested in writing one?

@walterbm
Copy link

@RobertDober sure, I would be glad to help create a plugin for Task Lists.

From looking through the current documentation it seems that plugins require the markdown lines to be prefixed with $$. Would it be possible to make a plugin for GFM tasks lists - [ ] with no prefix? If so, how could I integrate such a plugin into Earmark's current plugin system?

@RobertDober
Copy link
Collaborator

RobertDober commented Mar 29, 2017

@walterbm Right now that is not possible, because of the simplicity of the plugin feature. I have no problem to make plugin backwards incompatible changes, and have already thought about better syntax. I could imagine the following syntax

# TODO
$$> Walter's Great Plugin
- [ ] foo the bar
...
$$<

Now your plugin will get the lines between $$> and $$< passed in and you could e.g. preprocess it to create raw html for the task list and then call Earmark.as_html with the preprocessed markdown and return it .

I am listening to alternative ideas with pleasure though, as long as we do not break non plugin using markdown.
And if you start writing your plugin now - gosh I sound like a salesman - I could incorporate your use case needs which might not have occurred to me 😊 into the next version.

@LostKobrakai
Copy link
Contributor

It would be nice if the readme would at least mention that gfm is only partially supported. Currently I'd expect it to enable all the gfm extentions.

@RobertDober
Copy link
Collaborator

@LostKobrakai sorry you were misslead, I'll have a look at that. Gfm is a fast moving target so I guess we should definitely clarify.

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

4 participants