MacDownApp / macdown

Open source Markdown editor for macOS.
https://macdown.uranusjr.com/
9.43k stars 1.09k forks source link

Make tasks more usable #225

Open colinfrei opened 9 years ago

colinfrei commented 9 years ago

Two suggestions for the task list:

uranusjr commented 9 years ago

Both are kind of planned, but not done yet due to various reasons.

The first one is purely cosmetic. I can add some CSS rules to hide the bullets, but I’m not sure whether that’s really necessary, and whether people really want that to happen. And if it does, the extra CSS should probably only exist when task list syntax is turned on. It’s all detail and the priority is so low I didn’t take much time thinking it though. But since it’s brought up I will probably plan it for the next version.

The second one is more involved. If you checked the code you’ll find that they are actually disabled intentionally. This is because I have not yet find a good (non-hacky) way to sync the actions in the preview back to the editor. GitHub uses an Ajax call to do that only when the changes are save to the server. To prove it, try adding a task list in the comment editor and look into the preview tab—the checkboxes won’t be clickable there. MacDown is more like the comment editor/preview combination than saved documents, so it would be pretty tedious to implement that.

With that said, I would definitely change this if given the needed tools. There are things planned to improve the current Markdown parser to convey better information to the original source, which would improve things vastly regarding this. We are working hard to make that happen. :smiley:

colinfrei commented 9 years ago

That it's only a preview makes sense, thanks for the feedback :)

johansen commented 9 years ago

I think dropping the bullets and making [ ] or [x] appear as a checkbox in the preview would be enough for my purposes. I don't mind if the checkboxes in preview aren't actually clickable---I just want my task list to look like a task list.

uranusjr commented 9 years ago

@johansen The bullet point is just a styling thing. Simplest way to customise is to add the following block to the top of your document:

<style>.task-list-item { list-style: none; }</style>

(Preemptive answer to inquiries about why this is not included by default: I had plans to rewrite all existing styles, but haven’t found the time to do so.)

johansen commented 9 years ago

Thanks for the style tip. It wouldn't turn [ ] into a checkbox widget, though, and I can't think of how you would do that using CSS.

uranusjr commented 9 years ago

I’m not quite sure what you mean by a “checkbox widget”. If you mean

MacDown can already render this (but it’ll be read-only, as previously mentioned). Check “Task list syntax” in the Rendering preference tab.

johansen commented 9 years ago

My apologies, somehow I missed the "Task list syntax" option

sealocal commented 8 years ago

I added that CSS rule to GitHub2.css

.task-list-item {
  list-style: none; }

Why not just merge that rule into GitHub2.css? Isn't the idea to mirror GFM as much as possible?

uranusjr commented 8 years ago

Because GitHub’s style is actually more involved that just that. Try mixing items with and without a checkbox and you’ll see what I mean.

But I guess I wouldn’t reject if someone sends a pull request.

AlexanderWillner commented 7 years ago

Plans to add a way to define an indeterminate checkbox, e.g., by using [-]?

FranklinYu commented 7 years ago

@AlexanderWillner I think it deserves its own issue, but there's no such plan yet.

ViggoV commented 6 years ago

I could really use these features. I love Macdown, but the ability to create functioning and github-compatible checklists would take it to the next level 👍