docs: migrate README.md / README_ZH.md to a single NRG template - #97
Open
andriishin wants to merge 1 commit into
Open
docs: migrate README.md / README_ZH.md to a single NRG template#97andriishin wants to merge 1 commit into
andriishin wants to merge 1 commit into
Conversation
andriishin
force-pushed
the
nrg-migration
branch
from
April 28, 2026 06:41
fa63f9b to
4f75ff6
Compare
Replaces the two hand-maintained READMEs (~1180 lines each) with a single README.src.md, regenerated in CI by nanolaba/nrg-action@v1 on push to master. Both 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 the template or either generated README, failing the build with a unified diff when a contributor edits a generated file directly. The non-default Chinese filename README_ZH.md is preserved through <\!--@nrg.fileNamePattern.zh=README_ZH.md-->.
andriishin
force-pushed
the
nrg-migration
branch
from
April 28, 2026 07:39
4f75ff6 to
47905c6
Compare
Owner
|
i’ve actually been thinking about doing something like this for a while looks like the right direction for the repo. i’m a bit busy right now but i’ll take a closer look soon. thanks @andriishin 🙌 |
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(EN) andREADME_ZH.md(Chinese) are hand-maintained side-by-side. Both files are ~1180 lines of curated lists with hundreds of entries — every new addition means editing the same paragraph in two places, and drift between the two is easy to introduce.This PR migrates both files to a single source-of-truth template using Nanolaba Readme Generator (NRG). Combined with the bundled GitHub Action
nanolaba/nrg-action@v1, regeneration happens in CI on every push tomaster— no toolchain needed locally, just YAML.What changes
README.src.md— the unified source (~2360 lines). Each line is tagged<!--en-->or<!--zh-->so it appears only in that language's output. The template was generated programmatically by appending each line ofREADME.<lang>.mdwith its language marker and concatenating the streams. Both regenerated outputs are byte-identical to today's files (modulo a 2-line auto-generated header)..github/workflows/nrg.yml— runsnanolaba/nrg-action@v1(pinned to NRG1.1):mastertouchingREADME.src.mdor the workflow: regenerates and auto-commits any changed READMEs.mode: check— fails with a unified diff if a contributor edited a generated file directly.README.md(+2 lines),README_ZH.md(+2 lines) — regenerated. The only change is the 2-line auto-generated header at the top.The non-default Chinese filename
README_ZH.md(rather than the defaultREADME.zh.md) is preserved through<!--@nrg.fileNamePattern.zh=README_ZH.md-->.Verification
Locally, regenerating with NRG
1.1from Maven Central against currentmaster(commit beb0028) produces output that diffs against the originals only by the 2-line auto-generated header. Zero functional content change. Tested with the samenanolaba/nrg-action@v1setup that the workflow uses (Java 17 + NRG 1.1).What's intentionally NOT in this PR
README.src.md. Future PRs can extract shared structural elements (badge URLs, table headers, anchor labels) into shared regions of the template — incremental, reviewable changes.How to regenerate locally
About NRG
com.nanolaba:readme-generator— open-source, Apache 2.0, Java 8+. Ships as a CLI, Maven plugin, GitHub Action, and library. The action approach used here requires zero local toolchain — Java is provisioned by the action.