DEV Community 👩‍💻👨‍💻

Konnor Rogers
Konnor Rogers

Posted on

Writing code block highlighting to a CSS file with Rouge.


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

require "rouge"
theme ="<path-to-file>", "a+") { |f| f.write(theme) }
Enter fullscreen mode Exit fullscreen mode

All themes

Top comments (0)


Thank you.

Thanks for visiting DEV, we’ve worked really hard to cultivate this great community and would love to have you join us. If you’d like to create an account, you can sign up here.