@riebeckite/plugin-daily-notes 0.0.19 → 0.0.21

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 CHANGED
@@ -4,7 +4,7 @@ Surfaces short snippets extracted from Daily Notes as a site widget.
4
4
 
5
5
  [日本語](./README_ja.md)
6
6
 
7
- ## Overview
7
+ ## Recommended placement
8
8
 
9
9
  A Daily Note is often one long, private journal file. This plugin reads the raw
10
10
  manifest, picks notes under a configured directory, and extracts exactly one
@@ -21,7 +21,10 @@ wholesale, so a long private note only contributes the snippet that opted in.
21
21
  note. An unpublished note's permalink and title stay `null`, so private notes
22
22
  never leak their location.
23
23
 
24
- ## Usage
24
+ `dailyNotesPlugin()` registers data and styles but does not render the widget.
25
+ The Site owns placement; a homepage section is the recommended location.
26
+
27
+ ## Quick Start
25
28
 
26
29
  ```ts
27
30
  import { defineConfig } from "@riebeckite/core";
@@ -33,7 +36,7 @@ export default defineConfig({
33
36
  });
34
37
  ```
35
38
 
36
- ### Render the widget
39
+ Render the widget explicitly in a homepage route or site-owned homepage section:
37
40
 
38
41
  ```tsx
39
42
  import DailyNotes, { getDailyNotes } from "@riebeckite/plugin-daily-notes";
@@ -80,6 +83,9 @@ guessing another one.
80
83
  `<time datetime>` attribute regardless, and `DailyNote.date` keeps that ISO
81
84
  form while `DailyNote.dateDisplay` holds the formatted text.
82
85
 
86
+ Move or remove the `DailyNotes` element to reposition or remove the widget. No
87
+ official Starter renders Daily Notes by default.
88
+
83
89
  ## Exports
84
90
 
85
91
  - `dailyNotesPlugin(options?)` — plugin factory (registers `style.css`)
@@ -94,5 +100,4 @@ form while `DailyNote.dateDisplay` holds the formatted text.
94
100
 
95
101
  ## See also
96
102
 
97
- - [Plugin guide](../../../docs/docs/reference/plugin-api.en.md)
98
-
103
+ - [Plugin guide](../../../docs/docs/reference/plugin-api.md)
package/README_ja.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [English](./README.md)
6
6
 
7
- ## 概要
7
+ ## 推奨配置
8
8
 
9
9
  デイリーノートは、長い非公開の日記を 1 ファイルにまとめることが少なくありません。このプラグインは生のマニフェストを読み、指定ディレクトリ配下のノートを対象に、次の順番で最初に成功した方法からスニペットを 1 つだけ取り出します。
10
10
 
@@ -16,7 +16,9 @@
16
16
 
17
17
  `sourceUrl` と `sourceTitle` は `isPublished` が公開と判定したときだけ付きます。非公開ノートのパーマリンクとタイトルは `null` のままなので、置き場所が漏れることはありません。
18
18
 
19
- ## 使い方
19
+ `dailyNotesPlugin()` はデータとスタイルを登録しますが、ウィジェットを自動描画しません。配置は Site が所有し、ホームページのセクションが推奨位置です。
20
+
21
+ ## クイックスタート
20
22
 
21
23
  ```ts
22
24
  import { defineConfig } from "@riebeckite/core";
@@ -28,7 +30,7 @@ export default defineConfig({
28
30
  });
29
31
  ```
30
32
 
31
- ### ウィジェットを置く
33
+ ホームページ route または Site が所有するホームページセクションで明示的に描画します。
32
34
 
33
35
  ```tsx
34
36
  import DailyNotes, { getDailyNotes } from "@riebeckite/plugin-daily-notes";
