Skip to content

docs: migrate README.md / README_zh-CN.md to a single NRG template - #15

Open
andriishin wants to merge 1 commit into
catas-w:mainfrom
andriishin:nrg-migration
Open

docs: migrate README.md / README_zh-CN.md to a single NRG template#15
andriishin wants to merge 1 commit into
catas-w:mainfrom
andriishin:nrg-migration

Conversation

@andriishin

Copy link
Copy Markdown

Why

README.md and README_zh-CN.md are hand-maintained side-by-side. Every README change means editing the same paragraph in two places.

This PR migrates both files to a single source-of-truth template using Nanolaba Readme Generator (NRG) — a small Java 8 Maven plugin that turns one README.src.md into N localized README files on every build.

What changes

  • New: README.src.md — the unified source. Each line is tagged <!--en--> or <!--zh-CN--> 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).
  • Modified: pom.xml — adds com.nanolaba:nrg-maven-plugin:1.1 to the parent POM's <build><plugins> with <inherited>false</inherited>. Bound to the compile phase.
  • Modified: README.md (+2 lines), README_zh-CN.md (+2 lines) — regenerated. The only change is the 2-line auto-generated header at the top.

The non-default Chinese filename README_zh-CN.md is preserved through <!--@nrg.fileNamePattern.zh-CN=README_zh-CN.md-->.

Verification

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

How to regenerate locally

mvn compile

About NRG

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

Replaces the two hand-maintained READMEs with a single
README.src.md, regenerated by nrg-maven-plugin during the compile
phase. Both outputs are byte-identical to the originals (modulo a
2-line auto-generated header NRG injects at the top).

The non-default Chinese filename README_zh-CN.md is preserved
through nrg.fileNamePattern.zh-CN.
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.

1 participant