搜尋此網誌

2015年12月9日 星期三

redmine 3.1.0 BASH Syntax Highlighting


Install:


[root@redmine redmine]# cd vendor/bundle/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/scanners

[root@redmine scanners]# wget https://raw.githubusercontent.com/pejuko/coderay_bash/master/lib/coderay/scanners/bash.rb

[root@redmine scanners]# systemctl reload httpd.service



Usage:

<pre><code class="bash">
          if [ "$TMP_MONTH" -le 0 ]; then
        THRESHOLD_YEAR=`echo $(( $CURRENT_YEAR - 1 ))`
        THRESHOLD_MONTH=`echo $(( 12 + TMP_MONTH ))`
else
        THRESHOLD_YEAR=$CURRENT_YEAR
        THRESHOLD_MONTH=$TMP_MONTH
fi
return 0;
}
</code></pre>

Optional:


[root@redmine redmine]# vim vendor/bundle/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/helpers/file_type.rb

# near line 79 add
    TypeFromExt = {
      'bash'   => :bash,
      'c'         => :c,
      'cfc'      => :xml,
      'cfm'     => :xml,
      'clj'       => :clojure,
      'css'      => :css,
      'diff'     => :diff,
      'dpr'      => :delphi,
      ...............

[root@redmine redmine]# systemctl restart httpd.service



沒有留言:

張貼留言