for-humanity 0.2.1 → 0.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.4.0 — 2026-10-04
6
+
7
+ - Copy explicitly referenced local images and supported attachments to fingerprinted asset URLs, resolving paths relative to their Markdown files in both build and dev.
8
+ - Support reference-style images and raw HTML image sources, preserve query/hash suffixes, and reject missing files, unsupported local image formats and paths or symlinks outside the document root.
9
+ - Reload referenced image and attachment changes in dev while retaining the previous valid document and resource map after failed processing.
10
+ - Mark only the current table-of-contents anchor as active, with `aria-current="location"`, while retaining the tree path through its ancestors.
11
+ - Add image documentation, purpose-based authoring guidance and fictional design and research examples.
12
+ - Keep legacy `type: document` and `type: blueprint` inputs compatible, recommend omitting `type`, and focus the roadmap on reusable visualization and theme modules rather than a dedicated Blueprint renderer.
13
+
14
+ ## 0.3.0 — 2026-10-04
15
+
16
+ - Support nested document pages with optional `parent` IDs, preserving existing groups and document URLs.
17
+ - Resolve `./` and `../` parent references relative to document files so project folders can also be used as document roots.
18
+ - Reject missing parents, self references, parent cycles and parent links across different group paths.
19
+ - Extend active, hover and keyboard focus tree paths through clickable parent documents.
20
+ - Distinguish sidebar groups from document links and page headings, and rename the table of contents to "On this page" with a gray label matching the groups.
21
+ - Clarify trunk-based development, site deployment and package release policy.
22
+
3
23
  ## 0.2.1 — 2026-10-04
4
24
 
5
25
  - Fingerprint stylesheet and browser-script URLs so new pages cannot reuse assets cached from an older deployment.
package/README.md CHANGED
@@ -33,7 +33,7 @@ Write Markdown. Keep the context. Share a static site.
33
33
  Node.js 22 or later and pnpm. Install the CLI in your document project:
34
34
 
35
35
  ```sh
36
- pnpm add -D --save-exact for-humanity@0.2.1
36
+ pnpm add -D --save-exact for-humanity@0.4.0
37
37
  mkdir docs
38
38
  ```
39
39
 
@@ -52,7 +52,7 @@ pnpm exec for-humanity preview docs
52
52
 
53
53
  If your Markdown files are in the project root, use `.` instead of `docs`. The root `README.md` becomes the home page; root `AGENTS.md` and `CLAUDE.md` stay out of the site.
54
54
 
