Code Coloration is a client-side code syntax highlighter plugin for Shaarli.
It uses PrismJS library.
- PHP 5.3
- Shaarli >= v0.6.3 (check the release matching your version)
- Shaarli's Markdown plugin enabled
Download the latest release, and put the subfolder code_coloration under your plugins/ directory.
Then you can enable the plugin in the plugin administration page http://shaarli.tld/?do=pluginadmin.
Note: the folder name must be
code_colorationfor the plugin to appear.
Example in command lines:
cd /tmp
wget https://github.com/ArthurHoaro/code-coloration/archive/v1.1.0.tar.gz
tar xfz code-coloration-v1.0.0.tar.gz
mv code-coloration-v1.0.0/code_coloration /path/to/shaarli/pluginsThe language have to be specified. Example for javascript:
```javascript
/**
* Change the position counter of a row.
*
* @param elem Element Node to change.
* @param toPos int New position.
*/
function changePos(elem, toPos)
{
var elemName = elem.getAttribute('data-line')
elem.setAttribute('data-order', toPos);
var hiddenInput = document.querySelector('[name="order_'+ elemName +'"]');
hiddenInput.setAttribute('value', toPos);
}
```markupcssclikejavascriptapacheconfaspnetbashbatchccsharpcppcoffeescriptrubydiffdockergitgohttpinijavajsonlatexluamakefilemarkdownobjectivecocamlperlphpphp-extraspythonrrustsqltwigvimyaml
- Build your own PrismJS file here.
- Put it in
code_colorationfolder with any filename. - Set your filename in the plugins administration page under
CUSTOM_PRISM_JS_FILENAME.
