Color mode

Kanban

Render Obsidian Kanban boards as static HTML at build time. No client-side JavaScript is required.

日本語

Overview

kanban() turns kanban markdown into a board. It accepts two kinds of input:

  • The body of a ```kanban fenced code block.
  • A whole note whose frontmatter contains kanban-plugin (enabled by autoDetect, on by default).

Columns are lines that start with ## (configurable with columnMarker). Every list item that follows becomes a card: - [ ] text (unchecked), - [x] text (checked), or a plain - text item.

Card text supports inline [[wikilinks]] (resolved to real hrefs from the content manifest), #tags, and simple **bold** emphasis.

Usage

ts
import { defineConfig } from "@riebeckite/core";
import { kanban } from "@riebeckite/plugin-kanban";
 
export default defineConfig({
  // ...
  plugins: [kanban()],
});

Board syntax

md
## Backlog
 
- [ ] Draft the release notes
- [ ] Link to [[index]]
- [x] Review **metadata**
 
## Done
 
- [x] Publish the fixture

A note that is itself a board looks the same, with the board written directly in the body and kanban-plugin set in the frontmatter:

md
---
title: Roadmap
kanban-plugin: board
---
 
## Planned
 
- [ ] Ship the plugin

Output

html
<div class="rb-kanban" data-kanban data-kanban-plugin data-kanban-source="note">
  <div class="rb-kanban__board" data-kanban-board>
    <div class="rb-kanban__column" data-column="Backlog">
      <header class="rb-kanban__column-title">Backlog</header>
      <ul class="rb-kanban__cards">
        <li class="rb-kanban__card" data-checked="false">
          <span class="rb-kanban__checkbox" data-checked="false" aria-hidden="true"></span>
          <span class="rb-kanban__card-text">Draft the release notes</span>
        </li>
      </ul>
    </div>
  </div>
</div>

data-kanban-source is "block" for a fenced block and "note" for an auto-detected note.

Options

Option Type Default Description
className string "rb-kanban" Root CSS class; block names derive from it
language string "kanban" Fence language to target
columnMarker string "##" Prefix that starts a column
autoDetect boolean true Render notes with kanban-plugin frontmatter
fallback boolean true Keep unsupported lines in a <details> fallback

Fallback and diagnostics

Lines that are neither a column nor a list item are kept verbatim inside details.rb-kanban__fallback when fallback is enabled, so nothing is lost.

Parse problems (for example a block with no columns) are attached to the document with a @riebeckite/plugin-kanban message.

Exports

  • kanban(options?) — plugin factory
  • kanbanPlugin — alias of kanban
  • resolveKanbanOptions(options?) — apply defaults
  • remarkKanban(options?) — remark transform used by the plugin
  • parseKanban(source, options), renderKanban(result, options, resolveLink, source)
  • stripFrontmatter(markdown), isKanbanNote(frontmatter)
  • createKanbanLinkResolver(manifest), createKanbanPlaceholder(source)
  • Types: KanbanOptions, ResolvedKanbanOptions, KanbanCard, KanbanColumn, KanbanParseResult, KanbanLinkResolver, RemarkKanbanOptions

See also

History

1 changesCollapseExpand
1 + <!-- Generated from packages/plugins/kanban/README.md. Do not edit this page directly; edit the package README and run `pnpm docs:sync`. -->
2 +
3 + # Kanban
4 +
5 + Render Obsidian Kanban boards as static HTML at build time. No client-side
6 + JavaScript is required.
7 +
8 + [日本語](./kanban.md)
9 +
10 + ## Overview
11 +
12 + `kanban()` turns kanban markdown into a board. It accepts two kinds of input:
13 +
14 + - The body of a ` ```kanban ` fenced code block.
15 + - A whole note whose frontmatter contains `kanban-plugin` (enabled by
16 + `autoDetect`, on by default).
17 +
18 + Columns are lines that start with `## ` (configurable with `columnMarker`).
19 + Every list item that follows becomes a card: `- [ ] text` (unchecked),
20 + `- [x] text` (checked), or a plain `- text` item.
21 +
22 + Card text supports inline `[[wikilinks]]` (resolved to real hrefs from the
23 + content manifest), `#tags`, and simple `**bold**` emphasis.
24 +
25 + ## Usage
26 +
27 + ```ts
28 + import { defineConfig } from "@riebeckite/core";
29 + import { kanban } from "@riebeckite/plugin-kanban";
30 +
31 + export default defineConfig({
32 + // ...
33 + plugins: [kanban()],
34 + });
35 + ```
36 +
37 + ## Board syntax
38 +
39 + ````md
40 + ## Backlog
41 +
42 + - [ ] Draft the release notes
43 + - [ ] Link to [[index]]
44 + - [x] Review **metadata**
45 +
46 + ## Done
47 +
48 + - [x] Publish the fixture
49 + ````
50 +
51 + A note that is itself a board looks the same, with the board written directly
52 + in the body and `kanban-plugin` set in the frontmatter:
53 +
54 + ```md
55 + ---
56 + title: Roadmap
57 + kanban-plugin: board
58 + ---
59 +
60 + ## Planned
61 +
62 + - [ ] Ship the plugin
63 + ```
64 +
65 + ## Output
66 +
67 + ```html
68 + <div class="rb-kanban" data-kanban data-kanban-plugin data-kanban-source="note">
69 + <div class="rb-kanban__board" data-kanban-board>
70 + <div class="rb-kanban__column" data-column="Backlog">
71 + <header class="rb-kanban__column-title">Backlog</header>
72 + <ul class="rb-kanban__cards">
73 + <li class="rb-kanban__card" data-checked="false">
74 + <span class="rb-kanban__checkbox" data-checked="false" aria-hidden="true"></span>
75 + <span class="rb-kanban__card-text">Draft the release notes</span>
76 + </li>
77 + </ul>
78 + </div>
79 + </div>
80 + </div>
81 + ```
82 +
83 + `data-kanban-source` is `"block"` for a fenced block and `"note"` for an
84 + auto-detected note.
85 +
86 + ## Options
87 +
88 + | Option | Type | Default | Description |
89 + | --- | --- | --- | --- |
90 + | `className` | `string` | `"rb-kanban"` | Root CSS class; block names derive from it |
91 + | `language` | `string` | `"kanban"` | Fence language to target |
92 + | `columnMarker` | `string` | `"##"` | Prefix that starts a column |
93 + | `autoDetect` | `boolean` | `true` | Render notes with `kanban-plugin` frontmatter |
94 + | `fallback` | `boolean` | `true` | Keep unsupported lines in a `<details>` fallback |
95 +
96 + ## Fallback and diagnostics
97 +
98 + Lines that are neither a column nor a list item are kept verbatim inside
99 + `details.rb-kanban__fallback` when `fallback` is enabled, so nothing is lost.
100 +
101 + Parse problems (for example a block with no columns) are attached to the
102 + document with a `@riebeckite/plugin-kanban` message.
103 +
104 + ## Exports
105 +
106 + - `kanban(options?)` — plugin factory
107 + - `kanbanPlugin` — alias of `kanban`
108 + - `resolveKanbanOptions(options?)` — apply defaults
109 + - `remarkKanban(options?)` — remark transform used by the plugin
110 + - `parseKanban(source, options)`, `renderKanban(result, options, resolveLink, source)`
111 + - `stripFrontmatter(markdown)`, `isKanbanNote(frontmatter)`
112 + - `createKanbanLinkResolver(manifest)`, `createKanbanPlaceholder(source)`
113 + - Types: `KanbanOptions`, `ResolvedKanbanOptions`, `KanbanCard`, `KanbanColumn`,
114 + `KanbanParseResult`, `KanbanLinkResolver`, `RemarkKanbanOptions`
115 +
116 + ## See also
117 +
118 + - [Plugin guide](../reference/plugin-api.en.md)
119 +

Local Graph

Nearby Notes

Open in Explorer →
kanban.enRiebeckite
CurrentOutgoingBacklink