55
- Version `0.2.1` supports `dev`, `build` and `preview`. `init` is planned; see the [Roadmap](https://github.com/minu-ha/for-humanity/blob/main/templates/document/roadmap.md) and [Changelog](https://github.com/minu-ha/for-humanity/blob/main/CHANGELOG.md).
55
+ Version `0.4.0` supports `dev`, `build` and `preview`. `init` is planned; see the [Roadmap](https://github.com/minu-ha/for-humanity/blob/main/templates/document/roadmap.md) and [Changelog](https://github.com/minu-ha/for-humanity/blob/main/CHANGELOG.md).
56
56
  Cloudflare Pages can host the generated site. See [Deployment](https://github.com/minu-ha/for-humanity/blob/main/templates/document/deployment.md) for the build settings.
57
57
 
58
58
  ### Develop the kit
@@ -74,7 +74,7 @@ pnpm preview # Preview the static site
74
74
  pnpm build:pages # Add Cloudflare Pages headers and a 404 page
75
75
  ```
76
76
 
77
- Changes pushed to `main` update the documentation site. A stable version tag such as `v0.2.1` runs checks, publishes the package to npm, then creates a GitHub Release with the same package file.
77
+ Changes pushed to `main` update the documentation site. A stable version tag such as `v0.4.0` runs checks, publishes the package to npm, then creates a GitHub Release with the same package file.
78
78
  The npm README updates with each package release. See [Maintenance](https://github.com/minu-ha/for-humanity/blob/main/templates/document/maintenance.md#packaging-and-release) for the release steps.
79
79
 
80
80
  ## Make it yours
@@ -95,6 +95,7 @@ export default {
95
95
  See [Commands](https://github.com/minu-ha/for-humanity/blob/main/templates/document/commands.md) for using another document folder, and [Settings](https://github.com/minu-ha/for-humanity/blob/main/templates/document/settings.md) for configuration.
96
96
  Each document other than the root README chooses a `group` and optional `order`. Pages stay independent; groups do not need parent documents or nested folders. Document names may share the same first letter.
97
97
  Use `group: Guide` for one group or `group: [Projects, Example project, Research]` for nested navigation. Group paths do not change document URLs.
98
+ Use `parent: writing` to place a document below another document in the same group. File-relative references such as `parent: ./readme` also work. Parent pages remain clickable and each page keeps its own URL; see [Navigation](https://github.com/minu-ha/for-humanity/blob/main/templates/document/navigation.md).
98
99
 
99
100
  ## Write with context
100
101
 
@@ -108,7 +109,7 @@ The contract, code or reasoning behind the visible result.
108
109
  :::
109
110
  ```
110
111
 
111
- [Parts](https://github.com/minu-ha/for-humanity/blob/main/templates/document/parts.md) pairs source examples with their rendered results. The [Blueprint sample](https://github.com/minu-ha/for-humanity/blob/main/templates/document/blueprint.md) uses a fictional reading-list app to show a screen flow, decisions, open questions and illustrative API contracts.
112
+ [Parts](https://github.com/minu-ha/for-humanity/blob/main/templates/document/parts.md) pairs source examples with their rendered results. The [Design example](https://github.com/minu-ha/for-humanity/blob/main/templates/document/blueprint.md) uses a fictional reading-list app to show a screen flow, decisions, open questions and illustrative API contracts.
112
113
 
113
114
  ## Documentation
114
115
 
@@ -118,7 +119,7 @@ The contract, code or reasoning behind the visible result.
118
119
  | Guide | [Writing](https://github.com/minu-ha/for-humanity/blob/main/templates/document/writing.md) · [Parts](https://github.com/minu-ha/for-humanity/blob/main/templates/document/parts.md) · [Settings](https://github.com/minu-ha/for-humanity/blob/main/templates/document/settings.md) |
119
120
  | Reference | [API](https://github.com/minu-ha/for-humanity/blob/main/templates/document/api.md) |
120
121
  | Releases | [Official releases](https://github.com/minu-ha/for-humanity/blob/main/templates/document/releases.md) · [Changelog](https://github.com/minu-ha/for-humanity/blob/main/templates/document/changelog.md) |
121
- | Examples | [Fictional Blueprint](https://github.com/minu-ha/for-humanity/blob/main/templates/document/blueprint.md) |
122
+ | Examples | [Fictional design example](https://github.com/minu-ha/for-humanity/blob/main/templates/document/blueprint.md) |
122
123
  | Development | [Architecture](https://github.com/minu-ha/for-humanity/blob/main/templates/document/architecture.md) · [Design](https://github.com/minu-ha/for-humanity/blob/main/templates/document/design.md) · [Maintenance](https://github.com/minu-ha/for-humanity/blob/main/templates/document/maintenance.md) · [Roadmap](https://github.com/minu-ha/for-humanity/blob/main/templates/document/roadmap.md) |
123
124
 
124
125
  ## License
package/dist/cli.css CHANGED
@@ -306,8 +306,27 @@
306
306
  display: block;
307
307
  padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
308
308
  color: var(--app-color-text-muted);
309
- font-size: var(--app-font-size-label);
309
+ font-size: var(--app-font-size-group);
310
+ line-height: calc(var(--app-font-size-dense) * var(--app-line-height-tight));
311
+ overflow-wrap: anywhere;
312
+ &::before {
313
+ position: absolute;
314
+ top: calc(0.5lh + var(--app-space-tree-row));
315
+ left: 0;
316
+ width: var(--app-space-tree-indent);
317
+ border-top: 1px solid var(--app-color-border-soft);
318
+ content: "";
319
+ pointer-events: none;
320
+ }
321
+ }
322
+ .wg_shellNavList__link {
323
+ position: relative;
324
+ display: block;
325
+ padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
326
+ color: var(--app-color-link);
327
+ font-size: var(--app-font-size-dense);
310
328
  line-height: var(--app-line-height-tight);
329
+ text-decoration: none;
311
330
  overflow-wrap: anywhere;
312
331
  &::before {
313
332
  position: absolute;
@@ -318,6 +337,26 @@
318
337
  content: "";
319
338
  pointer-events: none;
320
339
  }
340
+ &:where(:hover) {
341
+ text-decoration: underline;
342
+ }
343
+ &:where(:hover)::before {
344
+ border-top-color: currentcolor;
345
+ }
346
+ &:where(:focus-visible) {
347
+ outline: none;
348
+ text-decoration: underline;
349
+ }
350
+ &:where(:focus-visible)::before {
351
+ border-top-color: currentcolor;
352
+ }
353
+ }
354
+ .wg_shellNavList__link--active {
355
+ color: var(--app-color-link);
356
+ font-weight: var(--app-font-weight-active);
357
+ &::before {
358
+ border-top-color: currentcolor;
359
+ }
321
360
  }
322
361
  .wg_shellNavList__item {
323
362
  display: flow-root;
@@ -345,77 +384,47 @@
345
384
  pointer-events: none;
346
385
  }
347
386
  &:where(:hover)::after {
348
- border-left-color: var(--app-color-text-strong);
387
+ border-left-color: var(--app-color-link);
349
388
  }
350
389
  &:where(:has(:focus-visible))::after {
351
- border-left-color: var(--app-color-text-strong);
390
+ border-left-color: var(--app-color-link);
352
391
  }
353
392
  &:where(:has(~ .wg_shellNavList__item:hover))::before {
354
- border-left-color: var(--app-color-text-strong);
393
+ border-left-color: var(--app-color-link);
355
394
  }
356
395
  &:where(:has(~ .wg_shellNavList__item :focus-visible))::before {
357
- border-left-color: var(--app-color-text-strong);
396
+ border-left-color: var(--app-color-link);
358
397
  }
359
398
  & > .wg_shellNavList__root {
360
399
  margin-left: var(--app-space-tree-indent);
361
400
  }
362
401
  &:where(:hover) > .wg_shellNavList__branch::before {
363
- border-top-color: var(--app-color-text-strong);
402
+ border-top-color: var(--app-color-link);
364
403
  }
365
404
  &:where(:has(:focus-visible)) > .wg_shellNavList__branch::before {
366
- border-top-color: var(--app-color-text-strong);
405
+ border-top-color: var(--app-color-link);
406
+ }
407
+ &:where(:hover) > .wg_shellNavList__link::before {
408
+ border-top-color: var(--app-color-link);
409
+ }
410
+ &:where(:has(:focus-visible)) > .wg_shellNavList__link::before {
411
+ border-top-color: var(--app-color-link);
367
412
  }
368
413
  }
369
414
  .wg_shellNavList__item--trail {
370
415
  &::before {
371
- border-left-color: var(--app-color-text-strong);
416
+ border-left-color: var(--app-color-link);
372
417
  }
373
418
  }
374
419
  .wg_shellNavList__item--current {
375
420
  &::after {
376
- border-left-color: var(--app-color-text-strong);
421
+ border-left-color: var(--app-color-link);
377
422
  }
378
423
  & > .wg_shellNavList__branch::before {
379
- border-top-color: var(--app-color-text-strong);
380
- }
381
- }
382
- .wg_shellNavList__link {
383
- position: relative;
384
- display: block;
385
- padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
386
- color: var(--app-color-text);
387
- font-size: var(--app-font-size-dense);
388
- line-height: var(--app-line-height-tight);
389
- text-decoration: none;
390
- overflow-wrap: anywhere;
391
- &::before {
392
- position: absolute;
393
- top: calc(0.5lh + var(--app-space-tree-row));
394
- left: 0;
395
- width: var(--app-space-tree-indent);
396
- border-top: 1px solid var(--app-color-border-soft);
397
- content: "";
398
- pointer-events: none;
399
- }
400
- &:where(:hover) {
401
- text-decoration: underline;
424
+ border-top-color: var(--app-color-link);
402
425
  }
403
- &:where(:hover)::before {
404
- border-top-color: currentcolor;
405
- }
406
- &:where(:focus-visible) {
407
- outline: none;
408
- text-decoration: underline;
409
- }
410
- &:where(:focus-visible)::before {
411
- border-top-color: currentcolor;
412
- }
413
- }
414
- .wg_shellNavList__link--active {
415
- color: var(--app-color-text-strong);
416
- font-weight: var(--app-font-weight-active);
417
- &::before {
418
- border-top-color: currentcolor;
426
+ & > .wg_shellNavList__link::before {
427
+ border-top-color: var(--app-color-link);
419
428
  }
420
429
  }
421
430
 
@@ -432,7 +441,8 @@
432
441
  .wg_shellNav__group {
433
442
  margin: 0 0 4px;
434
443
  color: var(--app-color-text-muted);
435
- font-size: var(--app-font-size-label);
444
+ font-size: var(--app-font-size-group);
445
+ line-height: calc(var(--app-font-size-dense) * var(--app-line-height-tight));
436
446
  text-box: trim-start cap alphabetic;
437
447
  }
438
448
 
@@ -448,13 +458,14 @@
448
458
  margin-bottom: var(--app-space-inline);
449
459
  color: var(--app-color-text-muted);
450
460
  font-size: var(--app-font-size-label);
451
- font-weight: var(--app-font-weight-mark);
461
+ font-weight: var(--app-font-weight-strong);
452
462
  letter-spacing: var(--app-letter-spacing-label);
453
463
  }
454
464
  .wg_shellToc__group {
455
465
  margin: var(--app-space-stack) 0 4px;
456
466
  color: var(--app-color-text-muted);
457
- font-size: var(--app-font-size-label);
467
+ font-size: var(--app-font-size-group);
468
+ line-height: calc(var(--app-font-size-dense) * var(--app-line-height-tight));
458
469
  }
459
470
  .wg_shellToc__list {
460
471
  margin: 0 0 0 var(--app-space-tree-inset);
@@ -465,7 +476,7 @@
465
476
  position: relative;
466
477
  display: block;
467
478
  padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
468
- color: var(--app-color-text-muted);
479
+ color: var(--app-color-text);
469
480
  font-size: var(--app-font-size-dense);
470
481
  line-height: var(--app-line-height-tight);
471
482
  text-decoration: none;
@@ -611,7 +622,7 @@
611
622
  position: relative;
612
623
  display: block;
613
624
  padding: var(--app-space-tree-row) 0 var(--app-space-tree-row) calc(var(--app-space-tree-indent) + var(--app-space-inline));
614
- color: var(--app-color-text-muted);
625
+ color: var(--app-color-text);
615
626
  font-size: var(--app-font-size-detail);
616
627
  line-height: var(--app-line-height-tight);
617
628
  text-decoration: none;
@@ -702,6 +713,7 @@
702
713
  sans-serif;
703
714
  --app-font-mono: "JetBrains Mono Variable", var(--app-font-sans);
704
715
  --app-font-brand: "Architects Daughter", var(--app-font-sans);
716
+ --app-font-size-group: 11px;
705
717
  --app-font-size-label: 12px;
706
718
  --app-font-size-detail: 12px;
707
719
  --app-font-size-dense: 12px;
@@ -711,7 +723,7 @@
711
723
  --app-font-size-section: 14px;
712
724
  --app-font-size-title: 16px;
713
725
  --app-font-weight-mark: 400;
714
- --app-font-weight-active: 500;
726
+ --app-font-weight-active: 600;
715
727
  --app-font-weight-strong: 600;
716
728
  --app-font-weight-title: 600;
717
729
  --app-line-height-title: 1.5;