for-humanity 0.13.1 → 0.14.1

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
@@ -2,11 +2,36 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.14.1 — 2026-10-19
6
+
7
+ **Upgrade:** CLI commands, configuration, document syntax and Node.js requirements remain unchanged.
8
+
9
+ **Known issue:** The intermittent Windows cursor check (`NAV-010`) fails again in CI, and its cause is being investigated. See [Maintenance](https://github.com/minu-ha/for-humanity/blob/main/content/private/maintenance.md#known-windows-check-issue).
10
+
11
+ - Reorganize the documentation site into Start, Guide and Updates. Installation has its own page, Commands covers command options and troubleshooting, and the changelog is published with update instructions. The Reference and Releases pages are removed; their content is in Commands, Settings, Writing and Changelog.
12
+ - Let the mouse wheel scroll the document over the document list and the outline when they fit on screen. Chrome previously kept the wheel inside them.
13
+ - Restore the scroll position instantly when reloading or going back to an address with a heading, without first jumping to the heading or sliding down from the top.
14
+ - End documents with a regular section margin instead of nearly a screen of blank space. Over the last screen, the outline steps through the remaining headings in order, and a heading opened from a link stays marked until you scroll.
15
+ - Land anchor links with the heading at 40% of the screen height instead of near the top, and switch the outline at the same line.
16
+ - Land anchor links in the last screen exactly where the outline switches to them, so clicking an outline entry never briefly marks another heading.
17
+
18
+ ## 0.14.0 — 2026-10-19
19
+
20
+ **Breaking change:** Configuration now belongs in the project root. CLI paths identify a project, not a Markdown folder. Move published documents into `content/public`, local-only documents into `content/private`, and the site home into `content/README.md`; use `content.root`, `content.public` and `content.private` to customize these paths. Existing flat document folders are not automatically published. See the [migration guide](https://for-humanity.fyi/migration/). Node.js 22.12.0 or later is still required.
21
+
22
+ - Focus public documentation on installation, configuration, authoring and deployment. Keep internal plans, release operations, development history and fictional project studies in local-only content.
23
+ - Show both document collections in `dev`; build and preview only the public site in `content/dist`.
24
+ - Preserve public document URLs and reserve `/private/` for local internal pages. Exclude internal pages, navigation data, sitemap entries and their assets from public builds.
25
+ - Reject public references to internal Markdown, images and snippets, including raw HTML and symlink targets.
26
+ - Move this repository's documentation to `content` and its configuration to the project root.
27
+ - Include a reusable `template/` starter with public/private folders and document migration from flat Markdown projects.
28
+ - Reject content-root symlinks into build output, Git metadata and installed dependencies.
29
+
5
30
  ## 0.13.1 — 2026-10-16
6
31
 
7
32
  **Upgrade:** CLI commands, configuration and Node.js requirements remain unchanged. Navigation scroll positions saved by older versions may reset once after upgrading.
8
33
 
9
- **Known issue:** The previously recorded intermittent Windows cursor check (`NAV-010`) remains deferred. See [Maintenance](https://for-humanity.fyi/maintenance/#known-windows-check-issue).
34
+ **Known issue:** The previously recorded intermittent Windows cursor check (`NAV-010`) remains deferred. See [Maintenance](https://github.com/minu-ha/for-humanity/blob/main/content/private/maintenance.md#known-windows-check-issue).
10
35
 
11
36
  - Let Zustand persist own navigation scroll storage and hydration; remove direct storage reads, legacy layout-key compatibility and duplicate restoration helpers.
12
37
  - Validate saved navigation positions once with a shared Zod schema, discard malformed snapshots, and compare navigation data without traversing DOM links on every scroll event.
@@ -16,7 +41,7 @@
16
41
 
17
42
  **Upgrade:** Node.js 22.12.0 or later is now required; upgrade Node before installing. Existing `dev`, `build`, `preview` commands and `.mjs` configurations remain supported. To use typed configuration, replace the `.mjs` file with `for-humanity.config.ts`; keep only one configuration file per document folder. Development and preview servers bind to localhost.
18
43
 
19
- **Known issue:** The Windows browser check for cursor visibility after a reload (`NAV-010`) intermittently fails. The other browser checks and installed-package dev/preview checks pass; further cursor lifecycle investigation is deferred. See [Maintenance](https://for-humanity.fyi/maintenance/#known-windows-check-issue).
44
+ **Known issue:** The Windows browser check for cursor visibility after a reload (`NAV-010`) intermittently fails. The other browser checks and installed-package dev/preview checks pass; further cursor lifecycle investigation is deferred. See [Maintenance](https://github.com/minu-ha/for-humanity/blob/main/content/private/maintenance.md#known-windows-check-issue).
20
45
 
21
46
  - Render page titles, metadata and resource tags with a request-local Unhead server instance; deduplicate links, preserve literal metadata text, and keep CSS and font loading in the initial HTML.
22
47
  - Use Citty for CLI commands and help/version output, reject unsupported options and extra paths before running, and format build results and document warnings with Consola.
package/README.md CHANGED
@@ -13,122 +13,97 @@ Write Markdown. Keep the context. Share a static site.
13
13
  [![MIT](https://img.shields.io/badge/license-MIT-1111aa?style=flat-square)](https://github.com/minu-ha/for-humanity/blob/main/LICENSE)
14
14
  [![npm](https://img.shields.io/npm/v/for-humanity?style=flat-square)](https://www.npmjs.com/package/for-humanity)
15
15
  ![Node 22.12.0+](https://img.shields.io/badge/node-22.12.0%2B-444444?style=flat-square)
16
- ![Hono JSX](https://img.shields.io/badge/Hono-JSX-444444?style=flat-square)
17
16
  ![Prototype](https://img.shields.io/badge/status-prototype-9a6400?style=flat-square)
18
17
 
19
- [Quick start](#quick-start) · [Guide](https://github.com/minu-ha/for-humanity/blob/main/templates/document/writing.md) · [API](https://github.com/minu-ha/for-humanity/blob/main/templates/document/api.md) · [Deployment](https://github.com/minu-ha/for-humanity/blob/main/templates/document/deployment.md) · [Korean](https://github.com/minu-ha/for-humanity/blob/main/language/README.ko.md)
18
+ [Quick start](#quick-start) · [Guide](https://github.com/minu-ha/for-humanity/blob/main/content/public/writing.md) · [Commands](https://github.com/minu-ha/for-humanity/blob/main/content/public/commands.md) · [Deployment](https://github.com/minu-ha/for-humanity/blob/main/content/public/deployment.md) · [Korean](https://github.com/minu-ha/for-humanity/blob/main/language/README.ko.md)
20
19
 
21
20
  </div>
22
21
 
23
- ## A little structure. Room to read.
22
+ ## Write, organize, publish
24
23
 
25
- - **Find your place.** Pages grouped by purpose, a reading order, a tree of contents and the current reading position.
26
- - **Keep the detail.** Notes for context, native disclosures for implementation details, and links that open folded sections.
27
- - **Show the connections.** Tables, highlighted code, official Mermaid diagrams including flowcharts, sequences and directory trees, status badges and color swatches.
28
- - **Share the result.** Static HTML, self-hosted fonts and a small browser script. Browser interactions stay separate from Markdown rendering.
29
- - **Read your way.** System-matched light and dark themes, keyboard navigation and a layout for narrow screens.
24
+ Write Markdown with code examples, tables, images and Mermaid diagrams. Organize pages into groups and nested navigation. Use notes for context and collapsible details for longer explanations.
25
+
26
+ The result is a static site with bundled fonts, light and dark themes, keyboard navigation and a layout that adapts to narrow screens.
30
27
 
31
28
  ## Quick start
32
29
 
33
- Node.js 22.12.0 or later and pnpm. Install the CLI in your document project:
30
+ You need Node.js 22.12.0 or later and pnpm. In a project with a `package.json`, install the package:
34
31
 
35
32
  ```sh
36
- pnpm add -D --save-exact for-humanity@0.13.1
37
- mkdir docs
33
+ pnpm add -D --save-exact for-humanity@0.14.1
38
34
  ```
39
35
 
40
- Create `docs/README.md` for the home page, then start the development server:
36
+ Copy `for-humanity.config.ts` and the `content` folder from `node_modules/for-humanity/template` into your project. If you already have documentation, follow [Migration](https://github.com/minu-ha/for-humanity/blob/main/content/public/migration.md) before moving files.
41
37
 
42
- ```sh
43
- pnpm exec for-humanity dev docs
44
- ```
38
+ Edit `content/README.md` for your home page:
45
39
 
46
- Open [localhost:4321](http://localhost:4321). Build and preview your static site:
40
+ ```markdown
41
+ # Project notes
47
42
 
48
- ```sh
49
- pnpm exec for-humanity build docs # Generate docs/dist
50
- pnpm exec for-humanity preview docs
43
+ Welcome to the project documentation.
51
44
  ```
52
45
 
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
-
55
- Version `0.13.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).
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
- Set an optional public root `url` in the site configuration to generate `robots.txt` and `sitemap.xml`; projects without a URL emit neither file. See [Crawling](https://github.com/minu-ha/for-humanity/blob/main/templates/document/crawling.md).
58
-
59
- ### Develop the kit
60
-
61
- Version 0.13.0 requires Node.js 22.12.0 or later. Repository development uses one Vite server with Hono, source TSX reloads and CSS HMR.
62
-
63
- To work on the CLI or read this library's guides and examples locally, run the project from source:
46
+ Start the local server:
64
47
 
65
48
  ```sh
66
- git clone https://github.com/minu-ha/for-humanity.git
67
- cd for-humanity
68
- pnpm install
69
- pnpm dev
49
+ pnpm exec for-humanity dev
70
50
  ```
71
51
 
72
- Open [localhost:4321](http://localhost:4321) to read this library's usage guides, API reference and fictional examples.
52
+ Open [localhost:4321](http://localhost:4321). Edit the Markdown file and save to update the page. Follow [Installation](https://github.com/minu-ha/for-humanity/blob/main/content/public/installation.md) to add your first document.
53
+
54
+ Build and inspect the site before deployment:
73
55
 
74
56
  ```sh
75
- pnpm build # Generate templates/document/dist
76
- pnpm preview # Preview the static site
77
- pnpm build:pages # Add Cloudflare Pages headers and a 404 page
57
+ pnpm exec for-humanity build
58
+ pnpm exec for-humanity preview
78
59
  ```
79
60
 
80
- Changes pushed to `main` update the documentation site. A stable version tag such as `v0.13.1` runs checks, publishes the package to npm, then creates a GitHub Release with the same package file.
81
- 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.
61
+ Deploy the generated `content/dist` directory and add it to `.gitignore`. See [Deployment](https://github.com/minu-ha/for-humanity/blob/main/content/public/deployment.md) for hosting settings.
62
+
63
+ Keep published documents in `content/public` and local notes in `content/private`. The local server shows both; builds include only public documents and the home page. Folder names are configurable.
82
64
 
83
65
  ## Make it yours
84
66
 
85
- A document folder is enough to get started. Without a site configuration, the sidebar shows **for humanity**. The pixel face appears in the browser tab, and follows the mouse on desktop when the site sets `cursorFace: true`.
86
- The folder's `README.md` becomes the home page at `/`, with no frontmatter required. Click the site name to return home.
87
- This repository generates [the documentation home](https://github.com/minu-ha/for-humanity/blob/main/templates/document/README.md) from its root README.md and [the site changelog](https://github.com/minu-ha/for-humanity/blob/main/templates/document/changelog.md) from CHANGELOG.md. Edit those source files, then run `pnpm sync:docs`; `pnpm dev` and `pnpm build` also sync them on startup.
88
- Set your own name in `for-humanity.config.ts`, using the exported `SiteConfig` type for editor completion and static checking:
67
+ Set the site name and the order of navigation groups:
89
68
 
90
69
  ```ts
91
70
  import type {SiteConfig} from "for-humanity";
92
71
 
93
72
  export default {
94
73
  title: "Project notes",
95
- description: "Decisions, working notes and the details behind them.",
96
- navigation: ["Getting started", "Guide", "Reference", "Examples"],
74
+ description: "A guide to using the project.",
75
+ navigation: ["Start", "Guide", "Updates"],
97
76
  } satisfies SiteConfig;
98
77
  ```
99
78
 
100
- Existing `for-humanity.config.mjs` files remain supported. When migrating to TypeScript, replace the old file with the `.ts` file.
101
- Use one configuration file per document folder. The CLI validates values at startup; run `tsc --noEmit` in your project for static type checking.
79
+ Save this as `for-humanity.config.ts` in the project root, alongside `package.json`. Existing `.mjs` configuration is also supported; keep only one configuration file.
102
80
 
103
- 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.
104
- 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.
105
- Use `group: Guide` for one group or `group: [Projects, Example project, Research]` for nested navigation. Group paths do not change document URLs.
106
- 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).
81
+ Each document declares a title, description and navigation group in frontmatter. See [Writing](https://github.com/minu-ha/for-humanity/blob/main/content/public/writing.md) for a complete example and [Settings](https://github.com/minu-ha/for-humanity/blob/main/content/public/settings.md) for available options.
107
82
 
108
- ## Write with context
83
+ ## Keep useful detail
109
84
 
110
85
  ```markdown
111
- :::note[Scope]
112
- What this document covers and what still needs a decision.
86
+ :::note[Before you start]
87
+ Check the requirements before following the steps.
113
88
  :::
114
89
 
115
- :::details[Implementation]
116
- The contract, code or reasoning behind the visible result.
90
+ :::details[More information]
91
+ Add examples or explanations readers can open when needed.
117
92
  :::
118
93
  ```
119
94
 
120
- [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.
95
+ [Parts](https://github.com/minu-ha/for-humanity/blob/main/content/public/parts.md) shows the syntax alongside its rendered output.
121
96
 
122
97
  ## Documentation
123
98
 
124
- | Group | Read |
125
- | ----- | ---- |
126
- | Getting started | [Commands](https://github.com/minu-ha/for-humanity/blob/main/templates/document/commands.md) · [Deployment](https://github.com/minu-ha/for-humanity/blob/main/templates/document/deployment.md) |
127
- | 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) |
128
- | Reference | [API](https://github.com/minu-ha/for-humanity/blob/main/templates/document/api.md) |
129
- | 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) |
130
- | Examples | [Fictional design example](https://github.com/minu-ha/for-humanity/blob/main/templates/document/blueprint.md) |
131
- | 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) |
99
+ | Task | Guide |
100
+ | --- | --- |
101
+ | Install and run | [Installation](https://github.com/minu-ha/for-humanity/blob/main/content/public/installation.md) · [Commands](https://github.com/minu-ha/for-humanity/blob/main/content/public/commands.md) |
102
+ | Write and organize pages | [Writing](https://github.com/minu-ha/for-humanity/blob/main/content/public/writing.md) · [Navigation](https://github.com/minu-ha/for-humanity/blob/main/content/public/navigation.md) |
103
+ | Add rich content | [Parts](https://github.com/minu-ha/for-humanity/blob/main/content/public/parts.md) · [Diagrams](https://github.com/minu-ha/for-humanity/blob/main/content/public/diagrams.md) · [Images](https://github.com/minu-ha/for-humanity/blob/main/content/public/images.md) |
104
+ | Configure the site | [Settings](https://github.com/minu-ha/for-humanity/blob/main/content/public/settings.md) |
105
+ | Publish | [Deployment](https://github.com/minu-ha/for-humanity/blob/main/content/public/deployment.md) · [Crawling](https://github.com/minu-ha/for-humanity/blob/main/content/public/crawling.md) |
106
+ | Update | [Changelog](https://github.com/minu-ha/for-humanity/blob/main/content/public/changelog.md) · [Migration](https://github.com/minu-ha/for-humanity/blob/main/content/public/migration.md) |
132
107
 
133
108
  ## License
134
109