@@ -64,6 +66,8 @@ getDailyNotes({
64
66
 
65
67
  `dateFormat` はウィジェットの日付表示を決めます。既定は `"iso"`(`YYYY-MM-DD`)で、ほかに `"long"` と `"short"` があります。`"long"` と `"short"` は `locale`(既定 `"en"`)で整形します。機械可読な `YYYY-MM-DD` は常に `<time datetime>` 属性に残り、`DailyNote.date` はその ISO 形式のまま、`DailyNote.dateDisplay` に整形後の文字列が入ります。
66
68
 
69
+ 位置を変える・消すときは `DailyNotes` 要素を移動・削除します。公式 Starter は Daily Notes を既定で描画しません。
70
+
67
71
  ## 主なエクスポート
68
72
 
69
73
  - `dailyNotesPlugin(options?)`: プラグインを作る(`style.css` を登録する)
@@ -76,5 +80,4 @@ getDailyNotes({
76
80
 
77
81
  ## 関連資料
78
82
 
79
- - [プラグインシステム](../../../docs/docs/reference/plugin-api.md)
80
-
83
+ - [プラグインシステム](../../../docs/docs/reference/plugin-api.ja.md)
@@ -5,26 +5,19 @@ function DailyNotes(props) {
5
5
  const limit = props.limit ?? DEFAULT_LIMIT;
6
6
  const notes = props.notes.slice(0, Math.max(0, limit));
7
7
  if (notes.length === 0) return null;
8
- return /* @__PURE__ */ jsxs(
9
- "section",
10
- {
11
- class: "daily-notes rr-daily-notes",
12
- "aria-labelledby": "daily-notes-title",
13
- children: [
14
- /* @__PURE__ */ jsxs("div", { class: "daily-notes__header", children: [
15
- /* @__PURE__ */ jsx("p", { class: "daily-notes__eyebrow", children: "DAILY NOTES" }),
16
- /* @__PURE__ */ jsx("h2", { class: "daily-notes__title", id: "daily-notes-title", children: "Recent Daily Notes" })
17
- ] }),
18
- /* @__PURE__ */ jsx("ul", { class: "daily-notes__list", children: notes.map((note) => /* @__PURE__ */ jsxs("li", { class: "daily-notes__item", children: [
19
- /* @__PURE__ */ jsxs("div", { class: "daily-notes__meta", children: [
20
- note.date.length > 0 ? /* @__PURE__ */ jsx("time", { class: "daily-notes__date", dateTime: note.date, children: note.dateDisplay }) : null,
21
- note.sourceUrl !== null ? /* @__PURE__ */ jsx("a", { class: "daily-notes__source", href: note.sourceUrl, children: resolveSourceLabel(note) }) : null
22
- ] }),
23
- /* @__PURE__ */ jsx("p", { class: "daily-notes__snippet", children: note.snippet })
24
- ] }, note.slug)) })
25
- ]
26
- }
27
- );
8
+ return /* @__PURE__ */ jsxs("section", { class: "rr-daily-notes", "aria-labelledby": "daily-notes-title", children: [
9
+ /* @__PURE__ */ jsxs("div", { class: "rr-daily-notes__header", children: [
10
+ /* @__PURE__ */ jsx("p", { class: "rr-daily-notes__eyebrow", children: "DAILY NOTES" }),
11
+ /* @__PURE__ */ jsx("h2", { class: "rr-daily-notes__title", id: "daily-notes-title", children: "Recent Daily Notes" })
12
+ ] }),
13
+ /* @__PURE__ */ jsx("ul", { class: "rr-daily-notes__list", children: notes.map((note) => /* @__PURE__ */ jsxs("li", { class: "rr-daily-notes__item", children: [
14
+ /* @__PURE__ */ jsxs("div", { class: "rr-daily-notes__meta", children: [
15
+ note.date.length > 0 ? /* @__PURE__ */ jsx("time", { class: "rr-daily-notes__date", dateTime: note.date, children: note.dateDisplay }) : null,
16
+ note.sourceUrl !== null ? /* @__PURE__ */ jsx("a", { class: "rr-daily-notes__source", href: note.sourceUrl, children: resolveSourceLabel(note) }) : null
17
+ ] }),
18
+ /* @__PURE__ */ jsx("p", { class: "rr-daily-notes__snippet", children: note.snippet })
19
+ ] }, note.slug)) })
20
+ ] });
28
21
  }
29
22
  function resolveSourceLabel(note) {
30
23
  if (note.sourceTitle !== null && note.sourceTitle.length > 0) {
package/dist/index.js CHANGED
@@ -304,26 +304,19 @@ function DailyNotes(props) {
304
304
  const limit = props.limit ?? DEFAULT_LIMIT2;
305
305
  const notes = props.notes.slice(0, Math.max(0, limit));
306
306
  if (notes.length === 0) return null;
307
- return /* @__PURE__ */ jsxs(
308
- "section",
309
- {
310
- class: "daily-notes rr-daily-notes",
311
- "aria-labelledby": "daily-notes-title",
312
- children: [
313
- /* @__PURE__ */ jsxs("div", { class: "daily-notes__header", children: [
314
- /* @__PURE__ */ jsx("p", { class: "daily-notes__eyebrow", children: "DAILY NOTES" }),
315
- /* @__PURE__ */ jsx("h2", { class: "daily-notes__title", id: "daily-notes-title", children: "Recent Daily Notes" })
316
- ] }),
317
- /* @__PURE__ */ jsx("ul", { class: "daily-notes__list", children: notes.map((note) => /* @__PURE__ */ jsxs("li", { class: "daily-notes__item", children: [
318
- /* @__PURE__ */ jsxs("div", { class: "daily-notes__meta", children: [
319
- note.date.length > 0 ? /* @__PURE__ */ jsx("time", { class: "daily-notes__date", dateTime: note.date, children: note.dateDisplay }) : null,
320
- note.sourceUrl !== null ? /* @__PURE__ */ jsx("a", { class: "daily-notes__source", href: note.sourceUrl, children: resolveSourceLabel(note) }) : null
321
- ] }),
322
- /* @__PURE__ */ jsx("p", { class: "daily-notes__snippet", children: note.snippet })
323
- ] }, note.slug)) })
324
- ]
325
- }
326
- );
307
+ return /* @__PURE__ */ jsxs("section", { class: "rr-daily-notes", "aria-labelledby": "daily-notes-title", children: [
308
+ /* @__PURE__ */ jsxs("div", { class: "rr-daily-notes__header", children: [
309
+ /* @__PURE__ */ jsx("p", { class: "rr-daily-notes__eyebrow", children: "DAILY NOTES" }),
310
+ /* @__PURE__ */ jsx("h2", { class: "rr-daily-notes__title", id: "daily-notes-title", children: "Recent Daily Notes" })
311
+ ] }),
312
+ /* @__PURE__ */ jsx("ul", { class: "rr-daily-notes__list", children: notes.map((note) => /* @__PURE__ */ jsxs("li", { class: "rr-daily-notes__item", children: [
313
+ /* @__PURE__ */ jsxs("div", { class: "rr-daily-notes__meta", children: [
314
+ note.date.length > 0 ? /* @__PURE__ */ jsx("time", { class: "rr-daily-notes__date", dateTime: note.date, children: note.dateDisplay }) : null,
315
+ note.sourceUrl !== null ? /* @__PURE__ */ jsx("a", { class: "rr-daily-notes__source", href: note.sourceUrl, children: resolveSourceLabel(note) }) : null
316
+ ] }),
317
+ /* @__PURE__ */ jsx("p", { class: "rr-daily-notes__snippet", children: note.snippet })
318
+ ] }, note.slug)) })
319
+ ] });
327
320
  }
328
321
  function resolveSourceLabel(note) {
329
322
  if (note.sourceTitle !== null && note.sourceTitle.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-daily-notes",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
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.19"
25
+ "@riebeckite/core": "0.0.21"
26
26
  },
27
27
  "devDependencies": {
28
28
  "tsx": "^4.22.4"
package/style.css CHANGED
@@ -1,17 +1,17 @@
1
1
  @layer components {
2
- .daily-notes {
2
+ .rr-daily-notes {
3
3
  margin-top: 4rem;
4
4
  padding-top: 1.5rem;
5
5
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
6
6
  }
7
7
 
8
- .daily-notes__header {
8
+ .rr-daily-notes__header {
9
9
  display: grid;
10
10
  gap: 0.25rem;
11
11
  margin-bottom: 1.25rem;
12
12
  }
13
13
 
14
- .daily-notes__eyebrow {
14
+ .rr-daily-notes__eyebrow {
15
15
  margin: 0;
16
16
  font-size: 0.75rem;
17
17
  font-weight: 700;
@@ -19,14 +19,14 @@
19
19
  color: color-mix(in srgb, currentColor 54%, transparent);
20
20
  }
21
21
 
22
- .daily-notes__title {
22
+ .rr-daily-notes__title {
23
23
  margin: 0;
24
24
  font-size: clamp(1.5rem, 4vw, 2rem);
25
25
  line-height: 1.2;
26
26
  letter-spacing: -0.02em;
27
27
  }
28
28
 
29
- .daily-notes__list {
29
+ .rr-daily-notes__list {
30
30
  display: grid;
31
31
  gap: 1.25rem;
32
32
  margin: 0;
@@ -34,13 +34,13 @@
34
34
  list-style: none;
35
35
  }
36
36
 
37
- .daily-notes__item {
37
+ .rr-daily-notes__item {
38
38
  margin: 0;
39
39
  padding: 1rem 0 0;
40
40
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
41
41
  }
42
42
 
43
- .daily-notes__meta {
43
+ .rr-daily-notes__meta {
44
44
  display: flex;
45
45
  flex-wrap: wrap;
46
46
  gap: 0.75rem;
@@ -48,26 +48,26 @@
48
48
  margin-bottom: 0.5rem;
49
49
  }
50
50
 
51
- .daily-notes__date {
51
+ .rr-daily-notes__date {
52
52
  font-size: 0.75rem;
53
53
  font-weight: 700;
54
54
  letter-spacing: 0.08em;
55
55
  color: color-mix(in srgb, currentColor 62%, transparent);
56
56
  }
57
57
 
58
- .daily-notes__source {
58
+ .rr-daily-notes__source {
59
59
  font-size: 0.75rem;
60
60
  color: var(--rb-color-accent, currentColor);
61
61
  text-decoration: underline;
62
62
  text-underline-offset: 0.2em;
63
63
  }
64
64
 
65
- .daily-notes__source:focus-visible {
65
+ .rr-daily-notes__source:focus-visible {
66
66
  outline: 2px solid var(--rb-color-accent, currentColor);
67
67
  outline-offset: 3px;
68
68
  }
69
69
 
70
- .daily-notes__snippet {
70
+ .rr-daily-notes__snippet {
71
71
  margin: 0;
72
72
  font-size: 1rem;
73
73
  line-height: 1.75;