Login 
  Remiya.com  Home   Products   Freebies   Help   
  
Menu & Navigation
 Freebies
 - JQuery HtmlBox
 - JQuery Codify
 - JQuery Dropdown
 - JQuery Tablify

Latest News
New Version of JQuery Codify Released
- Posted: 21.03.11
New Website Design
- Posted: 01.02.11
View All
 
Content
  Location:» Freebies» JQuery Codify 

JQuery Codify

Overview

Codify is a JQuery plugin built to extremely simplify highlighting of specified pieces of text in the web page.

Optionally, Codify, using Geshi as backengine, can syntax highlight source code of over 180 programming languages.

Demo

Features

Easy Integration. Takes no exaustive coding of your part. A single line of JavaScript is more than enough. Or even easier - copy an example from this website and paste.

Multiple Browser Support. Codify has been tested and is working fine in Mozilla Firefox, Internet Explorer 6.0, Opera, Safari and Netscape Navigator.

Small Size. With the size of 8kb Codify is a pearl of art in the large family of syntax hyghlighters and is a must have for every JQuery developer.

Highly Configurable. Codify can be easily configured according to your requests.

Getting started

To use the Codify plugin, include the jQuery library and the Codify plugin inside the tag of your HTML document.

    <script src="jquery.min.js" type="text/javascript">
    <script src="jquery.codify.js" type="text/javascript">

Next Put your source code in the HTML tag <code> or <pre>. Second. Specify the title to be shown in the title attribute of the start tag (i.e. <code title="HTML Source">). Third. Specify which language to be used for highlighting (i.e. <pre title="JavaScript" class="javascript">).

Note. The difference between the <code> and <pre tag is, that with the code tag the code inside should be HTML formatted (i.e. instead of space one should use &nbsp; and <br /> instead of new line)

<pre title="JavaScript" class="green">
    var array = new Array();
    array[array.length] = "Hello world";
</pre>

Finally. Call the codify plugin.

$(document).ready(function(){
    $("pre").codify();
});

Available styles?

There are currently four styles available - blue, green, red and uni (default).

$(document).ready(function(){
    $("pre").codify({style:"blue"});
});
$(document).ready(function(){
    $("pre").codify({style:"green"});
});
$(document).ready(function(){
     $("pre").codify({style:"red"});
});
$(document).ready(function(){
    $("pre").codify();
});

These can be optionally with no title shown.

$(document).ready(function(){
    $("pre").codify({title:false,style:"blue"});
});
$(document).ready(function(){
    $("pre").codify({title:false,style:"green"});
});
$(document).ready(function(){
     $("pre").codify({title:false,style:"red"});
});
$(document).ready(function(){
    $("pre").codify( {title:false} );
});


Syntax Highlighting

To allow syntax highlighting to be executed, place the "geshi" directory on your webiste. Then tell the codify plugin, where to find it with the geshi option. See the example bellow.

$(document).ready(function(){
    $("pre").codify({
          geshi:"http://mywebsite.com/geshi/codify.php"
    });
});

