Skip to content

docs: migrate 4 README files to a single NRG template - #331

Merged
gouguoyin merged 1 commit into
dromara:masterfrom
andriishin:nrg-migration
May 7, 2026
Merged

gouguoyin merged 1 commit into
dromara:masterfrom
andriishin:nrg-migration

Conversation

@andriishin

Copy link
Copy Markdown
Contributor

Why

README.md, README.cn.md, README.ja.md, README.ko.md are hand-maintained side-by-side. Every README change means editing the same paragraph in 4 places.

This PR migrates all four files to a single source-of-truth template using Nanolaba Readme Generator (NRG). Combined with nanolaba/nrg-action@v1, regeneration happens in CI on every push to master — no toolchain locally, just YAML.

What changes

  • New: README.src.md — the unified source. Each line is tagged with <!--<lang>--> so it appears only in that language's output. Generated programmatically; outputs are byte-identical to today's files (modulo a 2-line auto-generated header).
  • New: .github/workflows/nrg.yml — runs nanolaba/nrg-action@v1 (pinned to NRG 1.1):
    • Push to master touching README.src.md or workflow → regenerates and auto-commits.
    • PR touching any README*.md or template → drift check (mode: check).
  • Modified: all 4 README files — regenerated. The only change is the 2-line auto-generated header at the top.

Verification

Locally, regenerating with NRG 1.1 from Maven Central against current master produces output that diffs against the originals only by the 2-line auto-generated header. Zero functional content change.

How to regenerate locally

curl -L -o nrg.jar https://repo1.maven.org/maven2/com/nanolaba/readme-generator/1.1/readme-generator-1.1.jar
java -jar nrg.jar -f README.src.md

About NRG

com.nanolaba:readme-generator — open-source, Apache 2.0, Java 8+. Ships as CLI, Maven plugin, GitHub Action, and library.

Replaces 4 hand-maintained READMEs (en + cn/ja/ko) with a single
README.src.md, regenerated in CI by nanolaba/nrg-action@v1 on push
to master. All 4 outputs are byte-identical to the originals
(modulo a 2-line auto-generated header NRG injects at the top).

Drift-check job runs in mode: check on PRs that touch any README*.md
or the template, failing the build with a unified diff when a
contributor edits a generated file directly.
@gouguoyin
gouguoyin merged commit aa6b5ec into dromara:master May 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants