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

feat: add task list support to markdown #3151

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions frontend/src/css/md.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,16 @@ This change includes accordions https://github.com/marimo-team/marimo/issues/221
button .prose.prose {
max-width: none;
}

/* Task list */

.prose .task-list-item {
list-style-type: none !important;
margin-top: 0.25rem;
margin-bottom: 0.25rem;
}

.prose .task-list-item input[type="checkbox"] {
margin: 0 0.5rem 0.25rem -1.6rem;
vertical-align: middle;
}
2 changes: 2 additions & 0 deletions marimo/_output/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def __init__(
"pymdownx.tilde",
# Better code blocks
"pymdownx.superfences",
# Task lists
"pymdownx.tasklist",
# Table of contents
# This adds ids to the HTML headers
"toc",
Expand Down
37 changes: 37 additions & 0 deletions marimo/_smoke_tests/markdown_pymdownx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import marimo

__generated_with = "0.9.34"
app = marimo.App(width="medium")


@app.cell
def _(mo):
mo.md(
r"""
Task List

- item
- [X] item 1
* [X] item A
* [ ] item B
more text
+ [x] item a
+ [ ] item b
+ [x] item c
* [X] item C
* non item
- [ ] item 2
- [ ] item 3
"""
)
return


@app.cell
def _():
import marimo as mo
return (mo,)


if __name__ == "__main__":
app.run()
Loading