Keep CODE_LANGS in README and constants.ts aligned with used languages - #2780
Conversation
There was a problem hiding this comment.
💡 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".
|
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 |
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.
|
Thanks @ElliotFriend — that review is right, and this PR now follows it.
#2781 is the same |
|
@ElliotFriend tracking the future |
ElliotFriend
left a comment
There was a problem hiding this comment.
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 thiswouldn'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! 🎉
|
PR Preview: torn down |
|
Blessed be the based merged lmao. No problem dude |
What
Sync the
CODE_LANGSsnippet inREADME.mdwith the runtime map inconfig/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
CodeExampletab 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
css: 'CSS'andjsx: 'JSX'(fences exist inoverview.mdx,react.mdx,openzeppelin-relayer.mdx).htmlasHTML.html5,css3, orreact.config/constants.ts.Notes
#2781 can be closed as a duplicate of this PR.