Skip to content

docs: migrate README.md / README.cn.md to a single NRG template#141

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

docs: migrate README.md / README.cn.md to a single NRG template#141
andriishin wants to merge 1 commit into
reorx:masterfrom
andriishin:nrg-migration

Conversation

@andriishin
Copy link
Copy Markdown

Why

README.md (EN) and README.cn.md (Chinese) are hand-maintained side-by-side. As the awesome-list grows, every new entry means editing the same paragraph in two places — easy to add to one and forget the other.

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 master — no toolchain locally, just YAML.

What changes

  • New: README.src.md — the unified source. Each line is tagged <!--en--> or <!--cn--> so it appears only in that language's output. Generated programmatically from the existing two files; 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.1):
    • Push to master touching README.src.md or workflow → regenerates and auto-commits.
    • PR touching any of the three files → drift check (mode: check) — fails with unified diff when a contributor edits a generated file directly.
  • Modified: README.md (+2 lines), README.cn.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 (commit 11ebae2) 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

  • Translation alignment / link curation. Today's content lives unchanged in README.src.md. Future PRs can extract shared structural elements (badge URLs, table headers) into shared regions — incremental, reviewable changes.
  • Nothing else in the repo is touched. Just the two READMEs and a docs workflow.

How to regenerate locally

curl -L -o nrg.jar https://repo1.maven.org/maven2/com/nanolaba/readme-generator/1.1/readme-generator-1.1.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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a source file README.src.md to manage bilingual content (English and Chinese) using the Nanolaba Readme Generator (NRG), while updating the existing README files to reflect they are now auto-generated. The review feedback highlights several areas for improvement: interleaving translations to prevent content drift, removing Japanese characters and fixing indentation in the English section, and completing translations for descriptions and headers in the Chinese section to maintain consistency and fix broken table of contents links.

Comment thread README.src.md
@@ -0,0 +1,974 @@
<!--@nrg.languages=en,cn-->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While migrating to a single source file is a significant improvement, the current structure of two large language blocks still requires maintaining content in two separate locations within the file. To better prevent content drift (such as the missing entries for 'Immersive Translate' in English or 'TeamSmart AI' in Chinese), consider interleaving the lines (e.g., placing the Chinese translation immediately after the English line). This makes discrepancies much easier to spot during review and ensures both versions stay in sync as the list grows.

Comment thread README.src.md
<!--en-->
- [Glarity](https://glarity.app/)<!--en-->
<!--en-->
Summarize Google search results or YouTube videos with ChatGPT API, also supports Yahoo! ニュース、PubMed、PMC、NewsPicks、Github、Nikkei、 Bing、Google Patents. This extension also supports ChatGPT Webapp's API which requires no configuration.<!--en-->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line contains Japanese characters ('ニュース') and Japanese-style commas ('、') in the English section. Additionally, the indentation (9 spaces) is inconsistent with the standard 8-space indentation for sub-items in this file. It should be cleaned up for consistency.

Suggested change
Summarize Google search results or YouTube videos with ChatGPT API, also supports Yahoo! ニュース、PubMedPMCNewsPicksGithubNikkei BingGoogle Patents. This extension also supports ChatGPT Webapp's API which requires no configuration.<!--en-->
Summarize Google search results or YouTube videos with ChatGPT API, also supports Yahoo! News, PubMed, PMC, NewsPicks, Github, Nikkei, Bing, Google Patents. This extension also supports ChatGPT Webapp's API which requires no configuration.<!--en-->

Comment thread README.src.md
<!--cn-->
一个用Astro和TypeScript构建的ChatGPT web应用演示。<!--cn-->
<!--cn-->
相关项目: [ChatGPT-Vercel](https://github.com/ourongxing/chatgpt-vercel) is another ChatGPT web app based on ddiu8081/chatgpt-demo, specifically made for deploying on Vercel.<!--cn-->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description for this project is still in English in the Chinese section. It should be translated to Chinese to maintain consistency with the rest of the document.

Suggested change
相关项目: [ChatGPT-Vercel](https://github.com/ourongxing/chatgpt-vercel) is another ChatGPT web app based on ddiu8081/chatgpt-demo, specifically made for deploying on Vercel.<!--cn-->
相关项目: [ChatGPT-Vercel](https://github.com/ourongxing/chatgpt-vercel) 是另一个基于 ddiu8081/chatgpt-demo 的 ChatGPT Web 应用,专门为在 Vercel 上部署而设计。<!--cn-->

Comment thread README.src.md
<!--cn-->
毫不费力地管理您的聊天和文件夹,同时监控成本与直观的macOS应用程序,由ChatGPT API供电,并设计为最大的生产力。内置提示模板,支持GPT-3.5和GPT-4。<!--cn-->
<!--cn-->
### Special-purpose<!--cn-->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This header is not translated to Chinese, which results in a broken link in the Table of Contents (line 534) and inconsistent language in the document. It should be translated to '特殊用途' to match the TOC entry and the first occurrence of this section at line 705.

Suggested change
### Special-purpose<!--cn-->
### 特殊用途<!--cn-->

Replaces the two hand-maintained READMEs (~485 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.
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