Skip to content

Commit

Permalink
feat: add task list support to markdown (#3151)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscolnick authored Dec 12, 2024
1 parent a75baf6 commit 8defa6d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
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()

0 comments on commit 8defa6d

Please sign in to comment.