Skip to content

docs: migrate README.md / README-EN.md to a single NRG template - #46

Open
andriishin wants to merge 1 commit into
louislivi:masterfrom
andriishin:nrg-migration
Open

docs: migrate README.md / README-EN.md to a single NRG template#46
andriishin wants to merge 1 commit into
louislivi:masterfrom
andriishin:nrg-migration

Conversation

@andriishin

Copy link
Copy Markdown

Why

README.md (Chinese) and README-EN.md (English) 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 <!--zh--> or <!--en--> 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 <build><plugins> after maven-compiler-plugin, with <inherited>false</inherited>. Bound to the compile phase.
  • Modified: README.md (+2 lines), README-EN.md (+2 lines) — 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

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 (Chinese + English) 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 English filename README-EN.md is preserved through
nrg.fileNamePattern.en. Chinese remains the default language so
README.md continues to point to the Chinese version.
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