Writing code block highlighting to a CSS file with Rouge.
Konnor Rogers
Posted on July 8, 2021
Purpose
To remind myself how to do this again in the future.
How to do it?
To append a Rouge theme to an existing file you can do the following:
gem install rouge
irb
require "rouge"
theme = Rouge::Themes::Github.new.render
File.open("<path-to-file>", "a+") { |f| f.write(theme) }
All themes
https://github.com/rouge-ruby/rouge/tree/master/lib/rouge/themes
💖 💪 🙅 🚩
Konnor Rogers
Posted on July 8, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.