@riebeckite/plugin-daily-notes 0.0.31 → 0.0.33
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 +4 -4
- package/README_ja.md +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/src/daily-notes.d.ts +0 -6
- package/dist/src/daily-notes.server.d.ts +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -23,18 +23,18 @@ wholesale, so a long private note only contributes the snippet that opted in.
|
|
|
23
23
|
note. An unpublished note's permalink and title stay `null`, so private notes
|
|
24
24
|
never leak their location.
|
|
25
25
|
|
|
26
|
-
`
|
|
26
|
+
`dailyNotes()` registers data and styles but does not render the widget.
|
|
27
27
|
The Site owns placement; a homepage section is the recommended location.
|
|
28
28
|
|
|
29
29
|
## Quick Start
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
32
|
import { defineConfig } from "@riebeckite/core";
|
|
33
|
-
import {
|
|
33
|
+
import { dailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
34
34
|
|
|
35
35
|
export default defineConfig({
|
|
36
36
|
// ...
|
|
37
|
-
plugins: [
|
|
37
|
+
plugins: [dailyNotes()],
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -90,7 +90,7 @@ official Starter renders Daily Notes by default.
|
|
|
90
90
|
|
|
91
91
|
## Exports
|
|
92
92
|
|
|
93
|
-
- `
|
|
93
|
+
- `dailyNotes(options?)` — plugin factory (registers `style.css`)
|
|
94
94
|
- `getDailyNotes({ manifest, config, options? })` — sorted `DailyNote[]`
|
|
95
95
|
- `DailyNotes` — widget component (`{ notes, limit? }`)
|
|
96
96
|
- `resolveDisplayOptions(options?)` — apply date-format defaults
|
package/README_ja.md
CHANGED
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
|
|
9
9
|
## 推奨配置
|
|
10
10
|
|
|
11
|
-
デイリーノートは、長い非公開の日記を 1
|
|
11
|
+
デイリーノートは、長い非公開の日記を 1 ファイルにまとめていることが少なくありません。このプラグインは生のマニフェストを読み、指定ディレクトリ配下のノートから、次の順番で最初に成功した方法を使ってスニペットを 1 つだけ取り出します。
|
|
12
12
|
|
|
13
13
|
1. frontmatter のキー(既定は `daily-summary`)
|
|
14
14
|
2. 見出しで示した節(既定は `今日のひとこと`)
|
|
15
15
|
3. コードブロック(既定は `daily-snippet`)
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
すべて失敗したノートは表示しません。本文を丸ごと出力することもありません。長い非公開ノートは、スニペットとして明示した部分だけを提供します。
|
|
18
18
|
|
|
19
|
-
`sourceUrl` と `sourceTitle` は `isPublished`
|
|
19
|
+
`sourceUrl` と `sourceTitle` は `isPublished` が公開と判定したときだけ付与されます。非公開ノートのパーマリンクとタイトルは `null` のままなので、置き場所が漏れることはありません。
|
|
20
20
|
|
|
21
|
-
`
|
|
21
|
+
`dailyNotes()` はデータとスタイルを登録しますが、ウィジェットを自動描画しません。配置はサイト側が管理し、ホームページのセクションが推奨位置です。
|
|
22
22
|
|
|
23
23
|
## クイックスタート
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
import { defineConfig } from "@riebeckite/core";
|
|
27
|
-
import {
|
|
27
|
+
import { dailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
28
28
|
|
|
29
29
|
export default defineConfig({
|
|
30
30
|
// ...
|
|
31
|
-
plugins: [
|
|
31
|
+
plugins: [dailyNotes()],
|
|
32
32
|
});
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
ホームページのルート、またはサイトが管理するホームページセクションで明示的に描画します。
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
38
|
import DailyNotes, { getDailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
@@ -62,9 +62,9 @@ getDailyNotes({
|
|
|
62
62
|
});
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
抽出方法を `false` にすると、その抽出を無効にできます。`pathPattern` では `{YYYY}`、`{MM}`、`{DD}`、`*` が使え、ノートのファイル名を厳密に絞り込めます。
|
|
66
66
|
|
|
67
|
-
`source.dateFormat` はノートのファイル名が使う Obsidian(Moment)の日付フォーマットです(既定 `YYYY-MM-DD`)。Obsidian の Daily Notes の日付フォーマットに合わせて設定します(例: `YYYY/MM/DD`、`YYYY.MM.DD`)。slug
|
|
67
|
+
`source.dateFormat` はノートのファイル名が使う Obsidian(Moment)の日付フォーマットです(既定 `YYYY-MM-DD`)。Obsidian の Daily Notes の日付フォーマットに合わせて設定します(例: `YYYY/MM/DD`、`YYYY.MM.DD`)。slug の日付はこの形式で厳密に読み取り、対応していない形式ではほかの形式を推測せず、日付なしとして扱います。
|
|
68
68
|
|
|
69
69
|
`dateFormat` はウィジェットの日付表示を決めます。既定は `"iso"`(`YYYY-MM-DD`)で、ほかに `"long"` と `"short"` があります。`"long"` と `"short"` は `locale`(既定 `"en"`)で整形します。機械可読な `YYYY-MM-DD` は常に `<time datetime>` 属性に残り、`DailyNote.date` はその ISO 形式のまま、`DailyNote.dateDisplay` に整形後の文字列が入ります。
|
|
70
70
|
|
|
@@ -72,7 +72,7 @@ getDailyNotes({
|
|
|
72
72
|
|
|
73
73
|
## 主なエクスポート
|
|
74
74
|
|
|
75
|
-
- `
|
|
75
|
+
- `dailyNotes(options?)`: プラグインを作る(`style.css` を登録する)
|
|
76
76
|
- `getDailyNotes({ manifest, config, options? })`: 並べ替え済みの `DailyNote[]` を返す
|
|
77
77
|
- `DailyNotes`: ウィジェットのコンポーネント(`{ notes, limit? }`)
|
|
78
78
|
- `resolveDisplayOptions(options?)`: 日付表示の既定値を適用する
|
package/dist/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export { getDailyNotes, resolveDailyNotesOptionsFromConfig, } from "./src/daily-
|
|
|
8
8
|
* Registers the Daily Notes widget. Extraction options are consumed by
|
|
9
9
|
* `getDailyNotes`; the plugin wires the stylesheet and output dependencies.
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function dailyNotes(options?: DailyNotesOptions): RiebeckitePlugin<DailyNotesOptions | undefined>;
|
package/dist/index.js
CHANGED
|
@@ -366,7 +366,7 @@ function resolveSourceLabel(note) {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
// index.ts
|
|
369
|
-
function
|
|
369
|
+
function dailyNotes(options) {
|
|
370
370
|
return definePlugin({
|
|
371
371
|
name: DAILY_NOTES_PLUGIN_NAME,
|
|
372
372
|
options,
|
|
@@ -391,7 +391,7 @@ export {
|
|
|
391
391
|
DEFAULT_DAILY_NOTES_LOCALE,
|
|
392
392
|
DEFAULT_SLUG_DATE_FORMAT,
|
|
393
393
|
DailyNotes,
|
|
394
|
-
|
|
394
|
+
dailyNotes,
|
|
395
395
|
formatDailyNoteDate,
|
|
396
396
|
getDailyNotes,
|
|
397
397
|
resolveDailyNotesOptionsFromConfig,
|
|
@@ -49,9 +49,6 @@ export type ResolvedDailyNotesDisplay = {
|
|
|
49
49
|
};
|
|
50
50
|
export declare const DAILY_NOTES_PLUGIN_NAME = "daily-notes";
|
|
51
51
|
export declare const DEFAULT_DIRECTORY = "Daily";
|
|
52
|
-
export declare const DEFAULT_FRONTMATTER_KEY = "daily-summary";
|
|
53
|
-
export declare const DEFAULT_SECTION = "\u4ECA\u65E5\u306E\u3072\u3068\u3053\u3068";
|
|
54
|
-
export declare const DEFAULT_CODE_BLOCK = "daily-snippet";
|
|
55
52
|
export declare const DEFAULT_LIMIT = 5;
|
|
56
53
|
export declare const DEFAULT_DAILY_NOTES_DATE_FORMAT: DailyNotesDateFormat;
|
|
57
54
|
export declare const DEFAULT_DAILY_NOTES_LOCALE = "en";
|
|
@@ -65,15 +62,12 @@ export declare function formatDailyNoteDate(dateIso: string, display: ResolvedDa
|
|
|
65
62
|
* directory is a fast prefix filter; `pathPattern` refines it when present.
|
|
66
63
|
*/
|
|
67
64
|
export declare function isDailyNoteSlug(slug: string, directory: string, pathPattern?: string): boolean;
|
|
68
|
-
export declare function matchesSlugPattern(slug: string, pattern: string): boolean;
|
|
69
65
|
/**
|
|
70
66
|
* Extracts exactly one snippet using the first successful strategy. Returns
|
|
71
67
|
* `null` when every strategy fails; callers must skip the note rather than
|
|
72
68
|
* fall back to the whole note body.
|
|
73
69
|
*/
|
|
74
70
|
export declare function extractDailyNoteSnippet(entry: ContentManifestEntry, extract: ResolvedDailyNotesExtract): string | null;
|
|
75
|
-
export declare function extractSectionSnippet(html: string, section: string): string | null;
|
|
76
|
-
export declare function extractCodeBlockSnippet(html: string, language: string): string | null;
|
|
77
71
|
/**
|
|
78
72
|
* Derives the note date deterministically: frontmatter `date`, then `created`,
|
|
79
73
|
* then the note filename parsed with the configured Obsidian date format.
|
|
@@ -5,7 +5,7 @@ import { type DailyNote, type DailyNotesOptions } from "./daily-notes.js";
|
|
|
5
5
|
*
|
|
6
6
|
* The widget is rendered by the host application route rather than the plugin
|
|
7
7
|
* itself, so `getDailyNotes` resolves the registered options here to keep the
|
|
8
|
-
* displayed widget in sync with `
|
|
8
|
+
* displayed widget in sync with `dailyNotes(options)`.
|
|
9
9
|
*/
|
|
10
10
|
export declare function resolveDailyNotesOptionsFromConfig(config: ResolvedRiebeckiteConfig): DailyNotesOptions;
|
|
11
11
|
/**
|
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.33",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"./style.css": "./style.css"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"@riebeckite/
|
|
26
|
-
"
|
|
24
|
+
"@riebeckite/core": "0.0.33",
|
|
25
|
+
"@riebeckite/ui": "0.0.33",
|
|
26
|
+
"hono": "^4.12.25"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"tsx": "^4.22.4"
|