@riebeckite/plugin-kanban 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/README_ja.md +6 -5
- package/dist/index.js +9 -10
- package/dist/src/runtime.d.ts +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
package/README_ja.md
CHANGED
|
@@ -20,10 +20,10 @@ export default defineConfig({
|
|
|
20
20
|
|
|
21
21
|
## ボードの書き方
|
|
22
22
|
|
|
23
|
-
入力は次の2通りです。
|
|
23
|
+
入力は次の 2 通りです。
|
|
24
24
|
|
|
25
25
|
- ` ```kanban ` のフェンスコードブロックの本文
|
|
26
|
-
-
|
|
26
|
+
- frontmatter に `kanban-plugin` を持つノートの本文(`autoDetect`、既定で有効)
|
|
27
27
|
|
|
28
28
|
どちらも本文の書き方は同じです。`## `(`columnMarker` で変更可)で始まる行が列を区切り、その後に続くリスト項目がカードになります。カードは `- [ ]`(未完了)、`- [x]`(完了)、`- テキスト`(チェックボックスなし)をそのまま扱います。
|
|
29
29
|
|
|
@@ -39,7 +39,7 @@ export default defineConfig({
|
|
|
39
39
|
- [x] フィクスチャを公開する
|
|
40
40
|
````
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
ノート全体をボードにする場合は、本文に同じ内容を書き、frontmatter に `kanban-plugin` を追加します。
|
|
43
43
|
|
|
44
44
|
```md
|
|
45
45
|
---
|
|
@@ -88,7 +88,7 @@ kanban-plugin: board
|
|
|
88
88
|
|
|
89
89
|
列でもリスト項目でもない行は、`fallback` を切らない限り `details.rb-kanban__fallback` にそのまま残ります。取りこぼしはありません。
|
|
90
90
|
|
|
91
|
-
列が1つもないなど解析に問題がある場合は、`@riebeckite/plugin-kanban` を発行元とするメッセージを文書に付与します。
|
|
91
|
+
列が 1 つもないなど解析に問題がある場合は、`@riebeckite/plugin-kanban` を発行元とするメッセージを文書に付与します。
|
|
92
92
|
|
|
93
93
|
## エクスポート
|
|
94
94
|
|
|
@@ -103,4 +103,5 @@ kanban-plugin: board
|
|
|
103
103
|
|
|
104
104
|
## 関連資料
|
|
105
105
|
|
|
106
|
-
- [プラグインガイド](../../../docs/ja/reference/plugin-api.md)
|
|
106
|
+
- [プラグインガイド](../../../docs/ja/docs/reference/plugin-api.md)
|
|
107
|
+
|
package/dist/index.js
CHANGED
|
@@ -233,11 +233,9 @@ function renderFallback(lines, options) {
|
|
|
233
233
|
// src/runtime.ts
|
|
234
234
|
function createKanbanRuntime(options) {
|
|
235
235
|
const markdownBySlug = /* @__PURE__ */ new Map();
|
|
236
|
-
const contentBySlug = /* @__PURE__ */ new Map();
|
|
237
236
|
return {
|
|
238
|
-
track(slug, markdown
|
|
237
|
+
track(slug, markdown) {
|
|
239
238
|
markdownBySlug.set(slug, markdown);
|
|
240
|
-
contentBySlug.set(slug, content);
|
|
241
239
|
},
|
|
242
240
|
resolve(manifest) {
|
|
243
241
|
const resolveLink = createKanbanLinkResolver(manifest);
|
|
@@ -245,26 +243,22 @@ function createKanbanRuntime(options) {
|
|
|
245
243
|
const markdown = markdownBySlug.get(entry.slug);
|
|
246
244
|
if (options.autoDetect && markdown !== void 0 && isKanbanNote(entry.frontmatter)) {
|
|
247
245
|
const parsed = parseKanban(stripFrontmatter(markdown), options);
|
|
248
|
-
applyHtml(entry,
|
|
246
|
+
applyHtml(entry, resolveLink, options, "note", parsed);
|
|
249
247
|
continue;
|
|
250
248
|
}
|
|
251
249
|
if (!entry.html.includes(KANBAN_ATTRIBUTE)) continue;
|
|
252
250
|
const html = replacePlaceholders(entry, options, resolveLink);
|
|
253
251
|
if (html !== entry.html) {
|
|
254
252
|
entry.html = html;
|
|
255
|
-
const content = contentBySlug.get(entry.slug);
|
|
256
|
-
if (content) content.html = html;
|
|
257
253
|
}
|
|
258
254
|
}
|
|
259
255
|
}
|
|
260
256
|
};
|
|
261
257
|
}
|
|
262
|
-
function applyHtml(entry,
|
|
258
|
+
function applyHtml(entry, resolveLink, options, source, parsed) {
|
|
263
259
|
const html = renderKanban(parsed, options, resolveLink, source);
|
|
264
260
|
if (html === entry.html) return;
|
|
265
261
|
entry.html = html;
|
|
266
|
-
const content = contentBySlug.get(entry.slug);
|
|
267
|
-
if (content) content.html = html;
|
|
268
262
|
}
|
|
269
263
|
function replacePlaceholders(entry, options, resolveLink) {
|
|
270
264
|
const pattern = createKanbanPlaceholderPattern();
|
|
@@ -280,13 +274,18 @@ function kanban(options = {}) {
|
|
|
280
274
|
const runtime = createKanbanRuntime(resolved);
|
|
281
275
|
return definePlugin({
|
|
282
276
|
name: "kanban",
|
|
277
|
+
processedContentCache: {
|
|
278
|
+
version: "kanban-v1",
|
|
279
|
+
dependencyMode: "none"
|
|
280
|
+
},
|
|
281
|
+
outputDependencies: [{ type: "global" }],
|
|
283
282
|
options,
|
|
284
283
|
validateOptions: validateKanbanOptions,
|
|
285
284
|
extendMarkdownPipeline: (pipeline) => {
|
|
286
285
|
pipeline.use(remarkKanban, resolved);
|
|
287
286
|
},
|
|
288
287
|
onPostProcessed: (context) => {
|
|
289
|
-
runtime.track(context.slug, context.markdown
|
|
288
|
+
runtime.track(context.slug, context.markdown);
|
|
290
289
|
},
|
|
291
290
|
onManifestCreated: (context) => {
|
|
292
291
|
runtime.resolve(context.manifest);
|
package/dist/src/runtime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ContentManifest
|
|
1
|
+
import type { ContentManifest } from "@riebeckite/core";
|
|
2
2
|
import type { ResolvedKanbanOptions } from "./types.js";
|
|
3
3
|
export type KanbanRuntime = {
|
|
4
|
-
track(slug: string, markdown: string
|
|
4
|
+
track(slug: string, markdown: string): void;
|
|
5
5
|
resolve(manifest: ContentManifest): void;
|
|
6
6
|
};
|
|
7
7
|
export declare function createKanbanRuntime(options: ResolvedKanbanOptions): KanbanRuntime;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-kanban",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@types/mdast": "^4.0.4",
|
|
19
19
|
"unist-util-visit": "^5.1.0",
|
|
20
|
-
"@riebeckite/core": "0.0.
|
|
20
|
+
"@riebeckite/core": "0.0.15"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|