indvd00m@0: # pbckcode indvd00m@0: indvd00m@0: A CKEditor plugin to easily add code into your articles. indvd00m@0: The plugin will create a dialog where you will be able to format your code as your will. When you press the **OK** button, the plugin will create a *pre* tag with your code inside. indvd00m@0: indvd00m@0: # Demo indvd00m@0: See it in action ! http://prbaron.github.com/pbckcode/ indvd00m@0: indvd00m@0: # Installation indvd00m@0: 1. Download the plugin from the Github repository : [https://github.com/prbaron/pbckcode/tags](https://github.com/prbaron/pbckcode/tags) indvd00m@0: 2. Rename it to **pbckcode** (it will be easier to call it into CKEditor) indvd00m@0: 3. Place the folder into the plugins folder of CKEditor ( *{Path to CKEDitor}/plugins/* ) indvd00m@0: 4. Open the config.js file and add the following lines : indvd00m@0: indvd00m@0: ``` indvd00m@0: CKEDITOR.editorConfig = function( config ) { indvd00m@0: // CKEDITOR TOOLBAR CUSTOMIZATION indvd00m@0: // I only set the needed buttons, so feel frey to add those you want in the array indvd00m@0: config.toolbarGroups = [ indvd00m@0: { name: 'pbckcode' } , indvd00m@0: // you other buttons here indvd00m@0: ]; indvd00m@0: indvd00m@0: // CKEDITOR PLUGINS LOADING indvd00m@0: config.extraPlugins = 'pbckcode'; // add other plugins here (comma separated) indvd00m@0: indvd00m@0: // ADVANCED CONTENT FILTER (ACF) indvd00m@0: // ACF protects your CKEditor instance of adding unofficial tags indvd00m@0: // however it strips out the pre tag of pbckcode plugin indvd00m@0: // add this rule to enable it, useful when you want to re edit a post indvd00m@0: config.allowedContent= 'pre[*]{*}(*)'; // add other rules here indvd00m@0: indvd00m@0: indvd00m@0: // PBCKCODE CUSTOMIZATION indvd00m@0: config.pbckcode = { indvd00m@0: // An optional class to your pre tag. indvd00m@0: cls : '', indvd00m@0: indvd00m@0: // The syntax highlighter you will use in the output view indvd00m@0: highlighter : 'PRETTIFY', indvd00m@0: indvd00m@0: // An array of the available modes for you plugin. indvd00m@0: // The key corresponds to the string shown in the select tag. indvd00m@0: // The value correspond to the loaded file for ACE Editor. indvd00m@0: modes : [ ['HTML', 'html'], ['CSS', 'css'], ['PHP', 'php'], ['JS', 'javascript'] ], indvd00m@0: indvd00m@0: // The theme of the ACE Editor of the plugin. indvd00m@0: theme : 'textmate', indvd00m@0: indvd00m@0: // Tab indentation (in spaces) indvd00m@0: tab_size : '4' indvd00m@0: }; indvd00m@0: }; indvd00m@0: ``` indvd00m@0: And you are good to go! You will have the same configuration than the demo. indvd00m@0: indvd00m@0: # Options indvd00m@0: indvd00m@0: ## highlighter indvd00m@0: indvd00m@0: Choose your synta highlighter output. Remove the option if you want to output a basic <pre> tag, otherwise, choose one of them. indvd00m@0: indvd00m@0: ``` indvd00m@0: 'HIGHLIGHT' // http://highlightjs.org/ indvd00m@0: 'PRETTIFY' // https://code.google.com/p/google-code-prettify/ indvd00m@0: 'PRISM' // http://prismjs.com/ indvd00m@0: 'SYNTAX_HIGHLIGHTER' // http://alexgorbatchev.com/SyntaxHighlighter/ indvd00m@0: ``` indvd00m@0: indvd00m@0: ## modes indvd00m@0: ``` indvd00m@0: // Available modes indvd00m@0: ['C/C++' , 'c_pp'] indvd00m@0: ['C9Search' , 'c9search'] indvd00m@0: ['Clojure' , 'clojure'] indvd00m@0: ['CoffeeScript' , 'coffee'] indvd00m@0: ['ColdFusion' , 'coldfusion'] indvd00m@0: ['C#' , 'csharp'] indvd00m@0: ['CSS' , 'css'] indvd00m@0: ['Diff' , 'diff'] indvd00m@0: ['Glsl' , 'glsl'] indvd00m@0: ['Go' , 'golang'] indvd00m@0: ['Groovy' , 'groovy'] indvd00m@0: ['haXe' , 'haxe'] indvd00m@0: ['HTML' , 'html'] indvd00m@0: ['Jade' , 'jade'] indvd00m@0: ['Java' , 'java'] indvd00m@0: ['JavaScript' , 'javascript'] indvd00m@0: ['JSON' , 'json'] indvd00m@0: ['JSP' , 'jsp'] indvd00m@0: ['JSX' , 'jsx'] indvd00m@0: ['LaTeX' , 'latex'] indvd00m@0: ['LESS' , 'less'] indvd00m@0: ['Liquid' , 'liquid'] indvd00m@0: ['Lua' , 'lua'] indvd00m@0: ['LuaPage' , 'luapage'] indvd00m@0: ['Markdown' , 'markdown'] indvd00m@0: ['OCaml' , 'ocaml'] indvd00m@0: ['Perl' , 'perl'] indvd00m@0: ['pgSQL' , 'pgsql'] indvd00m@0: ['PHP' , 'php'] indvd00m@0: ['Powershell' , 'powershel1'] indvd00m@0: ['Python' , 'python'] indvd00m@0: ['R' , 'ruby'] indvd00m@0: ['OpenSCAD' , 'scad'] indvd00m@0: ['Scala' , 'scala'] indvd00m@0: ['SCSS/Sass' , 'scss'] indvd00m@0: ['SH' , 'sh'] indvd00m@0: ['SQL' , 'sql'] indvd00m@0: ['SVG' , 'svg'] indvd00m@0: ['Tcl' , 'tcl'] indvd00m@0: ['Text' , 'text'] indvd00m@0: ['Textile' , 'textile'] indvd00m@0: ['XML' , 'xml'] indvd00m@0: ['XQuery' , 'xq'] indvd00m@0: ['YAML' , 'yaml'] indvd00m@0: ``` indvd00m@0: indvd00m@0: ## theme indvd00m@0: indvd00m@0: ``` indvd00m@0: // Bright themes indvd00m@0: 'chrome' indvd00m@0: 'clouds' indvd00m@0: 'crimson_editor' indvd00m@0: 'dawn' indvd00m@0: 'dreamweaver' indvd00m@0: 'eclipse' indvd00m@0: 'github' indvd00m@0: 'solarized_light' indvd00m@0: 'textmate' // default theme indvd00m@0: 'tomorrow' indvd00m@0: 'xcode' indvd00m@0: 'kuroir' indvd00m@0: 'katzenmilch' indvd00m@0: ``` indvd00m@0: indvd00m@0: ``` indvd00m@0: // Dark themes indvd00m@0: 'ambiance' indvd00m@0: 'chaos' indvd00m@0: 'clouds_midnight' indvd00m@0: 'cobalt' indvd00m@0: 'idle_fingers' indvd00m@0: 'kr_theme' indvd00m@0: 'merbivore' indvd00m@0: 'merbivore_soft' indvd00m@0: 'mono_industrial' indvd00m@0: 'monokai' indvd00m@0: 'pastel_on_dark' indvd00m@0: 'solarized_dark' indvd00m@0: 'terminal' indvd00m@0: 'tomorrow_night' indvd00m@0: 'tomorrow_night_blue' indvd00m@0: 'tomorrow_night_bright' indvd00m@0: 'tomorrow_night_eighties' indvd00m@0: 'twilight' indvd00m@0: 'vibrant_ink' indvd00m@0: ``` indvd00m@0: indvd00m@0: # Special Thanks indvd00m@0: indvd00m@0: * CKEditor : [http://ckeditor.com/](http://ckeditor.com/) indvd00m@0: * ACE : [http://ace.ajax.org/](http://ace.ajax.org/) indvd00m@0: * Lea Verou : [http://prismjs.com/](http://prismjs.com/) indvd00m@0: * Google : [https://code.google.com/p/google-code-prettify/](https://code.google.com/p/google-code-prettify/) indvd00m@0: * Ivan Sagalaev : [http://highlightjs.org/](http://highlightjs.org/) indvd00m@0: * Alex Gorbatchev : [http://alexgorbatchev.com/SyntaxHighlighter/](http://alexgorbatchev.com/SyntaxHighlighter/) indvd00m@0: indvd00m@0: # Credits indvd00m@0: #### Pierre Baron indvd00m@0: Website : [http://www.pierrebaron.fr](http://www.pierrebaron.fr) indvd00m@0: Twitter : [@prbaron](https://twitter.com/prbaron) indvd00m@0: Contact :