镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

To do lists #107

Closed
Closed

Description

@OscarGodson

https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments

To be honest, I'm not entirely sure if Markdown should support this or not. Seems very, very Github centric, but curious what your thoughts are.

Activity

  1. chjj commented on Jan 10, 2013

    @chjj
    Member

    Just testing so I can see the HTML.

  2. OscarGodson commented on Jan 10, 2013

    @OscarGodson
    Author

    Oh, weird. I can't click on your tasks at all. they're read only. Probably because, I'm assuming, when you check one it sends an edit XHR request and adds an "X" inside the bracket.

    • Get stuff done
    • Just testing myself
    • First time using them...
  3. chjj commented on Jan 10, 2013

    @chjj
    Member

    Yeah, you're right, that's very github specific. It generates checkboxes without a form. List items with certain data attr's and classes, catering to githubs specific stylesheet. Not to mention the js which adds the dynamic behavior. I see this as being really hard to standardize. ...maybe if they were renamed to just "GFM checkboxes" instead of "todo lists", since the "todo" list part entails the dynamic behavior.

    edit: Anyway, I'll leave this open if anyone else wants to comment.

  4. alekseykulikov commented on Jan 10, 2013

    @alekseykulikov

    I like the idea to simply render checkboxes using this markup. In app you can add event handler to manage specific behaviour. [ ] a task list item just parses to label with input. What do you think? Also we could think about wrapper around this checkboxes.

  5. TheCloudlessSky commented on Jan 15, 2013

    @TheCloudlessSky
    Contributor

    IMO - something like this would be good as an extension.

  6. leeoniya commented on Jan 17, 2013

    @leeoniya

    another option maybe would be to render them as unicode entities since there's no implied interaction...

    http://www.fileformat.info/info/unicode/char/2610/index.htm
    http://www.fileformat.info/info/unicode/char/2611/index.htm

  7. velsa commented on Jan 17, 2013

    @velsa

    But it would require a new markdown format for checkboxes, which is non standard even in gfm mode.
    I.e. [ ] for unchecked and [x] or [v] for checked
    Could be nice for showing todo lists with static marks..

  8. jessmartin commented on Jan 21, 2013

    @jessmartin

    I think this actually is useful, even in contexts where an HTML checkbox doesn't make sense.

    +1 for generating unicode characters as in here and here.

    In non-HTML environments, editors could choose to draw them as a bulleted list with strikethroughs for completed items.

    I've been hoping for someone to cross Taskpaper's text-based todo lists with Markdown for a little while, and this seems a little more user-friendly. Taskpaper requires you to add an @done tag to the end of each line, which makes scanning plaintext to see what is done w/o syntax highlighting somewhat difficult. The GFM syntax is arguably more readable.

    Yes, Github uses this feature to power some crazy custom features for Github Issues, but it's also generally useful.

  9. Mithgol commented on Feb 19, 2013

    @Mithgol
    Contributor

    Note: in GFM, [ ] (or [x]) has to be in the very beginning of a list item. (Only a whitespace may happen between the checkbox and the preceding bullet.) Bullets are not displayed for these lists (even for their items that do not start with checkboxes).

  10. Mithgol commented on Jul 3, 2013

    @Mithgol
    Contributor

    GitHub has announced (in June 25) that task lists are supported in gists as well as in repositories.

    This announcement widens (and generalizes) the area of their application, making more reasonable to support these lists in GFM-flavoured mode of marked.

  11. walterdavis commented on Jul 3, 2013

    @walterdavis

    I'm curious, though. If you do this, and there's no commensurate back-end to handle them, what good are they besides eye-candy? In Github, there is a running JavaScript observer waiting for you to click one of these, and backing that choice to a persistence layer somehow. Marked doesn't provide that, so who will?

    Walter

    On Jul 3, 2013, at 1:33 AM, Mithgol wrote:

    A week ago GitHub announced that task lists are supported in gists as well as in repositories.

    This announcement widens (and generalizes) the area of their application, making more reasonable to support these lists in GFM-flavoured mode of marked.

    —
    Reply to this email directly or view it on GitHub.

  12. Mithgol commented on Jul 3, 2013

    @Mithgol
    Contributor

    An eye-candy would already be as good as on GitHub where you cannot click other people's task lists (unless you are an owner of the repo).

  13. OscarGodson commented on Jul 3, 2013

    @OscarGodson
    Author

    and there's no commensurate back-end to handle them

    @walterdavis Marked doesn't provide any backend service at all. All it does is parse out HTML. Without a backend you can't save anything anyway. Even if it's just an H1, it doesn't persist in any way.

  14. walterdavis commented on Jul 3, 2013

    @walterdavis

    Right. That was my understanding as well, and I was asking to make the point that adding the GFM checkboxes only does half the job.

    Walter

    On Jul 3, 2013, at 12:37 PM, Oscar Godson wrote:

    and there's no commensurate back-end to handle them

    @walterdavis Marked doesn't provide any backend service at all. All it does is parse out HTML. Without a backend you can't save anything anyway. Even if it's just an H1, it doesn't persist in any way.

    —
    Reply to this email directly or view it on GitHub.

  15. 12 remaining items

  16. added a commit that references this issue on May 6, 2015
    91a1f7a
  17. jhollingworth commented on May 6, 2015

    @jhollingworth

    I've just opened #587 which should resolve this issue

  18. added a commit that references this issue on Apr 24, 2016
    da821a9
  19. added a commit that references this issue on Sep 8, 2016
    bf39349
  20. jungor commented on Feb 6, 2017

    @jungor

    This works for me...

    renderer.listitem = function (text, level) {
      let isCheckedTaskItem = checkedTaskItemPtn.test(text);
      let isUncheckedTaskItem = uncheckedTaskItemPtn.test(text);
      if (isCheckedTaskItem) text = text.replace(checkedTaskItemPtn, '<i class="fa fa-check-square" aria-hidden="true"></i>')+'\n';
      if (isUncheckedTaskItem) text = text.replace(uncheckedTaskItemPtn, '<i class="fa fa-square-o" aria-hidden="true"></i>')+'\n';
      let cls = (isCheckedTaskItem || isUncheckedTaskItem) ? ' class="todo-list-item"' : '';
      return '<li'+ cls + '>' + text + '</li>\n';
    };

    I use icons from fontawesome, but can just use html checkbox simply, of course. Don't remember to create you own marked.Renderer instance and make config right.

  21. joshbruce commented on Dec 3, 2017

    @joshbruce
    Member
  22. joshbruce commented on Dec 3, 2017

    @joshbruce
    Member

    Closing as it appears a fix was merged, but may not be working.

  23. locked as resolved and limited conversation to collaborators on May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions