<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          RougeRuby 的代碼高亮庫

          聯(lián)合創(chuàng)作 · 2023-09-23 04:17

          Rouge 是一個純 Ruby 實現(xiàn)的代碼高亮庫。它支持高亮 60 多種語言的代碼,可以輸出 HTML、ANSI-256 色文本格式。而且它的 HTML 輸出兼容 Pygments 的語法高亮樣式。

          示例代碼:

          # make some nice lexed html
          source = File.read('/etc/bashrc')
          formatter = Rouge::Formatters::HTML.new(:css_class => 'highlight')
          lexer = Rouge::Lexers::Shell.new
          formatter.format(lexer.lex(source))
          
          # Get some CSS
          Rouge::Themes::ThankfulEyes.render(:scope => '.highlight')

          它還提供了一個命令行的工具,可以這么使用:

          rougify foo.rb
          瀏覽 19
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  人妻免费91 | 国产色五月天 | 国产精品国产亚洲精品看不 | 国产视频黄片 | 在线啊v视频 |