mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
776 stars 146 forks source link

Feature request: parse GitHub checkbox syntax #30

Closed ec1oud closed 5 years ago

ec1oud commented 6 years ago

Another reason I want to add Markdown support to Qt is to enable combined notes and TODO lists like Evernote has, to be able to edit GitHub README.md files, etc.

https://github.com/blog/1825-task-lists-in-all-markdown-documents

As they show there, the syntax is

### Solar System Exploration, 1950s – 1960s

- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [ ] Jupiter
- [ ] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley

Solar System Exploration, 1950s – 1960s

It won't be quite so easy to add support for checking and unchecking them to any Qt text-editing component, but I'd like to try.

Currently for my personal todo lists and shopping lists etc., I use todo.txt format (https://f-droid.org/packages/nl.mpcjanssen.simpletask/ and https://f-droid.org/packages/com.nutomic.syncthingandroid/ are a good combination for this); but it has the disadvantage of not being able to mix free-form notes with the checklists. So I think markdown will be better.

mity commented 6 years ago

This is in my to do list, but I cannot promise when it gets implemnted.

ec1oud commented 6 years ago

Cool!

mity commented 5 years ago

It won't be quite so easy to add support for checking and unchecking them to any Qt text-editing component, but I'd like to try.

@ec1oud Please take a look at PR #50 and MD_BLOCK_LI_DETAIL. It provides offset of the character between [ and ] so app should know what to change in the source doc. Is it usable for your purposes this way?

ec1oud commented 5 years ago

I got it working in Qt. Thanks!

https://codereview.qt-project.org/#/c/252383/