Skip to content

Tabbed content blocks for multi-language examples #7

@engineervix

Description

@engineervix

Summary

Support tabbed content blocks — a common pattern in documentation for showing the same example in multiple languages or package managers side by side.

Proposed syntax

::: tabs
@tab Go
\`\`\`go
import "github.com/example/lib"
\`\`\`

@tab Python
\`\`\`python
import example_lib
\`\`\`
:::

Implementation notes

  • Implement as an extension to the existing admonition block parser in internal/parser/admonitions.go, or as a separate goldmark extension
  • Renders to HTML with <div class="tabs"> + <button role="tab"> + <div role="tabpanel"> structure
  • Tab switching handled in assets/main.js — no extra dependency
  • Tab state should be remembered in localStorage keyed by tab label (so switching "Go/Python" persists across pages)
  • Consider: should all tab groups with the same labels sync? (e.g. switching to "Python" in one block switches all "Python" tabs on the page)

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentContent authoring featuresenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions