{"id":21625435,"url":"https://github.com/coderius/yii2-highlight-js","last_synced_at":"2026-04-28T12:34:41.621Z","repository":{"id":56955635,"uuid":"128634730","full_name":"coderius/yii2-highlight-js","owner":"coderius","description":null,"archived":false,"fork":false,"pushed_at":"2018-04-17T15:16:30.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-20T04:10:04.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-08T11:37:55.000Z","updated_at":"2018-04-17T15:14:48.000Z","dependencies_parsed_at":"2022-08-21T04:40:30.425Z","dependency_job_id":null,"html_url":"https://github.com/coderius/yii2-highlight-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/coderius/yii2-highlight-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-highlight-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-highlight-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-highlight-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-highlight-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderius","download_url":"https://codeload.github.com/coderius/yii2-highlight-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-highlight-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32381686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T01:09:16.697Z","updated_at":"2026-04-28T12:34:41.592Z","avatar_url":"https://github.com/coderius.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Syntax highlighter widget for Yii2\n==================================\n\n[![Latest Stable Version](https://poser.pugx.org/coderius/yii2-highlight-js/v/stable)](https://packagist.org/packages/coderius/yii2-highlight-js)\n[![Total Downloads](https://poser.pugx.org/coderius/yii2-highlight-js/downloads)](https://packagist.org/packages/coderius/yii2-highlight-js)\n[![Latest Unstable Version](https://poser.pugx.org/coderius/yii2-highlight-js/v/unstable)](https://packagist.org/packages/coderius/yii2-highlight-js)\n[![License](https://poser.pugx.org/coderius/yii2-highlight-js/license)](https://packagist.org/packages/coderius/yii2-highlight-js)\n[![Monthly Downloads](https://poser.pugx.org/coderius/yii2-highlight-js/d/monthly)](https://packagist.org/packages/coderius/yii2-highlight-js)\n\n\nThis widget is for the yii2 framework. This is a wrapper for the javascript plugin Highlight.js.\n\nIf you post the code as part of the content on the website, then with this widget your code will look stylish.\n\nIn the pictures below you can see examples of how the code will look on the website pages.\n\n\n\u003cimg align=\"left\" src=\"Screenshot.png\"\u003e\n\n'Xcode' theme.\n\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist coderius/yii2-highlight-js \"*\"\n```\n\nor add\n\n```\n\"coderius/yii2-highlight-js\": \"*\"\n```\n\nto the require section of your `composer.json` file.\n\n\nUsage\n-----\n\nOnce the extension is installed, simply use it in your code by  :\n\n```php\n\u003c?php coderius\\yii2_highlight_js\\HighlightWidget::begin();?\u003e\n\n\u003c?= $content ?\u003e\n\n\u003c?php coderius\\yii2_highlight_js\\HighlightWidget::end(); ?\u003e\n```\n\n\nSome code that needs to be formalized with the plugin must be framed in the block :\n\n```html\n\u003cpre\u003e\n...some code\n\u003c/pre\u003e\n```\n\n\nIf You need to change the styles of the code block, you can attach your styles in this way.\n\n```php\n\u003c?php coderius\\yii2_highlight_js\\HighlightWidget::begin(\n            [\n                'customAsset' =\u003e \\coderius\\yii2_highlight_js\\CustomExampleAsset::register($this),\n\n            ]\n        ); \n?\u003e\n\n\u003c?= $content ?\u003e\n\n\u003c?php coderius\\yii2_highlight_js\\HighlightWidget::end(); ?\u003e\n```\n\nIn this example I did my custom asset (as example codev\\yii2_highlight_js\\NumLineAsset::className())\nIt contains paths to styles and scripts to change the style HighlightWidget.\n\n\nAdvensed example:\n\n```php\n\n\u003c?php HighlightWidget::begin([\n    'theme' =\u003e 'Xcode',\n    'customAsset' =\u003e \\coderius\\yii2_highlight_js\\CustomExampleAsset::register($this),\n    'css' =\u003e \"pre{font-style: italic;}\"//any string style css \n    'js' =\u003e \"alert('ok');\",\n    'positionJs' =\u003e yii\\web\\View::POS_END,//default value is yii\\web\\View::POS_READY\n]); ?\u003e\n\n\n    \u003c?= $article-\u003etext; ?\u003e\n\n\n           \n\u003c?php HighlightWidget::end(); ?\u003e\n\n```\nIn this example I set theme name as \"Xcode\". But default theme is \"Default\"\n\n\nThemes list:\n------------\n* Default\n* Agate\n* Androidstudio\n* Arduino Light\n* Arta\n* Ascetic\n* Atelier Cave Dark\n* Atelier Cave Light\n* Atelier Dune Dark\n* Atelier Dune Light\n* Atelier Estuary Dark\n* Atelier Estuary Light\n* Atelier Forest Dark\n* Atelier Forest Light\n* Atelier Heath Dark\n* Atelier Heath Light\n* Atelier Lakeside Dark\n* Atelier Lakeside Light\n* Atelier Plateau Dark\n* Atelier Plateau Light\n* Atelier Savanna Dark\n* Atelier Savanna Light\n* Atelier Seaside Dark\n* Atelier Seaside Light\n* Atelier Sulphurpool Dark\n* Atelier Sulphurpool Light\n* Atom One Dark\n* Atom One Light\n* Brown Paper\n* Codepen Embed\n* Color Brewer\n* Darcula\n* Dark\n* Darkula\n* Docco\n* Dracula\n* Far\n* Foundation\n* Github Gist\n* Github\n* Googlecode\n* Grayscale\n* Gruvbox Dark\n* Gruvbox Light\n* Hopscotch\n* Hybrid\n* Idea\n* Ir Black\n* Kimbie Dark\n* Kimbie Light\n* Magula\n* Mono Blue\n* Monokai Sublime\n* Monokai\n* Obsidian\n* Ocean\n* Paraiso Dark\n* Paraiso Light\n* Pojoaque\n* Purebasic\n* Qtcreator Dark\n* Qtcreator Light\n* Railscasts\n* Rainbow\n* Routeros\n* School Book\n* Solarized Dark\n* Solarized Light\n* Sunburst\n* Tomorrow Night Blue\n* Tomorrow Night Bright\n* Tomorrow Night Eighties\n* Tomorrow Night\n* Tomorrow\n* Vs\n* Vs 2015\n* Xcode\n* Xt 256\n* Zenburn\n\n\n\nLicense\n-------\nyii2_highlight_js is released under the BSD License. See LICENSE.md file for details.\n\nThis yii2 extantion widget is a wrapper over a plugin highlight_js https://github.com/isagalaev/highlight.js","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderius%2Fyii2-highlight-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderius%2Fyii2-highlight-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderius%2Fyii2-highlight-js/lists"}