{"id":15645909,"url":"https://github.com/crazy-max/dokuwiki-plugin-syntaxhighlighter4","last_synced_at":"2025-08-22T18:31:53.461Z","repository":{"id":9149426,"uuid":"61027126","full_name":"crazy-max/dokuwiki-plugin-syntaxhighlighter4","owner":"crazy-max","description":"SyntaxHighlighter4 plugin for DokuWiki","archived":true,"fork":false,"pushed_at":"2025-04-13T08:43:15.000Z","size":1052,"stargazers_count":54,"open_issues_count":3,"forks_count":5,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-30T11:15:21.095Z","etag":null,"topics":["brushes","clipboard","dokuwiki","syntaxhighlighter"],"latest_commit_sha":null,"homepage":"http://bit.ly/2vfZ9jG","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/crazy-max.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"crazy-max","custom":"https://www.paypal.me/crazyws"}},"created_at":"2016-06-13T10:24:06.000Z","updated_at":"2025-04-13T08:46:54.000Z","dependencies_parsed_at":"2024-10-20T19:51:00.767Z","dependency_job_id":null,"html_url":"https://github.com/crazy-max/dokuwiki-plugin-syntaxhighlighter4","commit_stats":{"total_commits":58,"total_committers":4,"mean_commits":14.5,"dds":"0.48275862068965514","last_synced_commit":"95b7792e8e8fcedc970d4eb0ec512f1c37952eb0"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/crazy-max/dokuwiki-plugin-syntaxhighlighter4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdokuwiki-plugin-syntaxhighlighter4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdokuwiki-plugin-syntaxhighlighter4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdokuwiki-plugin-syntaxhighlighter4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdokuwiki-plugin-syntaxhighlighter4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazy-max","download_url":"https://codeload.github.com/crazy-max/dokuwiki-plugin-syntaxhighlighter4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdokuwiki-plugin-syntaxhighlighter4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271681566,"owners_count":24802077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["brushes","clipboard","dokuwiki","syntaxhighlighter"],"created_at":"2024-10-03T12:10:33.181Z","updated_at":"2025-08-22T18:31:53.452Z","avatar_url":"https://github.com/crazy-max.png","language":"PHP","funding_links":["https://github.com/sponsors/crazy-max","https://www.paypal.me/crazyws"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/crazy-max/dokuwiki-plugin-syntaxhighlighter4\" target=\"_blank\"\u003e\u003cimg width=\"100\" src=\"https://raw.githubusercontent.com/crazy-max/dokuwiki-plugin-syntaxhighlighter4/master/resources/logo-128.png\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/crazy-max/dokuwiki-plugin-syntaxhighlighter4/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/crazy-max/dokuwiki-plugin-syntaxhighlighter4.svg?style=flat-square\" alt=\"Github Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.dokuwiki.org/releasenames\"\u003e\u003cimg src=\"https://img.shields.io/badge/dokuwiki-%3E%3D%20Elenor%20of%20Tsort-yellow.svg?style=flat-square\" alt=\"Minimum DokuWiki Version\"\u003e\u003c/a\u003e\n  \u003cbr /\u003e\u003ca href=\"https://github.com/sponsors/crazy-max\"\u003e\u003cimg src=\"https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github\u0026style=flat-square\" alt=\"Become a sponsor\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.paypal.me/crazyws\"\u003e\u003cimg src=\"https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal\u0026style=flat-square\" alt=\"Donate Paypal\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## :warning: Abandoned project\n\nThis project is not maintained anymore and is abandoned. Feel free to fork and make your own changes if needed.\n\nThanks to everyone for their valuable feedback and contributions.\n\n## About\n\nThis plugin is an alternative to GeSHi server-side code highlighting of DokuWiki with client-side [SyntaxHighlighter](https://github.com/syntaxhighlighter/syntaxhighlighter) by Alex Gorbatchev.\u003cbr /\u003e\n\nThe subfolder `syntaxhighlighter4/dist` contains a build of [SyntaxHighlighter 4.x](https://github.com/syntaxhighlighter/syntaxhighlighter).\u003cbr /\u003e\n\nFor compatibility and conflicts with others plugins, please refer to the official [DokuWiki SyntaxHighlighter4 plugin page](http://www.dokuwiki.org/plugin:syntaxhighlighter4).\n\n## Download and Installation\n\nDownload and install the plugin using the [Plugin Manager](https://www.dokuwiki.org/plugin:plugin) using the download link given above. Refer to [Plugins](https://www.dokuwiki.org/plugins) on how to install plugins manually.\u003cbr /\u003e\n\nIf you install this plugin manually, make sure it is installed in `lib/plugins/syntaxhighlighter4/`. If the folder is called different it will not work!\n\n## Syntax and Usage\n\n```\n\u003csxh [brush][; options]\u003e\n... code/text ...\n\u003c/sxh\u003e\n```\n\n### Brush\n\nThe brush (language) that SyntaxHighlighter should use. Defaults to \"text\" if none is provided.\u003cbr /\u003e\nSee the section [brushes and themes](#list-of-brushes-and-themes) for a complete list of available brushes.\n\n### Options\n\nSemicolon separated options for SyntaxHighlighter, see [SyntaxHighlighter Configuration](https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Configuration#per-element-configuration).\u003cbr /\u003e\nThe plugin handles the [Block Title from SyntaxHighlighter 3](http://alexgorbatchev.com/SyntaxHighlighter/whatsnew.html#blocktitle) as an option, i.e. `title: \u003ctitle string\u003e;`.\n\n### Defaults\n\n[Syntaxhighlighter default options](https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Configuration#options) can be overrided via the [Config Manager](https://www.dokuwiki.org/plugin:config) :\n* **autoLinks**: Allows you to turn detection of links in the highlighted element on and off. If the option is turned off, URLs won’t be clickable `(default true)`\n* **firstLine**: Allows you to change the first (starting) line number `(default 1)`\n* **gutter**: Allows you to turn gutter with line numbers `(default true)`\n* **htmlScript**: Allows you to highlight a mixture of HTML/XML code and a script which is very common in web development. Setting this value to true requires that you have shBrushXml.js loaded and that the brush you are using supports this feature `(default false)`\n* **smartTabs**: Allows you to turn smart tabs feature on and off `(default true)`\n* **tabSize**: Allows you to adjust tab size `(default 4)`\n* **override**: List of tags to override\n\n## Example\n\n```\n\u003csxh php; first-line: 89; highlight: [106,107]; title: New title attribute in action\u003e\n    /**\n     * Render xhtml output or metadata\n     *\n     * @param string         $mode      Renderer mode (supported modes: xhtml)\n     * @param Doku_Renderer  $renderer  The renderer\n     * @param array          $data      The data from the handler() function\n     * @return bool If rendering was successful.\n     */\n    public function render($mode, Doku_Renderer \u0026$renderer, $data) {\n        if($mode != 'xhtml') return false;\n\n        if (count($data) != 3) {\n            return true;\n        }\n\n        list($syntax, $attr, $content) = $data;\n        if ($syntax == 'sxh') {\n            $title = $this-\u003eprocTitle($attr);\n            $highlight = $this-\u003eprocHighlight($attr);\n            $renderer-\u003edoc .= '\u003cpre class=\"brush: ' . strtolower($attr . $highlight) . '\"' . $title . '\u003e' . $renderer-\u003e_xmlEntities($content) . '\u003c/pre\u003e';\n        } else {\n            $renderer-\u003efile($content);\n        }\n\n        return true;\n    }\n\u003c/sxh\u003e\n```\n\nExpected result:\n\n![](resources/example.png)\n\n## Features\n\n### Copy to clipboard\n\nDouble click anywhere inside SyntaxHighlighter code area to highlight the text and then copy it using Ctrl/Cmd+C or mouse right click \u003e Copy.\u003cbr /\u003e\nClick outside the code area to restore highlighting.\n\n### Highlight a range of lines\n\nExample:\n\n```\n\u003csxh php; highlight: [11-15]\u003e\n    /**\n     * [Custom event handler which performs action]\n     *\n     * @param Doku_Event $event  event object by reference\n     * @param mixed      $param  [the parameters passed as fifth argument to register_hook() when this\n     *                           handler was registered]\n     * @return void\n     */\n\n    public function handle_metaheader(Doku_Event \u0026$event, $param) {\n        // Add SyntaxHighlighter theme.\n        $event-\u003edata['link'][] = array('rel' =\u003e 'stylesheet',\n            'type' =\u003e 'text/css',\n            'href' =\u003e DOKU_BASE . 'lib/plugins/syntaxhighlighter4/dist/'.$this-\u003egetConf('theme'),\n        );\n\n        // Register SyntaxHighlighter javascript.\n        $event-\u003edata[\"script\"][] = array(\"type\" =\u003e \"text/javascript\",\n            \"src\" =\u003e DOKU_BASE . \"lib/plugins/syntaxhighlighter4/dist/syntaxhighlighter.js\",\n            \"_data\" =\u003e \"\"\n        );\n    }\n\u003c/sxh\u003e\n```\n\nExpected result:\n\n![](resources/highlight-range.png)\n\n### List of brushes and themes\n\n* **[Official brushes](https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Brushes-and-Themes)**\n  * applescript\n  * as3\n  * base\n  * bash\n  * coldfusion\n  * cpp\n  * csharp\n  * css\n  * delphi\n  * diff\n  * erlang\n  * groovy\n  * haxe\n  * java\n  * javafx\n  * javascript\n  * perl\n  * php\n  * plain\n  * powershell\n  * python\n  * ruby\n  * sass\n  * scala\n  * sql\n  * swift\n  * tap\n  * typescript\n  * vb\n  * xml\n* **Custom brushes**\n  * halcon\n  * IEC61131\n  * kotlin\n  * latex\n  * Makefile\n  * mel\n  * objective-c\n  * yaml\n* **[Official themes](https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Brushes-and-Themes)**\n  * default\n  * django\n  * eclipse\n  * emacs\n  * fadetogrey\n  * mdultra\n  * midnight\n  * rdark\n  * swift\n* **Custom themes**\n\n## How can I help ?\n\nAll kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket:\n\nThanks again for your support, it is much appreciated! :pray:\n\n## License\n\nGPLv2. See `LICENSE` for more details.\u003cbr /\u003e\nIcon credit to [Snip Master](http://www.snipicons.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fdokuwiki-plugin-syntaxhighlighter4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazy-max%2Fdokuwiki-plugin-syntaxhighlighter4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fdokuwiki-plugin-syntaxhighlighter4/lists"}