Skip to content

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

Open
andriishin wants to merge 1 commit intoopensolon:mainfrom
andriishin:nrg-migration
Open

docs: migrate 4 README files to a single NRG template#424
andriishin wants to merge 1 commit intoopensolon:mainfrom
andriishin:nrg-migration

Conversation

@andriishin
Copy link
Copy Markdown

Why

README.md, README_CN.md, README_JP.md, README_RU.md are hand-maintained side-by-side. Every README change means editing the same paragraph in 4 places — easy to update one and let the rest drift.

This PR migrates all four 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 with <!--<lang>--> so it appears only in that language's output. Generated programmatically from the existing four files; 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> so child modules don't try to regenerate the README themselves. Bound to the compile phase.
  • Modified: README.md, README_CN.md, README_JP.md, README_RU.md — regenerated. The only change is the 2-line auto-generated header at the top.

The non-default Western-style filenames (README_CN.md / README_JP.md / README_RU.md with underscore separators) are preserved through <!--@nrg.fileNamePattern.<lang>=README_<XX>.md-->.

⚠ A small heads-up about README_EN.md

README_EN.md is currently a near-exact duplicate of README.md (differ only by one trailing space on line 88). Since README.md is already in English, README_EN.md looks redundant — but I deliberately left it untouched in this PR since I'm not sure of the original intent. If you want, a follow-up can either:

  1. Delete README_EN.md and update any links pointing to it; or
  2. Keep both, and add a CI step (or cp after the NRG run) to copy README.mdREADME_EN.md so they stay in sync automatically.

Happy to send a follow-up PR for either option once you decide.

Verification

Locally, regenerating with NRG 1.1 from Maven Central against current main (commit 80abf46, 3.10.5-SNAPSHOT) produces output that diffs against the originals only by the 2-line auto-generated header. Zero functional content change. Tested with Java 8 and nrg-maven-plugin:1.1.

What's intentionally NOT in this PR

  • Translation alignment. The auto-generated template uses per-line language markers — today's content lives unchanged in README.src.md. Future PRs can extract shared structural elements (badges, install snippets) into shared regions.
  • CI hardening. <check>false</check> keeps the build forgiving today. A follow-up can flip it to true once the workflow settles in.

How to regenerate locally

mvn compile

(or mvn nrg:create-files to skip the rest of the build).

About NRG

com.nanolaba:readme-generator — open-source, Apache 2.0, Java 8+. Ships as a CLI, Maven plugin, GitHub Action, and library. ~17 lines of XML in pom.xml, no runtime dependency on the plugin once READMEs are committed.

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

The non-default Western-style filenames (README_CN.md, README_JP.md,
README_RU.md, with underscore separator) are preserved through
nrg.fileNamePattern.<lang> overrides.

NOTE: README_EN.md is left untouched. It currently duplicates
README.md (differ only by one trailing space on line 88) and looks
redundant — the migration leaves it untouched in this PR but it
could be deleted in a follow-up since README.md is already in
English.
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