Supported languages

  1. 4cs-GADV 4CS
  2. -MOS 6502 (6510) ACME Cross Assembler format
  3. 6502kickass-MOS 6502 (6510) Kick Assembler format
  4. 6502tasm-MOS 6502 (6510) TASM/64TASS 1.46 Assembler format
  5. 68000devpac-Motorola 68000 - HiSoft Devpac ST 2 Assembler format
  6. abap-ABAP
  7. actionscript-ActionScript
  8. actionscript3-ActionScript 3
  9. ada-Ada
  10. algol68-ALGOL 68
  11. apache-Apache configuration
  12. applescript-AppleScript
  13. apt_sources-Apt sources
  14. asm-ASM
  15. asp-ASP
  16. autoconf-Autoconf
  17. autohotkey-Autohotkey
  18. autoit-AutoIt
  19. avisynth-AviSynth
  20. awk-awk
  21. bash-Bash
  22. basic4gl-Basic4GL
  23. bf-Brainfuck
  24. bibtex-BibTeX
  25. blitzbasic-BlitzBasic
  26. bnf-bnf
  27. boo-Boo
  28. c-C
  29. c_loadrunner-C (LoadRunner)
  30. c_mac-C (Mac)
  31. caddcl-CAD DCL
  32. cadlisp-CAD Lisp
  33. cfdg-CFDG
  34. cfm-ColdFusion
  35. chaiscript-ChaiScript
  36. cil-CIL
  37. clojure-Clojure
  38. cmake-CMake
  39. cobol-COBOL
  40. cpp-C++
  41. cpp-qt" class="sublang-  C++ (QT)
  42. csharp-C#
  43. css-CSS
  44. cuesheet-Cuesheet
  45. d-D
  46. dcs-DCS
  47. delphi-Delphi
  48. diff-Diff
  49. div-DIV
  50. dos-DOS
  51. dot-dot
  52. e-E
  53. ecmascript-ECMAScript
  54. eiffel-Eiffel
  55. email-eMail (mbox)
  56. epc-EPC
  57. erlang-Erlang
  58. f1-Formula One
  59. falcon-Falcon
  60. fo-FO (abas-ERP)
  61. fortran-Fortran
  62. freebasic-FreeBasic
  63. fsharp-F#
  64. gambas-GAMBAS
  65. gdb-GDB
  66. genero-genero
  67. genie-Genie
  68. gettext-GNU Gettext
  69. glsl-glSlang
  70. gml-GML
  71. gnuplot-Gnuplot
  72. go-Go
  73. groovy-Groovy
  74. gwbasic-GwBasic
  75. haskell-Haskell
  76. hicest-HicEst
  77. hq9plus-HQ9+
  78. html4strict-HTML
  79. icon-Icon
  80. idl-Uno Idl
  81. ini-INI
  82. inno-Inno
  83. intercal-INTERCAL
  84. io-Io
  85. j-J
  86. java-Java
  87. java5-Java(TM) 2 Platform Standard Edition 5.0
  88. javascript-Javascript
  89. jquery-jQuery
  90. kixtart-KiXtart
  91. klonec-KLone C
  92. klonecpp-KLone C++
  93. latex-LaTeX
  94. lb-Liberty BASIC
  95. lisp-Lisp
  96. locobasic-Locomotive Basic
  97. logtalk-Logtalk
  98. lolcode-LOLcode
  99. lotusformulas-Lotus Notes @Formulas
  100. lotusscript-LotusScript
  101. lscript-LScript
  102. lsl2-LSL2
  103. lua-Lua
  104. m68k-Motorola 68000 Assembler
  105. magiksf-MagikSF
  106. make-GNU make
  107. mapbasic-MapBasic
  108. matlab-Matlab M
  109. mirc-mIRC Scripting
  110. mmix-MMIX
  111. modula2-Modula-2
  112. modula3-Modula-3
  113. mpasm-Microchip Assembler
  114. mxml-MXML
  115. mysql-MySQL
  116. newlisp-newlisp
  117. nsis-NSIS
  118. oberon2-Oberon-2
  119. objc-Objective-C
  120. objeck-Objeck Programming Language
  121. ocaml-OCaml
  122. ocaml-brief" class="sublang-  OCaml (brief)
  123. oobas-OpenOffice.org Basic
  124. oracle11-Oracle 11 SQL
  125. oracle8-Oracle 8 SQL
  126. oxygene-Oxygene (Delphi Prism)
  127. oz-OZ
  128. pascal-Pascal
  129. pcre-PCRE
  130. per-per
  131. perl-Perl
  132. perl6-Perl 6
  133. pf-OpenBSD Packet Filter
  134. php" selected="selected-PHP
  135. php-brief" class="sublang-  PHP (brief)
  136. pic16-PIC16
  137. pike-Pike
  138. pixelbender-Pixel Bender 1.0
  139. plsql-PL/SQL
  140. postgresql-PostgreSQL
  141. povray-POVRAY
  142. powerbuilder-PowerBuilder
  143. powershell-PowerShell
  144. progress-Progress
  145. prolog-Prolog
  146. properties-PROPERTIES
  147. providex-ProvideX
  148. purebasic-PureBasic
  149. python-Python
  150. q-q/kdb+
  151. qbasic-QBasic/QuickBASIC
  152. rails-Rails
  153. rebol-REBOL
  154. reg-Microsoft Registry
  155. robots-robots.txt
  156. rpmspec-RPM Specification File
  157. rsplus-R / S+
  158. ruby-Ruby
  159. sas-SAS
  160. scala-Scala
  161. scheme-Scheme
  162. scilab-SciLab
  163. sdlbasic-sdlBasic
  164. smalltalk-Smalltalk
  165. smarty-Smarty
  166. sql-SQL
  167. systemverilog-SystemVerilog
  168. tcl-TCL
  169. teraterm-Tera Term Macro
  170. text-Text
  171. thinbasic-thinBasic
  172. tsql-T-SQL
  173. typoscript-TypoScript
  174. unicon-Unicon (Unified Extended Dialect of Icon)
  175. vala-Vala
  176. vb-Visual Basic
  177. vbnet-vb.net
  178. verilog-Verilog
  179. vhdl-VHDL
  180. vim-Vim Script
  181. visualfoxpro-Visual Fox Pro
  182. visualprolog-Visual Prolog
  183. whitespace-Whitespace
  184. whois-Whois (RPSL format)
  185. winbatch-Winbatch
  186. xbasic-XBasic
  187. xml-XML
  188. xorg_conf-Xorg configuration
  189. xpp-X++
  190. z80-ZiLOG Z80 Assembler
  191. zxbasic-ZXBasic

License

Codify ver. 2.0
Copyright (c) 2011 Remiya Solutions
Website: http://remiya.com

LICENSE
===========
This script may be used for both free and commercial purposes
only if the following conditions are met:

 1. You are hereby licensed to make as many copies of this
    script as you need in order to distribute your own work
    (including for commercial use). You are specifically
    prohibited from charging, or requesting donations,
    for any such copies without prior written permission.
	
 2. You ARE NOT allowed to distribute for download the script
    via electronic means (internet , e-mail, etc). This means
    that this software is to be available for download from
    the official website (http://remiya.com) ONLY.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Download

I have read and fully understand the license agreement.
 
Ads
  
  Copyright © 2011 Remiya Solutions. All rights reserved