https://github.com/razvii22/jekyll-unified-codeblocks
Ruby gem that unifies Jekyll and Kramdown's codeblocks.
https://github.com/razvii22/jekyll-unified-codeblocks
codeblocks jekyll kramdown monkey-patching
Last synced: 6 months ago
JSON representation
Ruby gem that unifies Jekyll and Kramdown's codeblocks.
- Host: GitHub
- URL: https://github.com/razvii22/jekyll-unified-codeblocks
- Owner: razvii22
- License: mit
- Created: 2025-05-16T23:41:24.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-06-06T12:55:33.000Z (8 months ago)
- Last Synced: 2025-06-06T13:43:07.311Z (8 months ago)
- Topics: codeblocks, jekyll, kramdown, monkey-patching
- Language: Ruby
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Jekyll Unified Codeblocks
A simple monkey-patched gem that unified Jekyll's `{%highlight%}` tag with Kramdown's GFM style code fences.
# Usage
## HTML
JUC generates the following `general` HTML structure for styling.
```html
[lang]
code!
```
Where `[lang]` is the language name.
JUC does not modify how code tags are structured, this still differs between `{% highlight %}` and code fences.
## Installation
JUC internally overrides Jekyll and Kramdown methods when loaded, therefore installation is as simple as adding the following to your Jekyll site Gemfile:
`gem 'jekyll-unified-codeblocks', git: "https://github.com/razvii22/jekyll-unified-codeblocks"`
and then run `bundle install`.
Then you need to add JUC to the `_config.yml` file of your jekyll project:
```yaml
plugins:
- jekyll-unified-codeblocks
```
If everything installed and loaded correctly, you should see the following message in your terminal the next time you build or serve your jekyll site:
`Jekyll-unified-codeblocks has been loaded :3`
# Note
JUC also patches Jekyll's `{% highlight %}` block's annoying behaviour of throwing an error if a language is not specified, instead, it will now default to `plaintext` as the language if none is specified.