Skip to content

docs(dev): collapse per-language extension guides into <details> switches - #2247

Open
noron12234 wants to merge 1 commit into
TEN-framework:mainfrom
noron12234:docs/ext-dev-language-switch
Open

docs(dev): collapse per-language extension guides into <details> switches#2247
noron12234 wants to merge 1 commit into
TEN-framework:mainfrom
noron12234:docs/ext-dev-language-switch

Conversation

@noron12234

Copy link
Copy Markdown
Contributor

Closes #1994.

Problem

The extension development guide (docs/development/how_to_develop_with_ext.md and its .cn.md counterpart) tiled all four language sections (C++, Go, Python, Node.js) on one page. A reader looking only for Python still had to scroll past ~200 lines of C++ and ~170 lines of Go before reaching the guide they wanted. The Chinese version is the same shape and had the same problem.

The issue asks for switch-like behavior instead of tiling.

Fix

Wrap each language section in a collapsible <details><summary> block. Readers now see a compact list of four language guides and expand the one they need.

## Language-specific Development Guides

Click a language below to expand its full guide.

<details>
<summary><strong>C++ Extension Development</strong></summary>

...C++ content unchanged...

</details>

<details>
<summary><strong>Go Extension Development</strong></summary>

...Go content unchanged...

</details>

...Python...
...Node.js...

Same shape in both how_to_develop_with_ext.md and how_to_develop_with_ext.cn.md.

Why this shape

  • Matches an existing conventiondocs/getting-started/websocket-voice-assistant-quick-start.md already uses <details><summary><strong> for its Troubleshooting section (five blocks). Reusing that pattern rather than inventing something.
  • Framework-neutral — plain HTML <details> renders on GitHub and on any Fumadocs / MDX / static-site renderer without additional imports. No import { Tabs } shim required.
  • Zero content edits — the inner content of each language section (including the ### subheadings that generate TOC anchors) is untouched. Diff is boundaries only.

Verification

$ grep -c '^<details>' docs/development/how_to_develop_with_ext.md    #  4
$ grep -c '^</details>' docs/development/how_to_develop_with_ext.md   #  4
$ grep -c '^<details>' docs/development/how_to_develop_with_ext.cn.md #  4
$ grep -c '^</details>' docs/development/how_to_develop_with_ext.cn.md #  4

Both files preserve their inner ### subheading structure (Create Project, Run Tests, etc.) so any TOC generator or deep-link that pointed at those anchors still resolves.

Files changed

  • docs/development/how_to_develop_with_ext.md (+24 −7)
  • docs/development/how_to_develop_with_ext.cn.md (+24 −7)

Alternatives considered

  • MDX <Tabs> component — would need to convert the file to .mdx and add an import; larger blast radius and framework-specific. Happy to switch if the maintainers prefer tabs and can point me at the right component import path.
  • Splitting into four files (per language) — cleaner but changes URLs and breaks any external links currently pointing at #c-extension-development etc.

…ches

Closes TEN-framework#1994.

The extension development guide tiled all four language sections (C++, Go,
Python, Node.js) on one page. A reader looking only for Python still had to
scroll past ~200 lines of C++ and ~170 lines of Go before reaching the guide
they wanted.

Wrap each language section in a collapsible <details><summary> block so
readers open the guide they need. Matches the existing collapsible pattern
already used in docs/getting-started/websocket-voice-assistant-quick-start.md.

Both English and Chinese versions updated symmetrically. Content untouched
inside each section — only the outer boundaries changed.
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.

[DOC] In the Extension development documentation, guides of different languages ​​can be changed to switch instead of being tiled.

1 participant