diff --git a/markdoc.config.mjs b/markdoc.config.mjs index 7bf054fe..b04157fc 100644 --- a/markdoc.config.mjs +++ b/markdoc.config.mjs @@ -14,6 +14,10 @@ export default defineMarkdocConfig({ attributes: nodes.link.attributes, render: component("./src/components/ExternalLink.astro"), }, + list: { + attributes: nodes.list.attributes, + render: component("./src/components/content/List.astro"), + }, }, tags: { blockquote: { diff --git a/src/components/content/List.astro b/src/components/content/List.astro new file mode 100644 index 00000000..190524c6 --- /dev/null +++ b/src/components/content/List.astro @@ -0,0 +1,23 @@ +--- +let content = await Astro.slots.render("default"); + +const isTaskList = content.match(/\[ ]|\[x\]/g); +const classList = isTaskList ? "task-list" : ""; + +// We have GFM support at home +if (isTaskList && isTaskList.length > 0) { + content = content.replaceAll( + /
  • \[ ?\]/gm, + "
  • ", + ); + content = content.replaceAll( + "
  • [x]", + "
  • ", + ); + content = content.replaceAll("
  • ", "
  • "); +} +--- + + diff --git a/src/content/wiki/computers/zed-wishlist/zed-wishlist.mdoc b/src/content/wiki/computers/zed-wishlist/zed-wishlist.mdoc index fc8ca318..8552c279 100644 --- a/src/content/wiki/computers/zed-wishlist/zed-wishlist.mdoc +++ b/src/content/wiki/computers/zed-wishlist/zed-wishlist.mdoc @@ -18,8 +18,8 @@ I've recently been using the [Zed code editor](https://zed.dev/) and really enjo - [ ] Rainbow brackets - [ ] Indentation guides - [ ] Indentation guides in the explorer panel, too (especially, actually) -- [ ] Client-side filtering for LSP completions -- [ ] Image viewer +- [ ] Client-side filtering for LSP completions +- [ ] Image viewer ## Annoyances diff --git a/tailwind.config.ts b/tailwind.config.ts index ba31c5e2..25173e7b 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -412,6 +412,21 @@ export default { display: "block", }, + "article>ul, article>ol": { + margin: "0", + padding: "0", + paddingLeft: "1.5em", + }, + + "li>ul, li>ol": { + padding: "0", + paddingLeft: "1.5em", + }, + + ".task-list-item": { + listStyleType: "none", + }, + ".header-anchor": { color: "inherit", paddingLeft: "1.5ch",