Skip to content

Keep CODE_LANGS in README and constants.ts aligned with used languages - #2780

Merged
ElliotFriend merged 3 commits into
stellar:mainfrom
drQedwards:patch-3
Sep 1, 2026
Merged

Keep CODE_LANGS in README and constants.ts aligned with used languages#2780
ElliotFriend merged 3 commits into
stellar:mainfrom
drQedwards:patch-3

Conversation

@drQedwards

@drQedwards drQedwards commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What

Sync the CODE_LANGS snippet in README.md with the runtime map in config/constants.ts, and only include languages that already appear as code fences in the docs.

Why

@ElliotFriend pointed out that this list is not a catalog of every Prism language — it is the subset used as CodeExample tab labels. The first version of this PR (and #2781) added unused aliases (html5, css3, react) that would document languages we do not actually fence.

Changes

  • Add css: 'CSS' and jsx: 'JSX' (fences exist in overview.mdx, react.mdx, openzeppelin-relayer.mdx).
  • Display html as HTML.
  • Do not add html5, css3, or react.
  • README now states that the snippet must stay in lockstep with config/constants.ts.

Notes

#2781 can be closed as a duplicate of this PR.

Copilot AI balanced review requested due to automatic review settings August 23, 2026 17:30

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e811394bb6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Outdated
@ElliotFriend

Copy link
Copy Markdown
Contributor

hi, @drQedwards! thanks for the contributions!

some of them are useful changes/additions, but i'm not sure about some others. for example, we don't have any code example blocks currently using HTML5 or CSS3 or React as their specified language. are there some changes you're hoping to see that will utilize those languages?

the lists here and in config.ts aren't really meant as a source of truth for all languages that Prisma will highlight. more just a subset that is actively used in our documentation.

drQedwards and others added 3 commits August 31, 2026 19:40
Include react in the list of languages of CSS/CSS3 with HTML5 alongside HTML. The just clarifies how well implemented in the docs the languages.
Aligning with PR stellar#2781
Responds to review: this map is the actively used CodeExample subset, not
every Prism language. Drop unused html5/css3/react aliases. Keep css, html
(capitalized), and jsx because those fences already exist in docs.
Copilot AI review requested due to automatic review settings August 31, 2026 23:41
@drQedwards

Copy link
Copy Markdown
Contributor Author

Thanks @ElliotFriend — that review is right, and this PR now follows it.

CODE_LANGS is only the subset of languages used as CodeExample tab labels, not every language Prism can highlight. I checked the current docs fences:

  • used: css (overview.mdx), html (tutorial + guestbook), jsx (react.mdx, openzeppelin-relayer.mdx)
  • not used: html5, css3, react — those aliases are gone

README.md and config/constants.ts now have the same map. html is capitalized to HTML so the tab label isn’t a raw lowercase key. css and jsx are added because those fences already exist and were falling through to the generic “Example” label.

#2781 is the same constants.ts change and can be closed as a duplicate once this lands.

@drQedwards drQedwards changed the title Update README.md Keep CODE_LANGS in README and constants.ts aligned with used languages Aug 31, 2026

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@drQedwards

Copy link
Copy Markdown
Contributor Author

@ElliotFriend tracking the future react language id (and html5/css3) on #2804 — including where React already lives in the docs/ecosystem (jsx/tsx fences in the React dapp guide, Freighter React guide, OpenZeppelin relayer) and when a react tab label would actually be justified.

@ElliotFriend ElliotFriend left a comment

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.

thanks for consolidating the two PRs.

there's a nit-picky distinction to make, and it doesn't practically affect what we should put in here. but, technically speaking, the languages in the constants.ts file are only ever a factor when code samples are inside a <CodeExample> component. for example, the bytes conversion guide contains examples in Rust, JavaScript, and Python. that code example component cares about what languages exist in constants.ts.

however, "bare" code blocks, actually bypass the constants languages altogether and go right to prism. for example,

a single

```python
print("code block")
```

like this

wouldn't ever be concerned with what language does or doesn't exist in the constants file.

practically speaking, all that doesn't really matter 🤣 it makes sense to me that if we have languages used in the docs, it should live in the constants file (and the readme, too), because people may or may not put it into that code example component.

all that to say, thanks for the PR! 🎉

@ElliotFriend
ElliotFriend merged commit 75e063f into stellar:main Sep 1, 2026
5 checks passed
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PR Preview: torn down

@drQedwards

Copy link
Copy Markdown
Contributor Author

Blessed be the based merged lmao. No problem dude

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.

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

3 participants