-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Added optional rendering of code block titles #148
Conversation
… Chroma If a user provides a title as an argument to a code block, it will be added as a child `div.code-title` to `div.highlight`, inserted before `div.chroma`. - Included default styling (`code-title.scss`) adapted from `syntax.scss`. - Added this as a function rendered in the `partials/head.html` inside the `render()` function, *if* `enableCodeBlockTitle=true` in the `data/config.yaml`.
Woah this looks great! Would love to have this feature. Could you add documentation for using this feature as well? Happy to merge as soon as you do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great, just a few comments on documentation!
Everything seems to be in order. The only unresolved comment was the use of variables from the |
ftr, separate syntax styling was added successfully. |
pushed a few changes to master, do you mind bringing your branch up to date + resolving merge conflicts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small question, rest looks good! excited to merge this soon
Had a delay there thanks to load shedding and a concern that I might have broken something. I now confirmed that it's not just my branch, but also yours (#154). This is all ready for you to merge, if everything works well on your side. |
Hi,
I added something I put together for my notes website. It's an optional feature to render code titles for code blocks. The steps to enable them are:
enableCodeBlockTitle: true
todata/config.yaml
title=<title>
attribute to code block as demonstrated here with other attributes available in hugo.An afterthought: Perhaps a little extra should be added to the documentation for setting the
title
via highlight shortcode and markdown code fences.