All Projects → nezhelskoy → yii2-highlight

nezhelskoy / yii2-highlight

Licence: BSD-3-Clause license
Yii2 Highlight.js extension

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-highlight

spreadsheet
Yii2 extension for export to Excel
Stars: ✭ 79 (+464.29%)
Mutual labels:  extension, yii2
sc-translator-crx
Focus on providing a great inline web translation experience. A translate extension for chrome.
Stars: ✭ 79 (+464.29%)
Mutual labels:  extension
github-toc
📖 Browser extension that adds a table of contents to GitHub repos, wikis and gists.
Stars: ✭ 71 (+407.14%)
Mutual labels:  extension
sanic-plugin-toolkit
Easily create Plugins for Sanic!
Stars: ✭ 49 (+250%)
Mutual labels:  extension
Funky
Funky is a functional utility library written in Objective-C.
Stars: ✭ 41 (+192.86%)
Mutual labels:  extension
google-translate-anki
No description or website provided.
Stars: ✭ 28 (+100%)
Mutual labels:  extension
save-text-to-file-firefox
Firefox addon that saves highlighted text to a file.
Stars: ✭ 87 (+521.43%)
Mutual labels:  extension
qzone helper
QQ空间助手,批量删除,导出说说/留言/日志/相册 浏览器插件和脚本
Stars: ✭ 36 (+157.14%)
Mutual labels:  extension
trakttvstats
A chrome extension adding various improvements to trakt.tv
Stars: ✭ 23 (+64.29%)
Mutual labels:  extension
LazyWaimai-Api
基于Yii2框架的LazyWaimai Api端,REST API架构风格的,使用Oauth2进行身份认证
Stars: ✭ 42 (+200%)
Mutual labels:  yii2
browser-extension
Official LISTEN.moe browser extension
Stars: ✭ 23 (+64.29%)
Mutual labels:  extension
nautilus-pdf-tools
Tools to work with PDF files from Nautilus
Stars: ✭ 16 (+14.29%)
Mutual labels:  extension
yii2-js-urlmanager
That extension provide a way to create urls from your frontend part.
Stars: ✭ 53 (+278.57%)
Mutual labels:  yii2
new-word-tab
A browser extension to learn a new word per new tab
Stars: ✭ 30 (+114.29%)
Mutual labels:  extension
azure-boards-decompose
Azure Boards extension to quickly decompose work items into a valid hierarchy
Stars: ✭ 35 (+150%)
Mutual labels:  extension
PDL
php dynamic library (PDL)
Stars: ✭ 13 (-7.14%)
Mutual labels:  extension
yii2-fileapi-widget
Yii2 FileAPI widget.
Stars: ✭ 51 (+264.29%)
Mutual labels:  yii2
DarkCloud
SoundCloud Dark Theme
Stars: ✭ 52 (+271.43%)
Mutual labels:  extension
webplayer-hotkeys
A Chrome extension that assigns hotkeys to play/pause, and switch musics (next and previous). Works with Spotify, Deezer, SoundCloud and Youtube
Stars: ✭ 16 (+14.29%)
Mutual labels:  extension
spring-cloud-stream-outbox-extension
Spring Cloud Stream Transactional Messaging Extension
Stars: ✭ 18 (+28.57%)
Mutual labels:  extension

Yii2 highlight.js extension

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist nezhelskoy/yii2-highlight "*"

Or add

"nezhelskoy/yii2-highlight": "*"

to the require section of your composer.json file.

Usage

In your view script register asset:

nezhelskoy\highlight\HighlightAsset::register($this);

And manage content, as described in original highlight.js documentation:

<pre><code class="html">...</code></pre>

You can override style in your config file, e.g. config/web.php:

    'components' => [
        ...
        'assetManager' => [
            'bundles' => [
                'nezhelskoy\highlight\HighlightAsset' => [
                    'css' => ['dist/styles/zenburn.css'],
                ],
            ]
        ],
        ...
    ],

Example of custom cofiguraton of selector or options properties

    'components' => [
        ...
        'assetManager' => [
            'bundles' => [
                'nezhelskoy\highlight\HighlightAsset' => [
                    'selector' => '.is-highlighted',
                    'options' => [
                        'classPrefix' => 'custom-',
                        'useBR' => true,
                    ],
                    'css' => ['dist/styles/zenburn.css'],
                ],
            ]
        ],
        ...
    ],

Using of custom build, located in /js/highlight, for example

    'components' => [
        ...
        'assetManager' => [
            'bundles' => [
                'nezhelskoy\highlight\HighlightAsset' => [
                    'sourcePath' => null,
                    'css' => ['/js/highlight/styles/zenburn.css'],
                    'js' => ['/js/highlight/highlight.pack.js'],
                ],
            ]
        ],
        ...
    ],

License

yii2-highlight is released under the BSD License. See LICENSE.md file for details.

Links

The official site for the Highlight.js library is at https://highlightjs.org/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].