{"id":19692169,"url":"https://github.com/getgrav/grav-plugin-highlight","last_synced_at":"2026-03-16T15:03:21.351Z","repository":{"id":21595416,"uuid":"24915543","full_name":"getgrav/grav-plugin-highlight","owner":"getgrav","description":"Grav Highlight Plugin","archived":false,"fork":false,"pushed_at":"2021-05-06T12:59:34.000Z","size":426,"stargazers_count":27,"open_issues_count":6,"forks_count":11,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-19T07:44:36.976Z","etag":null,"topics":["grav","grav-plugin","highlighting","highlightjs"],"latest_commit_sha":null,"homepage":"https://getgrav.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getgrav.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-10-07T23:06:46.000Z","updated_at":"2025-03-15T20:57:41.000Z","dependencies_parsed_at":"2022-08-21T18:41:04.382Z","dependency_job_id":null,"html_url":"https://github.com/getgrav/grav-plugin-highlight","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-highlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-highlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-highlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-highlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getgrav","download_url":"https://codeload.github.com/getgrav/grav-plugin-highlight/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251166783,"owners_count":21546266,"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","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":["grav","grav-plugin","highlighting","highlightjs"],"created_at":"2024-11-11T19:12:30.167Z","updated_at":"2026-03-16T15:03:16.319Z","avatar_url":"https://github.com/getgrav.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grav Highlight Plugin\n\n![Highlight](assets/readme_1.png)\n\n`highlight` is a [Grav](http://github.com/getgrav/grav) plugin that adds simple and powerful code highlighting functionality utilizing [Highlight.js](https://highlightjs.org/).\n\n\u003e Highlight.js: v10.5.0  \n\u003e Highlight.js line numbers [plugin](https://github.com/wcoder/highlightjs-line-numbers.js/): v2.8.0\n\n# Installation\n\nInstalling the Highlight plugin can be done in one of two ways. Our GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file. \n\n## GPM Installation (Preferred)\n\nThe simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line).  From the root of your Grav install type:\n\n    bin/gpm install highlight\n\nThis will install the Highlight plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/highlight`.\n\n## Manual Installation\n\nTo install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `highlight`. You can find these files either on [GitHub](https://github.com/getgrav/grav-plugin-highlight) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).\n\nYou should now have all the plugin files under\n\n    /your/site/grav/user/plugins/highlight\n\n\u003e\u003e NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav), the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) plugins, and a theme to be installed in order to operate.\n\n# Usage\n\nTo best understand how Highlight works, you should read through the original project [documentation](https://highlightjs.org/usage/).\n\nYou can override any default settings from the page headers:\n\neg:\n\n    ---\n    title: Sample Code With Custom Theme\n    highlight:\n        theme: monokai\n    ---\n\n    ```\n    @font-face {\n      font-family: Chunkfive; src: url('Chunkfive.otf');\n    }\n\n    body, .usertext {\n      color: #F0F0F0; background: #600;\n      font-family: Chunkfive, sans;\n    }\n\n    @import url(print.css);\n    @media print {\n      a[href^=http]::after {\n        content: attr(href)\n      }\n    }\n    ```\n\n\nYou can also disable highlighting for a particular page if causes issues:\n\n    ---\n    title: Sample Code with Highlight disabled\n    highlight:\n        enabled: false\n    ---\n\n    ```\n    @font-face {\n      font-family: Chunkfive; src: url('Chunkfive.otf');\n    }\n\n    body, .usertext {\n      color: #F0F0F0; background: #600;\n      font-family: Chunkfive, sans;\n    }\n\n    @import url(print.css);\n    @media print {\n      a[href^=http]::after {\n        content: attr(href)\n      }\n    }\n    ```\n\nFurther, you can also enable line numbers on a specific page, or globally (in highlight.yaml):\n\n    ---\n    title: Sample Code with Highlight and line numbers enabled\n    highlight:\n        enabled: true\n        lines: true\n    ---\n\nValid theme options include: \n\n|                           |                          |                        |\n| :------------------------ | :--------------------    | :--------------------- |\n| a11y-dark                 | darcula                  | nnfx-dark\n| a11y-light                | dark                     | nord\n| agate                     | default                  | obsidian\n| an-old-hope               | docco                    | ocean\n| androidstudio             | dracula                  | paraiso-dark\n| arduino-light             | far                      | paraiso-light\n| arta                      | foundation               | pojoaque\n| ascetic                   | github                   | purebasic\n| atelier-cave-dark         | github-gist              | qtcreator_dark\n| atelier-cave-light        | gml                      | qtcreator_light\n| atelier-dune-dark         | googlecode               | railscasts\n| atelier-dune-light        | gradient-dark            | rainbow\n| atelier-estuary-dark      | gradient-light           | routeros\n| atelier-estuary-light     | grayscale                | school-book\n| atelier-forest-dark       | gruvbox-dark             | school-book\n| atelier-forest-light      | gruvbox-light            | shades-of-purple\n| atelier-heath-dark        | highlightjs-line-numbers | solarized-dark\n| atelier-heath-light       | hopscotch                | solarized-light\n| atelier-lakeside-dark     | hybrid                   | srcery\n| atelier-lakeside-light    | idea                     | stackoverflow-dark\n| atelier-plateau-dark      | ir-black                 | stackoverflow-light\n| atelier-plateau-light     | isbl-editor-dark         | sunburst\n| atelier-savanna-dark      | isbl-editor-light        | tomorrow\n| atelier-savanna-light     | kimbie.dark              | tomorrow-night\n| atelier-seaside-dark      | kimbie.light             | tomorrow-night-blue\n| atelier-seaside-light     | learn                    | tomorrow-night-bright\n| atelier-sulphurpool-dark  | lightfair                | tomorrow-night-eighties\n| atelier-sulphurpool-light | lioshi                   | vs\n| atom-one-dark             | magula                   | vs2015\n| atom-one-dark-reasonable  | mono-blue                | xcode\n| atom-one-light            | monokai                  | xt256\n| brown-paper               | monokai-sublime          | zenburn\n| codepen-embed             | night-owl                | \n| color-brewer              | nnfx                     | \n\nCheck out a [live demo](https://highlightjs.org/static/demo/) of these themes.\n\nFollowing languages are supported:\n\n|                        |                          |                           |\n| :--------------------- | :--------------------    | :----------------------   |\n| .properties            | JSON                     | R                         |\n| Apache config          | Kotlin                   | Ruby                      |\n| Bash                   | Less                     | Rust                      |\n| C                      | Lua                      | SCSS                      |\n| C#                     | Makefile                 | Shell Session             |\n| C++                    | Markdown                 | SQL                       |\n| CoffeeScript           | Nginx config             | Swift                     |\n| CSS                    | Objective-C              | TOML, also INI            |\n| Diff                   | Perl                     | Twig                      |\n| Go                     | PHP                      | TypeScript                |\n| HTML, XML              | PHP Template             | Visual Basic .NET         |\n| HTTP                   | Plain text               | YAML                      |\n| Java                   | Python                   |                           |\n| JavaScript             | Python REPL              |                           |\n\n# Updating\n\nAs development for the Highlight plugin continues, new versions may become available that add additional features and functionality, improve compatibility with newer Grav releases, and generally provide a better user experience. Updating Highlight is easy, and can be done through Grav's GPM system, as well as manually.\n\n## GPM Update (Preferred)\n\nThe simplest way to update this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm). You can do this with this by navigating to the root directory of your Grav install using your system's Terminal (also called command line) and typing the following:\n\n    bin/gpm update highlight\n\nThis command will check your Grav install to see if your Highlight plugin is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type `y` and hit enter. The plugin will automatically update and clear Grav's cache.\n\n## Manual Update\n\nManually updating Highlight is pretty simple. Here is what you will need to do to get this done:\n\n* Delete the `your/site/user/plugins/highlight` directory.\n* Downalod the new version of the Highlight plugin from either [GitHub](https://github.com/getgrav/grav-plugin-highlight) or [GetGrav.org](http://getgrav.org/downloads/plugins#extras).\n* Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `highlight`.\n* Clear the Grav cache. The simplest way to do this is by going to the root Grav directory in terminal and typing `bin/grav clear-cache`.\n\n\u003e Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in `user/config/plugins`) will remain intact.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetgrav%2Fgrav-plugin-highlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetgrav%2Fgrav-plugin-highlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetgrav%2Fgrav-plugin-highlight/lists"}