-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map codeblock language to display title for improved clarity #4425
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for react-native ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@Abbondanzo this is a continuation of the previous PR |
I still don't think that those automated titles based on the snippets languages are necessary to display. I would prefer to retain previous behaviour and usage, where title need to be specified, and was reserved for file name or example description. |
There are cases where we just repeat ourselves, which feels really redundant, and it also exposes a lot of incorrectly set languages cross the website content (often mistakes are marking JSX as TSX, or vice-versa). In general, I think that it would be more helpful for the readers if we go manually thought the pages and add meaningful titles or correct filenames rather than trying to automate the labeling process, which results in not that helpful titles. |
I understand your pov and here are some arguments i've thought about:
|
Enhance codeblocks by mapping languages to their corresponding titles.
example of available titles: https://prismjs.com/index.html#supported-languages
before
after
before
after
before
after
Click to expand: decided to simplify and just provide the compiled array directly, keeping the original code used to generate the mapping array for reference