docs: migrate 4 README files to a single NRG template#424
Open
andriishin wants to merge 1 commit intoopensolon:mainfrom
Open
docs: migrate 4 README files to a single NRG template#424andriishin wants to merge 1 commit intoopensolon:mainfrom
andriishin wants to merge 1 commit intoopensolon:mainfrom
Conversation
98adc38 to
cc3ef47
Compare
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.
cc3ef47 to
818a426
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
README.md,README_CN.md,README_JP.md,README_RU.mdare 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.mdinto N localized README files on every build.What changes
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).pom.xml— addscom.nanolaba:nrg-maven-plugin:1.1to the parent POM's<build><plugins>with<inherited>false</inherited>so child modules don't try to regenerate the README themselves. Bound to thecompilephase.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.mdwith underscore separators) are preserved through<!--@nrg.fileNamePattern.<lang>=README_<XX>.md-->.⚠ A small heads-up about
README_EN.mdREADME_EN.mdis currently a near-exact duplicate ofREADME.md(differ only by one trailing space on line 88). SinceREADME.mdis already in English,README_EN.mdlooks 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:README_EN.mdand update any links pointing to it; orcpafter the NRG run) to copyREADME.md→README_EN.mdso they stay in sync automatically.Happy to send a follow-up PR for either option once you decide.
Verification
Locally, regenerating with NRG
1.1from Maven Central against currentmain(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 andnrg-maven-plugin:1.1.What's intentionally NOT in this PR
README.src.md. Future PRs can extract shared structural elements (badges, install snippets) into shared regions.<check>false</check>keeps the build forgiving today. A follow-up can flip it totrueonce the workflow settles in.How to regenerate locally
(or
mvn nrg:create-filesto 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 inpom.xml, no runtime dependency on the plugin once READMEs are committed.