├── .github └── FUNDING.yml ├── Assets ├── css │ ├── prism.css │ └── style.css └── js │ ├── clipboard.min.js │ └── prism.js ├── LICENSE ├── Plugin.php ├── README.md └── _config.yml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | liberapay: kenlog 4 | custom: ['https://paypal.me/kenlog'] 5 | -------------------------------------------------------------------------------- /Assets/css/prism.css: -------------------------------------------------------------------------------- 1 | /* PrismJS 1.20.0 2 | https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+abap+abnf+actionscript+ada+al+antlr4+apacheconf+apl+applescript+aql+arduino+arff+asciidoc+asm6502+aspnet+autohotkey+autoit+bash+basic+batch+bbcode+bison+bnf+brainfuck+brightscript+bro+c+concurnas+csharp+cpp+cil+coffeescript+cmake+clojure+crystal+csp+css-extras+d+dart+dax+diff+django+dns-zone-file+docker+ebnf+eiffel+ejs+elixir+elm+etlua+erb+erlang+excel-formula+fsharp+factor+firestore-security-rules+flow+fortran+ftl+gcode+gdscript+gedcom+gherkin+git+glsl+gml+go+graphql+groovy+haml+handlebars+haskell+haxe+hcl+hlsl+http+hpkp+hsts+ichigojam+icon+iecst+inform7+ini+io+j+java+javadoc+javadoclike+javastacktrace+jolie+jq+jsdoc+js-extras+js-templates+json+jsonp+json5+julia+keyman+kotlin+latex+latte+less+lilypond+liquid+lisp+livescript+llvm+lolcode+lua+makefile+markdown+markup-templating+matlab+mel+mizar+monkey+moonscript+n1ql+n4js+nand2tetris-hdl+nasm+neon+nginx+nim+nix+nsis+objectivec+ocaml+opencl+oz+parigp+parser+pascal+pascaligo+pcaxis+peoplecode+perl+php+phpdoc+php-extras+plsql+powerquery+powershell+processing+prolog+properties+protobuf+pug+puppet+pure+purebasic+python+q+qml+qore+r+racket+jsx+tsx+renpy+reason+regex+rest+rip+roboconf+robotframework+ruby+rust+sas+sass+scss+scala+scheme+shell-session+smalltalk+smarty+solidity+solution-file+soy+sparql+splunk-spl+sqf+sql+stylus+swift+tap+tcl+textile+toml+tt2+turtle+twig+typescript+t4-cs+t4-vb+t4-templating+unrealscript+vala+vbnet+velocity+verilog+vhdl+vim+visual-basic+warpscript+wasm+wiki+xeora+xml-doc+xojo+xquery+yaml+zig&plugins=show-language+toolbar+copy-to-clipboard */ 3 | /** 4 | * okaidia theme for JavaScript, CSS and HTML 5 | * Loosely based on Monokai textmate theme by http://www.monokai.nl/ 6 | * @author ocodia 7 | */ 8 | 9 | code[class*="language-"], 10 | pre[class*="language-"] { 11 | color: #f8f8f2; 12 | background: none; 13 | text-shadow: 0 1px rgba(0, 0, 0, 0.3); 14 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 15 | font-size: 1em; 16 | text-align: left; 17 | white-space: pre; 18 | word-spacing: normal; 19 | word-break: normal; 20 | word-wrap: normal; 21 | line-height: 1.5; 22 | 23 | -moz-tab-size: 4; 24 | -o-tab-size: 4; 25 | tab-size: 4; 26 | 27 | -webkit-hyphens: none; 28 | -moz-hyphens: none; 29 | -ms-hyphens: none; 30 | hyphens: none; 31 | } 32 | 33 | /* Code blocks */ 34 | pre[class*="language-"] { 35 | padding: 1em; 36 | margin: .5em 0; 37 | overflow: auto; 38 | border-radius: 0.3em; 39 | } 40 | 41 | :not(pre) > code[class*="language-"], 42 | pre[class*="language-"] { 43 | background: #272822; 44 | } 45 | 46 | /* Inline code */ 47 | :not(pre) > code[class*="language-"] { 48 | padding: .1em; 49 | border-radius: .3em; 50 | white-space: normal; 51 | } 52 | 53 | .token.comment, 54 | .token.prolog, 55 | .token.doctype, 56 | .token.cdata { 57 | color: slategray; 58 | } 59 | 60 | .token.punctuation { 61 | color: #f8f8f2; 62 | } 63 | 64 | .token.namespace { 65 | opacity: .7; 66 | } 67 | 68 | .token.property, 69 | .token.tag, 70 | .token.constant, 71 | .token.symbol, 72 | .token.deleted { 73 | color: #f92672; 74 | } 75 | 76 | .token.boolean, 77 | .token.number { 78 | color: #ae81ff; 79 | } 80 | 81 | .token.selector, 82 | .token.attr-name, 83 | .token.string, 84 | .token.char, 85 | .token.builtin, 86 | .token.inserted { 87 | color: #a6e22e; 88 | } 89 | 90 | .token.operator, 91 | .token.entity, 92 | .token.url, 93 | .language-css .token.string, 94 | .style .token.string, 95 | .token.variable { 96 | color: #f8f8f2; 97 | } 98 | 99 | .token.atrule, 100 | .token.attr-value, 101 | .token.function, 102 | .token.class-name { 103 | color: #e6db74; 104 | } 105 | 106 | .token.keyword { 107 | color: #66d9ef; 108 | } 109 | 110 | .token.regex, 111 | .token.important { 112 | color: #fd971f; 113 | } 114 | 115 | .token.important, 116 | .token.bold { 117 | font-weight: bold; 118 | } 119 | .token.italic { 120 | font-style: italic; 121 | } 122 | 123 | .token.entity { 124 | cursor: help; 125 | } 126 | 127 | div.code-toolbar { 128 | position: relative; 129 | } 130 | 131 | div.code-toolbar > .toolbar { 132 | position: absolute; 133 | top: .3em; 134 | right: .2em; 135 | transition: opacity 0.3s ease-in-out; 136 | opacity: 0; 137 | } 138 | 139 | div.code-toolbar:hover > .toolbar { 140 | opacity: 1; 141 | } 142 | 143 | /* Separate line b/c rules are thrown out if selector is invalid. 144 | IE11 and old Edge versions don't support :focus-within. */ 145 | div.code-toolbar:focus-within > .toolbar { 146 | opacity: 1; 147 | } 148 | 149 | div.code-toolbar > .toolbar .toolbar-item { 150 | display: inline-block; 151 | } 152 | 153 | div.code-toolbar > .toolbar a { 154 | cursor: pointer; 155 | } 156 | 157 | div.code-toolbar > .toolbar button { 158 | background: none; 159 | border: 0; 160 | color: inherit; 161 | font: inherit; 162 | line-height: normal; 163 | overflow: visible; 164 | padding: 0; 165 | -webkit-user-select: none; /* for button */ 166 | -moz-user-select: none; 167 | -ms-user-select: none; 168 | } 169 | 170 | div.code-toolbar > .toolbar a, 171 | div.code-toolbar > .toolbar button, 172 | div.code-toolbar > .toolbar span { 173 | color: #bbb; 174 | font-size: .8em; 175 | padding: 0 .5em; 176 | background: #f5f2f0; 177 | background: rgba(224, 224, 224, 0.2); 178 | box-shadow: 0 2px 0 0 rgba(0,0,0,0.2); 179 | border-radius: .5em; 180 | } 181 | 182 | div.code-toolbar > .toolbar a:hover, 183 | div.code-toolbar > .toolbar a:focus, 184 | div.code-toolbar > .toolbar button:hover, 185 | div.code-toolbar > .toolbar button:focus, 186 | div.code-toolbar > .toolbar span:hover, 187 | div.code-toolbar > .toolbar span:focus { 188 | color: inherit; 189 | text-decoration: none; 190 | } 191 | 192 | -------------------------------------------------------------------------------- /Assets/css/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | * HighlightCodeSyntax - Plugin for Kanboard 3 | * Licensed under the MIT LICENSE 4 | * https://github.com/kenlog/HighlightCodeSyntax 5 | * Copyright (c) 2018 Valentino Pesce - https://iltuobrand.it 6 | */ 7 | 8 | .markdown pre { 9 | background: #242729!important; 10 | padding: 10px!important; 11 | border-radius: 5px!important; 12 | border: 1px solid #ddd!important; 13 | overflow: auto!important; 14 | overflow-wrap: initial!important; 15 | color: #fff!important; 16 | } 17 | 18 | .markdown blockquote { 19 | font-style: italic!important; 20 | border-left: 3px solid #ddd!important; 21 | padding-left: 10px!important; 22 | margin-bottom: 10px!important; 23 | margin-left: 20px!important; 24 | } 25 | 26 | .markdown img { 27 | display: block!important; 28 | max-width: 80%!important; 29 | margin-top: 10px!important; 30 | } 31 | 32 | ::selection{background:rgba(113,113,113,0.5);color:#ffffff}::-moz-selection{background:rgba(113,113,113,0.5);color:#ffffff} 33 | -------------------------------------------------------------------------------- /Assets/js/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.6 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return o={},r.m=n=[function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;ohook->on("template:layout:css", array("template" => "plugins/HighlightCodeSyntax/Assets/css/style.css")); 13 | 14 | $this->hook->on("template:layout:css", array("template" => "plugins/HighlightCodeSyntax/Assets/css/prism.css")); 15 | 16 | $this->hook->on('template:layout:js', array('template' => 'plugins/HighlightCodeSyntax/Assets/js/clipboard.min.js')); 17 | 18 | $this->hook->on('template:layout:js', array('template' => 'plugins/HighlightCodeSyntax/Assets/js/prism.js')); 19 | } 20 | 21 | public function getPluginName() 22 | { 23 | return 'HighlightCodeSyntax'; 24 | } 25 | 26 | public function getPluginDescription() 27 | { 28 | return t('For code snippets the plugin is able to highlight code syntax in more than 151 languages, including PHP, Javascript, Python, HTML and CSS.'); 29 | } 30 | 31 | public function getPluginAuthor() 32 | { 33 | return 'Valentino Pesce'; 34 | } 35 | 36 | public function getPluginVersion() 37 | { 38 | return '1.0.3'; 39 | } 40 | 41 | public function getCompatibleVersion() 42 | { 43 | return '>=1.0.48'; 44 | } 45 | 46 | public function getPluginHomepage() 47 | { 48 | return 'https://github.com/kenlog/HighlightCodeSyntax'; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Checkout our latest project 2 | 3 | - [Global Search Plugin for Kanboard](https://github.com/kenlog/global-search-kanboard.git) 4 | ----------- 5 | 6 | [![Latest release](https://img.shields.io/github/release/kenlog/HighlightCodeSyntax.svg)](https://github.com/kenlog/HighlightCodeSyntax/releases) 7 | [![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/kenlog/HighlightCodeSyntax/blob/master/LICENSE) 8 | [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/kenlog/HighlightCodeSyntax/graphs/contributors) 9 | [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)]() 10 | [![Downloads](https://img.shields.io/github/downloads/kenlog/HighlightCodeSyntax/total.svg)](https://github.com/kenlog/HighlightCodeSyntax/releases) 11 | 12 | # Highlight Code Syntax for kanboard 13 | 14 | Donate with PayPal button 15 | 16 | - For code snippets the plugin is able to highlight code syntax in more than 151 languages, including PHP, Javascript, Python, Ruby, JSON, HTML and CSS... 17 | 18 | ![highlightcodesyntax](https://user-images.githubusercontent.com/11728231/50385386-2cbe9900-06d5-11e9-9a95-0988d795becc.jpg) 19 | 20 | Author 21 | ------------ 22 | - Valentino Pesce 23 | - License MIT 24 | 25 | Requirements 26 | ------------ 27 | Kanboard >= v1.0.48 28 | Kanboard installed at a web server. 29 | You can find the download at [kanboard.org](https://kanboard.org/) 30 | 31 | Installation 32 | ------------ 33 | You have the choice between 3 methods: 34 | 35 | 1. Install the plugin from the Kanboard plugin manager in one click 36 | 2. Download the zip file and decompress everything under the directory `plugins/HighlightCodeSyntax` 37 | 3. Clone this repository into the folder `plugins/HighlightCodeSyntax` 38 | 39 | Note: Plugin folder is case-sensitive. 40 | 41 | Syntax highlighting for Markdown code 42 | ------------ 43 | 151 languages currently supported by Prism, with their corresponding alias, to use in place of php 44 | 45 | ```diff 46 | ```php 47 | class SimpleClass 48 | { 49 | // property declaration 50 | public $var = 'a default value'; 51 | 52 | // method declaration 53 | public function displayVar() { 54 | echo $this->var; 55 | } 56 | } 57 | ``` 58 | 59 | ### :star: If you like it, do not forget to give a star on GitHub! 60 | 61 | :construction_worker: Any contribution will be highly appreciated 62 | ------------ 63 | Clone the repository: 64 | ```console 65 | git clone https://github.com/kenlog/HighlightCodeSyntax.git 66 | ``` 67 | :bug: Reporting Issues 68 | ------------ 69 | Please [create an issue](https://github.com/kenlog/HighlightCodeSyntax/issues) for any bugs you've found. 70 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman 2 | plugins: 3 | - jemoji 4 | --------------------------------------------------------------------------------