Skip to content

docs: migrate README.md / README.ru.md to a single NRG template#2122

Open
andriishin wants to merge 1 commit into
bem:v7from
andriishin:nrg-migration
Open

docs: migrate README.md / README.ru.md to a single NRG template#2122
andriishin wants to merge 1 commit into
bem:v7from
andriishin:nrg-migration

Conversation

@andriishin
Copy link
Copy Markdown

Why

README.md (English) and README.ru.md (Russian) are hand-maintained side-by-side. As bem-components picks up new components, control variants, examples, this means editing the same paragraph in two places — easy to update one and let the other drift.

This PR migrates both files to a single source-of-truth template using Nanolaba Readme Generator (NRG). Combined with nanolaba/nrg-action@v1, regeneration happens in CI on every push to v7 — no toolchain locally, just YAML.

What changes

  • New: README.src.md — the unified source. Each line is tagged <!--en--> or <!--ru--> 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).
  • New: .github/workflows/nrg.yml — runs nanolaba/nrg-action@v1 (pinned to NRG 1.2):
    • Push to v7 that touches README.src.md or the workflow file → regenerates and auto-commits any changed READMEs.
    • PR that touches the template or either README → drift check (mode: check), fails the build with a unified diff if a contributor edits a generated file directly without updating the template.
  • Modified: README.md (+2 lines), README.ru.md (+2 lines) — regenerated. The only change is the 2-line auto-generated header at the top of each file.

Verification

Locally, regenerating with NRG 1.2 against current v7 produces output that diffs against the originals only by the 2-line auto-generated header. Zero functional content change.

What's intentionally NOT in this PR

  • Content edits beyond regeneration. The current EN/RU files are recreated bit-for-bit. Any future translation alignment is an incremental edit inside README.src.md.
  • No JS / build impact. Nothing changes in source code, package.json, or any build step. Only README files and a docs workflow.

How to regenerate locally

curl -L -o nrg.jar https://repo1.maven.org/maven2/com/nanolaba/readme-generator/1.2/readme-generator-1.2.jar
java -jar nrg.jar -f README.src.md

About NRG

com.nanolaba:readme-generator — open-source, Apache 2.0, Java 8+. Ships as CLI, Maven plugin, GitHub Action, and library. Zero local toolchain needed when used through the action — Java is provisioned by the runner.

Replaces the two hand-maintained READMEs with a single
README.src.md, regenerated in CI by nanolaba/nrg-action@v1
(NRG 1.2) on push to v7. 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 README, failing the build with a unified diff
when a contributor edits a generated file directly.
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