Skip to content

CODE_LANGS: only add React (and similar) when docs actually fence them #2804

Description

@drQedwards

Status

Follow-up from #2780 and @ElliotFriend’s review: CODE_LANGS in config/constants.ts is the subset of languages used as CodeExample tab labels, not every language Prism can highlight.

Done in #2780 (README + config/constants.ts stay in lockstep):

Key Tab label Why
css CSS Already fenced in docs/build/apps/example-application-tutorial/overview.mdx
html HTML Already fenced across the example-application tutorial and guestbook frontend
jsx JSX Already fenced in docs/build/guides/dapps/react.mdx and docs/tools/openzeppelin-relayer.mdx

Not added (no fences in the docs today): react, html5, css3.

Future: when react (or html5/css3) should land

Add a CODE_LANGS key only when a CodeExample fence actually uses that language id, so the tab does not fall back to “Example”. Until then, React content in the docs should keep using jsx / tsx (what the files already use).

See the comment below for where React already lives in the ecosystem and where a react language id could show up later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions