Syntax highlight plugin for Joomla
How to highlight examples the source code or syntax in Joomla? There are many extensions on the official website, but for some reason they are not satisfied. This is a new plugin for source code, syntax highlight in Joomla - Prism.
The plugin uses the javascript-library Prism for highlight. All you need is just install the plugin, activate, select a theme. Done!
Further in the text of the material, you can use the code:
<pre class="line-numbers" data-start="1"><code language="language-xxx">p { color: red; }</code></pre>
where:
line-numbers – line numbering will be use;
data-start – start value for counter(can be negative);
language-css – language code. Language codes.
Do not use a <pre> tag if do not want block highlight.
MD5: a425cd42c8a1de49c9c967cd369d19ad
SHA-1: d5b2190c51c7e4d699587ec7c5eb1a2978f6840b
Distributed under GNU GPLv2
CSS
pre.line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre.line-numbers > code {
position: relative;
}
Plugin archive include all themes and JS for all languages and plugins by default.
pre.line-numbers { position: relative; padding-left: 3.8em; counter-reset: linenumber; }
SQL
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`counters` /*!40100 DEFAULT CHARACTER SET utf8 */;
/*Table structure for table `piwik_counter_sites` */
DROP TABLE IF EXISTS `piwik_counter_sites`;
CREATE TABLE `piwik_counter_sites` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idsite` int(11) NOT NULL,
`title` varchar(64) NOT NULL DEFAULT '',
`params` text NOT NULL,
`visits` int(11) NOT NULL DEFAULT '0',
`views` int(11) NOT NULL DEFAULT '0',
`published` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_idsite` (`idsite`),
KEY `idx_state` (`published`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SELECT * FROM -- here is comment
WHERE 1 =1 -- and here
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Changelog
0.0.4
- Update Prism library
0.0.3
- Update Prism library
- Fixed wrong installation path for languages in installer
0.0.2
- Bugfixes
0.0.1
- Initial release