@riebeckite/plugin-daily-notes 0.0.12 → 0.0.14
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 +74 -74
- package/README_ja.md +66 -66
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
# @riebeckite/plugin-daily-notes
|
|
2
|
-
|
|
3
|
-
Surfaces short snippets extracted from Daily Notes as a site widget.
|
|
4
|
-
|
|
5
|
-
[日本語](./README_ja.md)
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
A Daily Note is often one long, private journal file. This plugin reads the raw
|
|
10
|
-
manifest, picks notes under a configured directory, and extracts exactly one
|
|
11
|
-
short snippet per note using the first successful strategy:
|
|
12
|
-
|
|
13
|
-
1. a frontmatter key (`daily-summary` by default),
|
|
14
|
-
2. a section under a heading (`今日のひとこと` by default),
|
|
15
|
-
3. a fenced code block (`daily-snippet` by default).
|
|
16
|
-
|
|
17
|
-
When every strategy fails the note is skipped. The note body is never emitted
|
|
18
|
-
wholesale, so a long private note only contributes the snippet that opted in.
|
|
19
|
-
|
|
20
|
-
`sourceUrl` and `sourceTitle` are attached only when `isPublished` accepts the
|
|
21
|
-
note. An unpublished note's permalink and title stay `null`, so private notes
|
|
22
|
-
never leak their location.
|
|
23
|
-
|
|
24
|
-
## Usage
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
import { defineConfig } from "@riebeckite/core";
|
|
28
|
-
import { dailyNotesPlugin } from "@riebeckite/plugin-daily-notes";
|
|
29
|
-
|
|
30
|
-
export default defineConfig({
|
|
31
|
-
// ...
|
|
32
|
-
plugins: [dailyNotesPlugin()],
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Render the widget
|
|
37
|
-
|
|
38
|
-
```tsx
|
|
39
|
-
import DailyNotes, { getDailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
40
|
-
|
|
41
|
-
const notes = getDailyNotes({ manifest, config });
|
|
42
|
-
|
|
43
|
-
return <DailyNotes notes={notes} />;
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
`getDailyNotes` reads `manifest.entries` (the raw view), sorts newest first,
|
|
47
|
-
and applies the default limit of 5. Pass `options` to override the location or
|
|
48
|
-
the extraction strategy:
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
getDailyNotes({
|
|
52
|
-
manifest,
|
|
53
|
-
config,
|
|
54
|
-
options: {
|
|
55
|
-
source: { directory: "Daily", pathPattern: "Daily/{YYYY}-{MM}-{DD}" },
|
|
56
|
-
extract: { frontmatter: "daily-summary", section: "今日のひとこと" },
|
|
57
|
-
widget: { limit: 3 },
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Set a strategy to `false` to disable it. `pathPattern` supports `{YYYY}`,
|
|
63
|
-
`{MM}`, `{DD}`, and `*` so a note filename can be matched precisely.
|
|
64
|
-
|
|
65
|
-
## Exports
|
|
66
|
-
|
|
67
|
-
- `dailyNotesPlugin(options?)` — plugin factory (registers `style.css`)
|
|
68
|
-
- `getDailyNotes({ manifest, config, options? })` — sorted `DailyNote[]`
|
|
69
|
-
- `DailyNotes` — widget component (`{ notes, limit? }`)
|
|
70
|
-
- Types: `DailyNote`, `DailyNotesOptions`, `ResolvedDailyNotesExtract`
|
|
71
|
-
|
|
72
|
-
## See also
|
|
73
|
-
|
|
74
|
-
- [Plugin guide](../../../docs/en/plugin-
|
|
1
|
+
# @riebeckite/plugin-daily-notes
|
|
2
|
+
|
|
3
|
+
Surfaces short snippets extracted from Daily Notes as a site widget.
|
|
4
|
+
|
|
5
|
+
[日本語](./README_ja.md)
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
A Daily Note is often one long, private journal file. This plugin reads the raw
|
|
10
|
+
manifest, picks notes under a configured directory, and extracts exactly one
|
|
11
|
+
short snippet per note using the first successful strategy:
|
|
12
|
+
|
|
13
|
+
1. a frontmatter key (`daily-summary` by default),
|
|
14
|
+
2. a section under a heading (`今日のひとこと` by default),
|
|
15
|
+
3. a fenced code block (`daily-snippet` by default).
|
|
16
|
+
|
|
17
|
+
When every strategy fails the note is skipped. The note body is never emitted
|
|
18
|
+
wholesale, so a long private note only contributes the snippet that opted in.
|
|
19
|
+
|
|
20
|
+
`sourceUrl` and `sourceTitle` are attached only when `isPublished` accepts the
|
|
21
|
+
note. An unpublished note's permalink and title stay `null`, so private notes
|
|
22
|
+
never leak their location.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { defineConfig } from "@riebeckite/core";
|
|
28
|
+
import { dailyNotesPlugin } from "@riebeckite/plugin-daily-notes";
|
|
29
|
+
|
|
30
|
+
export default defineConfig({
|
|
31
|
+
// ...
|
|
32
|
+
plugins: [dailyNotesPlugin()],
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Render the widget
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import DailyNotes, { getDailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
40
|
+
|
|
41
|
+
const notes = getDailyNotes({ manifest, config });
|
|
42
|
+
|
|
43
|
+
return <DailyNotes notes={notes} />;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`getDailyNotes` reads `manifest.entries` (the raw view), sorts newest first,
|
|
47
|
+
and applies the default limit of 5. Pass `options` to override the location or
|
|
48
|
+
the extraction strategy:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
getDailyNotes({
|
|
52
|
+
manifest,
|
|
53
|
+
config,
|
|
54
|
+
options: {
|
|
55
|
+
source: { directory: "Daily", pathPattern: "Daily/{YYYY}-{MM}-{DD}" },
|
|
56
|
+
extract: { frontmatter: "daily-summary", section: "今日のひとこと" },
|
|
57
|
+
widget: { limit: 3 },
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Set a strategy to `false` to disable it. `pathPattern` supports `{YYYY}`,
|
|
63
|
+
`{MM}`, `{DD}`, and `*` so a note filename can be matched precisely.
|
|
64
|
+
|
|
65
|
+
## Exports
|
|
66
|
+
|
|
67
|
+
- `dailyNotesPlugin(options?)` — plugin factory (registers `style.css`)
|
|
68
|
+
- `getDailyNotes({ manifest, config, options? })` — sorted `DailyNote[]`
|
|
69
|
+
- `DailyNotes` — widget component (`{ notes, limit? }`)
|
|
70
|
+
- Types: `DailyNote`, `DailyNotesOptions`, `ResolvedDailyNotesExtract`
|
|
71
|
+
|
|
72
|
+
## See also
|
|
73
|
+
|
|
74
|
+
- [Plugin guide](../../../docs/en/reference/plugin-api.md)
|
package/README_ja.md
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
# @riebeckite/plugin-daily-notes
|
|
2
|
-
|
|
3
|
-
デイリーノートから短いスニペットを取り出してサイトのウィジェットとして表示するプラグインです。
|
|
4
|
-
|
|
5
|
-
[English](./README.md)
|
|
6
|
-
|
|
7
|
-
## 概要
|
|
8
|
-
|
|
9
|
-
デイリーノートは、長い非公開の日記を 1 ファイルにまとめることが少なくありません。このプラグインは生のマニフェストを読み、指定ディレクトリ配下のノートを対象に、次の順番で最初に成功した方法からスニペットを 1 つだけ取り出します。
|
|
10
|
-
|
|
11
|
-
1. frontmatter のキー(既定は `daily-summary`)
|
|
12
|
-
2. 見出しで示した節(既定は `今日のひとこと`)
|
|
13
|
-
3. コードブロック(既定は `daily-snippet`)
|
|
14
|
-
|
|
15
|
-
すべて失敗したノートは表示せず、本文を丸ごと出すこともありません。長い非公開ノートは、スニペットとして明示した部分だけを提供します。
|
|
16
|
-
|
|
17
|
-
`sourceUrl` と `sourceTitle` は `isPublished` が公開と判定したときだけ付きます。非公開ノートのパーマリンクとタイトルは `null` のままなので、置き場所が漏れることはありません。
|
|
18
|
-
|
|
19
|
-
## 使い方
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
import { defineConfig } from "@riebeckite/core";
|
|
23
|
-
import { dailyNotesPlugin } from "@riebeckite/plugin-daily-notes";
|
|
24
|
-
|
|
25
|
-
export default defineConfig({
|
|
26
|
-
// ...
|
|
27
|
-
plugins: [dailyNotesPlugin()],
|
|
28
|
-
});
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### ウィジェットを置く
|
|
32
|
-
|
|
33
|
-
```tsx
|
|
34
|
-
import DailyNotes, { getDailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
35
|
-
|
|
36
|
-
const notes = getDailyNotes({ manifest, config });
|
|
37
|
-
|
|
38
|
-
return <DailyNotes notes={notes} />;
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
`getDailyNotes` は生の `manifest.entries` を読み、新しい順に並べ、既定の上限 5 件に絞ります。場所や抽出方法を変えたいときは `options` を渡します。
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
getDailyNotes({
|
|
45
|
-
manifest,
|
|
46
|
-
config,
|
|
47
|
-
options: {
|
|
48
|
-
source: { directory: "Daily", pathPattern: "Daily/{YYYY}-{MM}-{DD}" },
|
|
49
|
-
extract: { frontmatter: "daily-summary", section: "今日のひとこと" },
|
|
50
|
-
widget: { limit: 3 },
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
方法を `false` にすると、その抽出を無効にできます。`pathPattern` では `{YYYY}`、`{MM}`、`{DD}`、`*` が使え、ノートのファイル名を厳密に絞り込めます。
|
|
56
|
-
|
|
57
|
-
## 主なエクスポート
|
|
58
|
-
|
|
59
|
-
- `dailyNotesPlugin(options?)`: プラグインを作る(`style.css` を登録する)
|
|
60
|
-
- `getDailyNotes({ manifest, config, options? })`: 並べ替え済みの `DailyNote[]` を返す
|
|
61
|
-
- `DailyNotes`: ウィジェットのコンポーネント(`{ notes, limit? }`)
|
|
62
|
-
- 型: `DailyNote`、`DailyNotesOptions`、`ResolvedDailyNotesExtract`
|
|
63
|
-
|
|
64
|
-
## 関連資料
|
|
65
|
-
|
|
66
|
-
- [プラグインシステム](../../../docs/ja/plugin-
|
|
1
|
+
# @riebeckite/plugin-daily-notes
|
|
2
|
+
|
|
3
|
+
デイリーノートから短いスニペットを取り出してサイトのウィジェットとして表示するプラグインです。
|
|
4
|
+
|
|
5
|
+
[English](./README.md)
|
|
6
|
+
|
|
7
|
+
## 概要
|
|
8
|
+
|
|
9
|
+
デイリーノートは、長い非公開の日記を 1 ファイルにまとめることが少なくありません。このプラグインは生のマニフェストを読み、指定ディレクトリ配下のノートを対象に、次の順番で最初に成功した方法からスニペットを 1 つだけ取り出します。
|
|
10
|
+
|
|
11
|
+
1. frontmatter のキー(既定は `daily-summary`)
|
|
12
|
+
2. 見出しで示した節(既定は `今日のひとこと`)
|
|
13
|
+
3. コードブロック(既定は `daily-snippet`)
|
|
14
|
+
|
|
15
|
+
すべて失敗したノートは表示せず、本文を丸ごと出すこともありません。長い非公開ノートは、スニペットとして明示した部分だけを提供します。
|
|
16
|
+
|
|
17
|
+
`sourceUrl` と `sourceTitle` は `isPublished` が公開と判定したときだけ付きます。非公開ノートのパーマリンクとタイトルは `null` のままなので、置き場所が漏れることはありません。
|
|
18
|
+
|
|
19
|
+
## 使い方
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { defineConfig } from "@riebeckite/core";
|
|
23
|
+
import { dailyNotesPlugin } from "@riebeckite/plugin-daily-notes";
|
|
24
|
+
|
|
25
|
+
export default defineConfig({
|
|
26
|
+
// ...
|
|
27
|
+
plugins: [dailyNotesPlugin()],
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### ウィジェットを置く
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import DailyNotes, { getDailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
35
|
+
|
|
36
|
+
const notes = getDailyNotes({ manifest, config });
|
|
37
|
+
|
|
38
|
+
return <DailyNotes notes={notes} />;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`getDailyNotes` は生の `manifest.entries` を読み、新しい順に並べ、既定の上限 5 件に絞ります。場所や抽出方法を変えたいときは `options` を渡します。
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
getDailyNotes({
|
|
45
|
+
manifest,
|
|
46
|
+
config,
|
|
47
|
+
options: {
|
|
48
|
+
source: { directory: "Daily", pathPattern: "Daily/{YYYY}-{MM}-{DD}" },
|
|
49
|
+
extract: { frontmatter: "daily-summary", section: "今日のひとこと" },
|
|
50
|
+
widget: { limit: 3 },
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
方法を `false` にすると、その抽出を無効にできます。`pathPattern` では `{YYYY}`、`{MM}`、`{DD}`、`*` が使え、ノートのファイル名を厳密に絞り込めます。
|
|
56
|
+
|
|
57
|
+
## 主なエクスポート
|
|
58
|
+
|
|
59
|
+
- `dailyNotesPlugin(options?)`: プラグインを作る(`style.css` を登録する)
|
|
60
|
+
- `getDailyNotes({ manifest, config, options? })`: 並べ替え済みの `DailyNote[]` を返す
|
|
61
|
+
- `DailyNotes`: ウィジェットのコンポーネント(`{ notes, limit? }`)
|
|
62
|
+
- 型: `DailyNote`、`DailyNotesOptions`、`ResolvedDailyNotesExtract`
|
|
63
|
+
|
|
64
|
+
## 関連資料
|
|
65
|
+
|
|
66
|
+
- [プラグインシステム](../../../docs/ja/reference/plugin-api.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-daily-notes",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"hono": "^4.12.25",
|
|
25
|
-
"@riebeckite/core": "0.0.
|
|
25
|
+
"@riebeckite/core": "0.0.14"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"tsx": "^4.22.4"
|