Ultraviolet Syntax Highlight

Posted by Revolution Thu, 31 Jul 2008 08:49:00 GMT

it's support languages as follow


actionscript, active4d_html, active4d_ini, active4d_library, active4d, ada, antlr, apache, applescript, asp, asp_vb.net, bibtex, blog_html, blog_markdown, blog_textile, blog_text, build, bulletin_board, cake, camlp4, cm, coldfusion, context_free, css_experimental, css, cs, csv, c, c++, diff, dokuwiki, dot, doxygen, d, dylan, eiffel, erlang, fortran, f-script, fxscript, greasemonkey, gri, groovy, gtdalt, gtd, haml, haskell, html-asp, html_django, html_for_asp.net, html_mason, html_rails, html, html_tcl, icalendar, inform, ini, installer_distribution_script, io, javaproperties, javascript_+_prototype_bracketed, javascript_+_prototype, javascript, java, jquery_javascript, json, languagedefinition, latex_beamer, latex_log, latex_memoir, latex, lexflex, lighttpd, lilypond, lisp, literate_haskell, logo, logtalk, lua, macports_portfile, mail, makefile, man, markdown, mediawiki, mel, mips, mod_perl, modula-3, moinmoin, mootools, movable_type, m, multimarkdown, objective-c, objective-c++, ocamllex, ocaml, ocamlyacc, opengl, pascal, perl, php, plain_text, pmwiki, postscript, processing, prolog, property_list, python_django, python, qmake_project, qt_c++, quake3_config, ragel, r_console, rd_r_documentation, regexp, regular_expressions_oniguruma, regular_expressions_python, release_notes, remind, restructuredtext, rez, r, ruby_experimental, ruby_on_rails, ruby, s5, scheme, scilab, setext, shell-unix-generic, slate, smarty, sql_rails, sql, ssh-config, standard_ml, strings_file, subversion_commit_message, sweave, swig, tcl, template_toolkit, tex_math, tex, textile, tsv, twiki, txt2tags, vectorscript, xhtml_1.0, xml_strict, xml, xsl, yaml, yui_javascript

Posted in  | Tags , ,  | no comments | no trackbacks

Ultraviolet Hack แบบใช้ไปก่อน

Posted by Revolution Wed, 21 Nov 2007 12:34:00 GMT

วิธีการก็เอา syntax ที่มีอยู่ใน typo มา hack ซะ ซึ่งมันเป็น macro อยู่แล้ว จาก plugin ชื่อ typo_textfilter_code ก็ copy ทั้ง folder มาเป็นชื่อ typo_textfilter_uvcode จากนั้นก็แก้ทุกอย่างที่เดิมเป็น code ให้เป็น uvcode แล้วก็แก้ไฟล์ typo_textfilter_uvcode/lib/typo_textfilter_uvcode.rb ดังนี้

def self.macrofilter(blog,content,attrib,params,text="")

        lang       = attrib['lang'] || "plain_text"
        title      = attrib['title']
        cssclass   = attrib['class'] || 'iplastic'
        linenumber = attrib['linenumber'] || false

        text = text.to_s.gsub(/\r/,'').gsub(/\A\n/,'').chomp
        convertor = Uv
        text = convertor.parse(text, "xhtml", lang, linenumber, cssclass)

        "<div class=\"typocode\">#{text}</div>"   

end

จากนั้นก็เอา css จะใช้ไปใส่ที่ public/stylesheets/user-style.css ในนี้เพิ่ม

overflow: auto; 

เข้าไปใน class pre

Posted in  | Tags , , ,  | no comments | no trackbacks