This repository contains GL.iNet router documentation built with MkDocs. These rules apply to general documentation editing, whether the change is for English source docs, localized docs, navigation, images, or supporting scripts.
- Produce publishable technical support documentation.
- Keep product behavior, security notes, warnings, limits, and setup workflows technically accurate.
- Do not add product claims, troubleshooting advice, compatibility statements, or behavioral explanations unless they are supported by the source material or nearby documentation.
- Prefer concise, neutral, instructional wording over conversational or marketing-heavy language.
- Preserve exact product names, model names, firmware versions, IP addresses, URLs, port numbers, file names, protocol names, and option values.
- Preserve Markdown structure unless the requested change requires otherwise.
- Keep headings, callouts, numbered steps, bullet lists, tables, image references, links, and separators coherent with nearby pages.
- Preserve admonition blocks such as
!!! Noteand keep their content complete. - Keep image URLs and relative links unchanged unless the target file or path intentionally changes.
- Every Markdown heading in every language, including English, carries an explicit ID, for example
## Port Forwards {#port-forwards}. Always include the#;{port-forwards}without#does not set an ID. - English is the source of heading IDs. A localized heading uses the same ID as the matching English heading: translate the heading text, never the ID.
- IDs are lowercase ASCII kebab-case and unique within the page. For a new heading, derive the ID from the English heading text. For a heading that exists only in a localized page, derive the ID from an English rendering of that heading.
- Heading IDs follow the current English heading text. When an English heading changes, update its ID to the lowercase ASCII kebab-case form of the new title, keep it unique within the page, and synchronize the matching ID in every language plus all in-repository anchor links and redirects to that section. This is normal maintenance and needs no separate migration approval. Do not derive shared IDs from localized titles or rename IDs when only a translation's wording changes.
- Repeated subheadings may use their current English parent section as an ID prefix to stay unique and meaningful. For example,
### Parameters {#amneziawg-v20-parameters}under## AmneziaWG V2.0 {#amneziawg-v20}and{#amneziawg-v31-parameters}under AmneziaWG V3.1 are valid;Overviewmay use the same prefixes. Such IDs follow the current title plus its section context, not the title alone; do not lengthen visible headings or remove valid context prefixes just to obtain an exact title-only slug. Update affected scoped IDs and references when their English title or parent context changes. - Do not preserve an old ID or add an old-anchor alias solely for external links or bookmarks. Existing unchanged headings need no bulk ID rewrite. Approved localized-only legal sections retain their protected wording and IDs.
- Anchor links use the shared ID in every language, for example
[Tunnel-Optionen](vpn_dashboard.md#tunnel-options). Do not add<a id>or<span id>placeholders for headings. - After adding or editing headings or anchor links, run
python scripts/anchors.py check. - New English headings do not need IDs typed by hand:
python scripts/anchors.py add --lang en <page>and the pre-commit hook add the ID MkDocs generates, and on pull requests the PR check posts a one-click suggestion for each heading without an ID.
- Preserve actual product UI labels when they appear in screenshots or navigation paths.
- Keep left-navigation paths aligned with the product UI, for example:
**VPN** -> **VPN Dashboard**. - If a button or menu label is visibly English in the UI, it is acceptable to keep the label in English in localized docs.
- Do not invent localized UI labels that are not shown in the product.
- Distinguish between explanatory prose and literal UI labels.
- Read enough surrounding context before editing a page.
- Prefer updating the existing matching page instead of creating a different structure unless a new page is required.
- Keep related localized and English documentation structures compatible when the change naturally affects multiple languages.
- When editing shared scripts or automation, update hard-coded documentation paths that depend on moved files.
- Before finishing, scan for broken links, malformed Markdown, missing images, and accidental mixed-language fragments when those risks are relevant.
Use the glinet-docs-translation skill for translation-specific tasks, including translating English docs into localized docs, syncing English changes into localized files, or reviewing localized translation quality. Keep detailed translation workflow and language terminology rules in that skill, not in this default repository guidance.
After adding, renaming, or deleting pages, editing redirect_maps, or changing localized pages, run python scripts/i18n_check.py. It compares each localized page with the English page section by section (images, admonitions, code blocks, tables, links, IP addresses, and version numbers) and reports orphan pages and broken redirects. It also flags untranslated English and language rules such as Italian accents, Russian letters in Ukrainian, and French spaces before : ; ? !. Fix the translation; add an entry to scripts/i18n_allowlist.yml only for intentional differences, with a reason.
Localized-only legal sections ({#declaration-of-conformity}, {#safety-information}) keep their approved wording. translation_delta.py mark, the pre-commit hook, and the translation workflow (i18n_check.py --base) report protected-section when such a section is removed or its text changed; restore it with the git show command in the message.
The pre-commit hook in .githooks/ runs these checks on staged files; enable it with git config core.hooksPath .githooks.
Pull requests run .github/workflows/pr-check.yml: the same checks on the changed files, strict builds of the changed languages, and scripts/pr_check.py on the added lines (codespell spelling and missing images fail; LanguageTool grammar, removed heading IDs, mismatched image alt text, and copied "Official Website" links are warnings). If codespell flags a correct word, add it to scripts/codespell_ignore.txt.