1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/ckeditor/plugins/pbckcode/README.md Thu Dec 15 18:10:20 2016 +0300
1.3 @@ -0,0 +1,174 @@
1.4 +# pbckcode
1.5 +
1.6 +A CKEditor plugin to easily add code into your articles.
1.7 +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.
1.8 +
1.9 +# Demo
1.10 +See it in action ! http://prbaron.github.com/pbckcode/
1.11 +
1.12 +# Installation
1.13 +1. Download the plugin from the Github repository : [https://github.com/prbaron/pbckcode/tags](https://github.com/prbaron/pbckcode/tags)
1.14 +2. Rename it to **pbckcode** (it will be easier to call it into CKEditor)
1.15 +3. Place the folder into the plugins folder of CKEditor ( *{Path to CKEDitor}/plugins/* )
1.16 +4. Open the config.js file and add the following lines :
1.17 +
1.18 +```
1.19 + CKEDITOR.editorConfig = function( config ) {
1.20 + // CKEDITOR TOOLBAR CUSTOMIZATION
1.21 + // I only set the needed buttons, so feel frey to add those you want in the array
1.22 + config.toolbarGroups = [
1.23 + { name: 'pbckcode' } ,
1.24 + // you other buttons here
1.25 + ];
1.26 +
1.27 + // CKEDITOR PLUGINS LOADING
1.28 + config.extraPlugins = 'pbckcode'; // add other plugins here (comma separated)
1.29 +
1.30 + // ADVANCED CONTENT FILTER (ACF)
1.31 + // ACF protects your CKEditor instance of adding unofficial tags
1.32 + // however it strips out the pre tag of pbckcode plugin
1.33 + // add this rule to enable it, useful when you want to re edit a post
1.34 + config.allowedContent= 'pre[*]{*}(*)'; // add other rules here
1.35 +
1.36 +
1.37 + // PBCKCODE CUSTOMIZATION
1.38 + config.pbckcode = {
1.39 + // An optional class to your pre tag.
1.40 + cls : '',
1.41 +
1.42 + // The syntax highlighter you will use in the output view
1.43 + highlighter : 'PRETTIFY',
1.44 +
1.45 + // An array of the available modes for you plugin.
1.46 + // The key corresponds to the string shown in the select tag.
1.47 + // The value correspond to the loaded file for ACE Editor.
1.48 + modes : [ ['HTML', 'html'], ['CSS', 'css'], ['PHP', 'php'], ['JS', 'javascript'] ],
1.49 +
1.50 + // The theme of the ACE Editor of the plugin.
1.51 + theme : 'textmate',
1.52 +
1.53 + // Tab indentation (in spaces)
1.54 + tab_size : '4'
1.55 + };
1.56 + };
1.57 +```
1.58 +And you are good to go! You will have the same configuration than the demo.
1.59 +
1.60 +# Options
1.61 +
1.62 +## highlighter
1.63 +
1.64 +Choose your synta highlighter output. Remove the option if you want to output a basic <pre> tag, otherwise, choose one of them.
1.65 +
1.66 +```
1.67 +'HIGHLIGHT' // http://highlightjs.org/
1.68 +'PRETTIFY' // https://code.google.com/p/google-code-prettify/
1.69 +'PRISM' // http://prismjs.com/
1.70 +'SYNTAX_HIGHLIGHTER' // http://alexgorbatchev.com/SyntaxHighlighter/
1.71 +```
1.72 +
1.73 +## modes
1.74 +```
1.75 +// Available modes
1.76 +['C/C++' , 'c_pp']
1.77 +['C9Search' , 'c9search']
1.78 +['Clojure' , 'clojure']
1.79 +['CoffeeScript' , 'coffee']
1.80 +['ColdFusion' , 'coldfusion']
1.81 +['C#' , 'csharp']
1.82 +['CSS' , 'css']
1.83 +['Diff' , 'diff']
1.84 +['Glsl' , 'glsl']
1.85 +['Go' , 'golang']
1.86 +['Groovy' , 'groovy']
1.87 +['haXe' , 'haxe']
1.88 +['HTML' , 'html']
1.89 +['Jade' , 'jade']
1.90 +['Java' , 'java']
1.91 +['JavaScript' , 'javascript']
1.92 +['JSON' , 'json']
1.93 +['JSP' , 'jsp']
1.94 +['JSX' , 'jsx']
1.95 +['LaTeX' , 'latex']
1.96 +['LESS' , 'less']
1.97 +['Liquid' , 'liquid']
1.98 +['Lua' , 'lua']
1.99 +['LuaPage' , 'luapage']
1.100 +['Markdown' , 'markdown']
1.101 +['OCaml' , 'ocaml']
1.102 +['Perl' , 'perl']
1.103 +['pgSQL' , 'pgsql']
1.104 +['PHP' , 'php']
1.105 +['Powershell' , 'powershel1']
1.106 +['Python' , 'python']
1.107 +['R' , 'ruby']
1.108 +['OpenSCAD' , 'scad']
1.109 +['Scala' , 'scala']
1.110 +['SCSS/Sass' , 'scss']
1.111 +['SH' , 'sh']
1.112 +['SQL' , 'sql']
1.113 +['SVG' , 'svg']
1.114 +['Tcl' , 'tcl']
1.115 +['Text' , 'text']
1.116 +['Textile' , 'textile']
1.117 +['XML' , 'xml']
1.118 +['XQuery' , 'xq']
1.119 +['YAML' , 'yaml']
1.120 +```
1.121 +
1.122 +## theme
1.123 +
1.124 +```
1.125 +// Bright themes
1.126 +'chrome'
1.127 +'clouds'
1.128 +'crimson_editor'
1.129 +'dawn'
1.130 +'dreamweaver'
1.131 +'eclipse'
1.132 +'github'
1.133 +'solarized_light'
1.134 +'textmate' // default theme
1.135 +'tomorrow'
1.136 +'xcode'
1.137 +'kuroir'
1.138 +'katzenmilch'
1.139 +```
1.140 +
1.141 +```
1.142 +// Dark themes
1.143 +'ambiance'
1.144 +'chaos'
1.145 +'clouds_midnight'
1.146 +'cobalt'
1.147 +'idle_fingers'
1.148 +'kr_theme'
1.149 +'merbivore'
1.150 +'merbivore_soft'
1.151 +'mono_industrial'
1.152 +'monokai'
1.153 +'pastel_on_dark'
1.154 +'solarized_dark'
1.155 +'terminal'
1.156 +'tomorrow_night'
1.157 +'tomorrow_night_blue'
1.158 +'tomorrow_night_bright'
1.159 +'tomorrow_night_eighties'
1.160 +'twilight'
1.161 +'vibrant_ink'
1.162 +```
1.163 +
1.164 +# Special Thanks
1.165 +
1.166 + * CKEditor : [http://ckeditor.com/](http://ckeditor.com/)
1.167 + * ACE : [http://ace.ajax.org/](http://ace.ajax.org/)
1.168 + * Lea Verou : [http://prismjs.com/](http://prismjs.com/)
1.169 + * Google : [https://code.google.com/p/google-code-prettify/](https://code.google.com/p/google-code-prettify/)
1.170 + * Ivan Sagalaev : [http://highlightjs.org/](http://highlightjs.org/)
1.171 + * Alex Gorbatchev : [http://alexgorbatchev.com/SyntaxHighlighter/](http://alexgorbatchev.com/SyntaxHighlighter/)
1.172 +
1.173 +# Credits
1.174 +#### Pierre Baron
1.175 +Website : [http://www.pierrebaron.fr](http://www.pierrebaron.fr)
1.176 +Twitter : [@prbaron](https://twitter.com/prbaron)
1.177 +Contact : <prbaron22@gmail.com>