This commit is contained in:
@@ -48,7 +48,26 @@ BEGIN {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<li>" content "</li>"
|
has_checkbox = 0
|
||||||
|
if (content ~ /^\[[ \t]\] /) {
|
||||||
|
has_checkbox = 1
|
||||||
|
is_checked = 0
|
||||||
|
sub(/^\[[ \t]\] /, "", content)
|
||||||
|
} else if (content ~ /^\[[xX]\] /) {
|
||||||
|
has_checkbox = 1
|
||||||
|
is_checked = 1
|
||||||
|
sub(/^\[[xX]\] /, "", content)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (has_checkbox) {
|
||||||
|
if (is_checked) {
|
||||||
|
print "<li class=\"task-list-item\"><input type=\"checkbox\" class=\"task-list-item-checkbox\" checked disabled> " content "</li>"
|
||||||
|
} else {
|
||||||
|
print "<li class=\"task-list-item\"><input type=\"checkbox\" class=\"task-list-item-checkbox\" disabled> " content "</li>"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print "<li>" content "</li>"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
while (depth > 0) {
|
while (depth > 0) {
|
||||||
print "</" cur_type[depth] ">"
|
print "</" cur_type[depth] ">"
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ It's meant to be a static site generator, like _[kew](https://github.com/uint23/
|
|||||||
- Automatic inlining and embedding of many filetypes with `\![link]` or `\`
|
- Automatic inlining and embedding of many filetypes with `\![link]` or `\`
|
||||||
- Inline html support
|
- Inline html support
|
||||||
- MFM `$font` and `\<plain>` tags
|
- MFM `$font` and `\<plain>` tags
|
||||||
- Admonition support (that's what the blocks like the warning block below are called)
|
- GFM Admonition support (that's what the blocks like the warning block below are called)
|
||||||
|
- Task list support (`- [ ]`, `- [x]`)
|
||||||
- RSS/Feed generation and Sitemap support
|
- RSS/Feed generation and Sitemap support
|
||||||
- Post creation via `--post`
|
- Post creation via `--post`
|
||||||
- Automatic 404 page generation
|
- Automatic 404 page generation
|
||||||
|
|||||||
@@ -274,3 +274,12 @@ hr {
|
|||||||
padding-top: 30px;
|
padding-top: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.task-list-item {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-list-item-checkbox {
|
||||||
|
margin: 0 0.2em 0.25em -1.6em;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user