-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a language label to code blocks #428
base: master
Are you sure you want to change the base?
Conversation
I really like the idea! Nevertheless I am not quite sure if it would be better to have this feature configurable. At least so existing installations could switch back to the old style. Technically I don't like the fact, that every Now that your patch for #427 is applied, the grey color needs alignment. ...and as a matter of taste, the border radius is a bit too large in comparison to other radiuses like the one of the search box. |
Sadly, this change may not look that good together with the proposed "tab" feature #386. |
@McShelby I think the two proposed changes address two completely different use cases. My change is best used when different code snippets are present on the same page individually in multiple languages and formats -- eg. bash scripts, code snippets, HTML -- etc. I'm using this theme for course material and the labels are extremely helpful for beginner developers who may not know when to switch between their terminal and their editor. The tab view proposed in #386 is far more useful for API documentation -- when the same snippet of code is presented in different languages or output formats. Personally, I'd implement it like this:
Optionally they can be styled to look cohesive if both were used on one page but I'd need help with this as I'm not great with CSS. If this is something you're interested in I can fix the merge conflict and wrap language labels in a config param that is off by default. |
I'ld love to work with you on this PR. Sadly I am not a maintainer (yet). So before diving into this, it would be great to hear the opinion of @matalo33 and/or @matcornic about this. |
Ok, I'll wait to hear from them before proceeding with changes. |
Add a language label to each individual code block, move the copy to clipboard button down to accommodate the new header
Before
After