Class: Md2key::Highlight
- Inherits:
-
Object
- Object
- Md2key::Highlight
- Defined in:
- lib/md2key/highlight.rb
Constant Summary collapse
- DEFAULT_EXTENSION =
"txt"
Class Method Summary collapse
Class Method Details
.pbcopy_highlighted_code(code) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/md2key/highlight.rb', line 5 def pbcopy_highlighted_code(code) ensure_highlight_availability extension = code.extension || DEFAULT_EXTENSION IO.popen("highlight -O rtf -K 28 -s rdark -k Monaco -S #{extension} -u utf-8 | pbcopy", 'w+') do |highlight| highlight.write(code.source) highlight.close end end |