Užitečné pluginy, návody a šablony pro WordPress CMS

Zvýraznění ukázky kódu v příspěvku

CodeHighlighter
http://wordpress.org/…highlighter/
http://ideathinking.com/…ghterPlugin/

This plugin is a syntax highlighter for source code. It uses GeSHi as fontifier engine.
Put the code snippet to pre tag.
Add the lang attribute to the pre tag like the following. < pre lang="php" >
Add the lineno attribute to the pre tag after the lang tag like the following if you want to display line numbers. The number in the lineno tag becomes a start line number. There is no default value for the start line number. So you must supply the value to the lineno tag. < pre lang="php" lineno="1" >

If you want to have border, add the style like the following to your .css file: pre { border: 1px dotted #ccc; padding: 0.2em 0.5em; }

You can use many languages in lang. For example: css, html4strict, javascript, mysql, php, python, text,xml and much more.

Pozor, nefunguje s Texy, tam je zapotřebí použít speciální syntaxi (značky /---code):

<?php
echo "ahoj";
?>

Alternativy

SyntaxHighlighter Evolved
http://wordpress.org/…highlighter/

SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without losing it's formatting or making any manual changes. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev.

Crayon Syntax Highlighter
https://wordpress.org/…highlighter/

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, or post text.

Code-prettify
https://github.com/…ode-prettify

WordPress plugin for automatic code highlighting using the Prettify library. No shortcodes, no bullshit.

Enlighter - Customizable Syntax Highlighter
https://cs.wordpress.org/…s/enlighter/

Easy-to-use, syntax highlighting tool for WordPress. It's build in PHP and uses the MooTools(Javas­cript) based EnlighterJS to provide a beautiful code-appearance. Using it can be as simple as selecting an editor style or adding shortcode around your scripts which you want to highlight and Enlighter takes care of the rest.

OVX.cz 2003 | Přihlásit se
Bez cookies už dnes těžko provozovat plnohodnotný web. Setrváním zde tudíž vyjadřujete souhlas s jejich používáním. Více informací. | Zavřít.