{"id":18666310,"url":"https://github.com/docpad/docpad-plugin-highlightjs","last_synced_at":"2025-07-07T01:33:40.637Z","repository":{"id":471083,"uuid":"6255689","full_name":"docpad/docpad-plugin-highlightjs","owner":"docpad","description":"Adds support for Highlight.js syntax highlighting to DocPad","archived":false,"fork":false,"pushed_at":"2024-01-29T23:45:32.000Z","size":493,"stargazers_count":20,"open_issues_count":12,"forks_count":18,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-21T12:04:31.544Z","etag":null,"topics":["docpad-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/docpad.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["balupton"],"patreon":"bevry","open_collective":"bevry","ko_fi":"balupton","liberapay":"bevry","custom":["https://bevry.me/fund"]}},"created_at":"2012-10-17T03:39:20.000Z","updated_at":"2021-03-24T17:06:14.000Z","dependencies_parsed_at":"2024-06-19T01:42:02.170Z","dependency_job_id":"4e282315-22ab-40af-baae-54f6df2ac6c2","html_url":"https://github.com/docpad/docpad-plugin-highlightjs","commit_stats":{"total_commits":82,"total_committers":9,"mean_commits":9.11111111111111,"dds":"0.24390243902439024","last_synced_commit":"bc8f5da3105c63d92e6f31e7e043adbb2c5e2115"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/docpad/docpad-plugin-highlightjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docpad%2Fdocpad-plugin-highlightjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docpad%2Fdocpad-plugin-highlightjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docpad%2Fdocpad-plugin-highlightjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docpad%2Fdocpad-plugin-highlightjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docpad","download_url":"https://codeload.github.com/docpad/docpad-plugin-highlightjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docpad%2Fdocpad-plugin-highlightjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263997839,"owners_count":23541743,"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":["docpad-plugin"],"created_at":"2024-11-07T08:31:43.270Z","updated_at":"2025-07-07T01:33:40.595Z","avatar_url":"https://github.com/docpad.png","language":"JavaScript","readme":"# [Highlight.js](https://github.com/isagalaev/highlight.js) Plugin for [DocPad](http://docpad.org)\n\n\u003c!-- BADGES/ --\u003e\n\n\u003cspan class=\"badge-travisci\"\u003e\u003ca href=\"http://travis-ci.org/docpad/docpad-plugin-highlightjs\" title=\"Check this project's build status on TravisCI\"\u003e\u003cimg src=\"https://img.shields.io/travis/docpad/docpad-plugin-highlightjs/master.svg\" alt=\"Travis CI Build Status\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmversion\"\u003e\u003ca href=\"https://npmjs.org/package/docpad-plugin-highlightjs\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/docpad-plugin-highlightjs.svg\" alt=\"NPM version\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmdownloads\"\u003e\u003ca href=\"https://npmjs.org/package/docpad-plugin-highlightjs\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/docpad-plugin-highlightjs.svg\" alt=\"NPM downloads\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-daviddm\"\u003e\u003ca href=\"https://david-dm.org/docpad/docpad-plugin-highlightjs\" title=\"View the status of this project's dependencies on DavidDM\"\u003e\u003cimg src=\"https://img.shields.io/david/docpad/docpad-plugin-highlightjs.svg\" alt=\"Dependency Status\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-daviddmdev\"\u003e\u003ca href=\"https://david-dm.org/docpad/docpad-plugin-highlightjs#info=devDependencies\" title=\"View the status of this project's development dependencies on DavidDM\"\u003e\u003cimg src=\"https://img.shields.io/david/dev/docpad/docpad-plugin-highlightjs.svg\" alt=\"Dev Dependency Status\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cbr class=\"badge-separator\" /\u003e\n\u003cspan class=\"badge-patreon\"\u003e\u003ca href=\"https://patreon.com/bevry\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-opencollective\"\u003e\u003ca href=\"https://opencollective.com/bevry\" title=\"Donate to this project using Open Collective\"\u003e\u003cimg src=\"https://img.shields.io/badge/open%20collective-donate-yellow.svg\" alt=\"Open Collective donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-flattr\"\u003e\u003ca href=\"https://flattr.com/profile/balupton\" title=\"Donate to this project using Flattr\"\u003e\u003cimg src=\"https://img.shields.io/badge/flattr-donate-yellow.svg\" alt=\"Flattr donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-bitcoin\"\u003e\u003ca href=\"https://bevry.me/bitcoin\" title=\"Donate once-off to this project using Bitcoin\"\u003e\u003cimg src=\"https://img.shields.io/badge/bitcoin-donate-yellow.svg\" alt=\"Bitcoin donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-wishlist\"\u003e\u003ca href=\"https://bevry.me/wishlist\" title=\"Buy an item on our wishlist for us\"\u003e\u003cimg src=\"https://img.shields.io/badge/wishlist-donate-yellow.svg\" alt=\"Wishlist browse button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cbr class=\"badge-separator\" /\u003e\n\u003cspan class=\"badge-slackin\"\u003e\u003ca href=\"https://slack.bevry.me\" title=\"Join this project's slack community\"\u003e\u003cimg src=\"https://slack.bevry.me/badge.svg\" alt=\"Slack community badge\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n\u003c!-- /BADGES --\u003e\n\nThis plugin enables [Highlight.js](https://github.com/isagalaev/highlight.js) syntax highlighting for [DocPad](https://docpad.org)\n\n## Install\n\n### Install the Plugin\n\n```\ndocpad install highlightjs\n```\n\n### Download a Stylesheet\n\n[Available stylesheets are here.](https://github.com/isagalaev/highlight.js/tree/8.0/src/styles) [You can preview some of them here.](http://highlightjs.org/static/test.html)\n\n## Usage\n\nExample inputs are [here](https://github.com/docpad/docpad-plugin-highlightjs/tree/master/test/src/documents) and their corresponding outputs are [here](https://github.com/docpad/docpad-plugin-highlightjs/tree/master/test/out-expected). For the general gist of things, the following will suffice:\n\n### HTML\n\n#### Input\n\n```html\n\u003ch3\u003eCoffescript - Lang tag\u003c/h3\u003e\n\u003cpre\u003e\u003ccode class=\"lang-coffeescript\"\u003e\nif true\n\tfunc = -\u0026gt;\n\t\talert \"hello world\"\n\n\tfunc()\n\u003c/code\u003e\u003c/pre\u003e\n```\n\n#### Output\n\n```html\n\u003ch3\u003eCoffescript - Lang tag\u003c/h3\u003e\n\u003cpre class=\"highlighted\"\u003e\u003ccode class=\"coffeescript\"\u003e\n\u003cspan class=\"keyword\"\u003eif\u003c/span\u003e \u003cspan class=\"literal\"\u003etrue\u003c/span\u003e\n\t\u003cspan class=\"function\"\u003e\u003cspan class=\"title\"\u003efunc\u003c/span\u003e\u003c/span\u003e = -\u0026gt;\n\t\talert \u003cspan class=\"string\"\u003e\"hello world\"\u003c/span\u003e\n\n\tfunc()\n\u003c/code\u003e\u003c/pre\u003e\n```\n\n### Markdown\n\n#### Input\n\n    ### Coffeescript with fenced code\n\n    ``` coffeescript\n    if true\n    \tfunc = -\u003e\n    \t\talert 'hello world'\n    \tfunc()\n    ```\n\n#### Output\n\n```html\n\u003ch3\u003eCoffeescript with fenced code\u003c/h3\u003e\n\u003cpre\n    class=\"highlighted\"\n\u003e\u003ccode class=\"coffeescript\"\u003e\u003cspan class=\"keyword\"\u003eif\u003c/span\u003e \u003cspan class=\"literal\"\u003etrue\u003c/span\u003e\n\t\u003cspan class=\"function\"\u003e\u003cspan class=\"title\"\u003efunc\u003c/span\u003e\u003c/span\u003e = -\u0026gt;\n\t\talert \u003cspan class=\"string\"\u003e'hello world'\u003c/span\u003e\n\tfunc()\u003c/code\u003e\u003c/pre\u003e\n```\n\n## Configure\n\n### Language Aliases\n\nSometimes one of the languages you want to highlight isn't available. In which case, you'd probably want to add an alias for it to a language that is similar. To do this, you'll want to add something like the following to your docpad configuration file.\n\n```coffee\nplugins:\n\thighlightjs:\n\t\taliases:\n\t\t\tmissinglanguage: 'alternativelanguage'\n```\n\n[You can find a list of languages that are supported via the Highlight.js source tree.](https://github.com/isagalaev/highlight.js/tree/master/src/languages)\n\n### Replacing Tabs\n\nBy default, we replace tabs with 4 spaces. This can be changed by changing the `replaceTab` configuration option:\n\n```coffee\nplugins:\n\thighlightjs:\n\t\treplaceTab: null  # keep tabs\n```\n\n### Transforms\n\nYou can apply transformations to code blocks before they are highlighted by using the `transforms` configuration option. It accepts an array of functions or arrays.\n\n```coffee\nplugins:\n\thighlightjs:\n\t\ttransforms: [\n\t\t\t# Remove extra indentation from the code block\n\t\t\t# Requires: http://balupton.com/project/bal-util\n\t\t\t(source, language) -\u003e\n\t\t\t\trequire('bal-util').removeIndentation(source)  if language in ['bash','coffeescript']\n\n\t\t\t# Replace \"(C)\" with \"\u0026copy;\"\n\t\t\t(source) -\u003e source.replace /\\(C\\)/gm, '\u0026copy;'\n\t\t]\n```\n\n### Class Name\n\nYou can customise the css classname that is added by adjusting the `className` configuration option, defaults to `highlight`\n\n```coffee\nplugins:\n\thighlightjs:\n\t\tclassName: 'blah'\n```\n\n\u003c!-- HISTORY/ --\u003e\n\n\u003ch2\u003eHistory\u003c/h2\u003e\n\n\u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/blob/master/HISTORY.md#files\"\u003eDiscover the release history by heading on over to the \u003ccode\u003eHISTORY.md\u003c/code\u003e file.\u003c/a\u003e\n\n\u003c!-- /HISTORY --\u003e\n\n\u003c!-- CONTRIBUTE/ --\u003e\n\n\u003ch2\u003eContribute\u003c/h2\u003e\n\n\u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/blob/master/CONTRIBUTING.md#files\"\u003eDiscover how you can contribute by heading on over to the \u003ccode\u003eCONTRIBUTING.md\u003c/code\u003e file.\u003c/a\u003e\n\n\u003c!-- /CONTRIBUTE --\u003e\n\n\u003c!-- BACKERS/ --\u003e\n\n\u003ch2\u003eBackers\u003c/h2\u003e\n\n\u003ch3\u003eMaintainers\u003c/h3\u003e\n\nThese amazing people are maintaining this project:\n\n\u003cul\u003e\u003cli\u003e\u003ca href=\"http://thedev.infinityatlas.com\"\u003eChase Colman\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=chase\" title=\"View the GitHub contributions of Chase Colman on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://balupton.com\"\u003eBenjamin Lupton\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=balupton\" title=\"View the GitHub contributions of Benjamin Lupton on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\n\u003ch3\u003eSponsors\u003c/h3\u003e\n\nNo sponsors yet! Will you be the first?\n\n\u003cspan class=\"badge-patreon\"\u003e\u003ca href=\"https://patreon.com/bevry\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-opencollective\"\u003e\u003ca href=\"https://opencollective.com/bevry\" title=\"Donate to this project using Open Collective\"\u003e\u003cimg src=\"https://img.shields.io/badge/open%20collective-donate-yellow.svg\" alt=\"Open Collective donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-flattr\"\u003e\u003ca href=\"https://flattr.com/profile/balupton\" title=\"Donate to this project using Flattr\"\u003e\u003cimg src=\"https://img.shields.io/badge/flattr-donate-yellow.svg\" alt=\"Flattr donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-bitcoin\"\u003e\u003ca href=\"https://bevry.me/bitcoin\" title=\"Donate once-off to this project using Bitcoin\"\u003e\u003cimg src=\"https://img.shields.io/badge/bitcoin-donate-yellow.svg\" alt=\"Bitcoin donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-wishlist\"\u003e\u003ca href=\"https://bevry.me/wishlist\" title=\"Buy an item on our wishlist for us\"\u003e\u003cimg src=\"https://img.shields.io/badge/wishlist-donate-yellow.svg\" alt=\"Wishlist browse button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n\u003ch3\u003eContributors\u003c/h3\u003e\n\nThese amazing people have contributed code to this project:\n\n\u003cul\u003e\u003cli\u003e\u003ca href=\"http://thedev.infinityatlas.com\"\u003eChase Colman\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=chase\" title=\"View the GitHub contributions of Chase Colman on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://balupton.com\"\u003eBenjamin Lupton\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=balupton\" title=\"View the GitHub contributions of Benjamin Lupton on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://delapouite.com\"\u003eBruno Heridet\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=Delapouite\" title=\"View the GitHub contributions of Bruno Heridet on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://mathiasbynens.be/\"\u003eMathias Bynens\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=mathiasbynens\" title=\"View the GitHub contributions of Mathias Bynens on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://robloach.net\"\u003eRob Loach\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=RobLoach\" title=\"View the GitHub contributions of Rob Loach on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://troykershaw.com\"\u003eTroy Kershaw\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=troykershaw\" title=\"View the GitHub contributions of Troy Kershaw on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/vsopvsop\"\u003evsopvsop\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=vsopvsop\" title=\"View the GitHub contributions of vsopvsop on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://www.merrickchristensen.com\"\u003eMerrick Christensen\u003c/a\u003e — \u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/commits?author=iammerrick\" title=\"View the GitHub contributions of Merrick Christensen on repository docpad/docpad-plugin-highlightjs\"\u003eview contributions\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\n\u003ca href=\"https://github.com/docpad/docpad-plugin-highlightjs/blob/master/CONTRIBUTING.md#files\"\u003eDiscover how you can contribute by heading on over to the \u003ccode\u003eCONTRIBUTING.md\u003c/code\u003e file.\u003c/a\u003e\n\n\u003c!-- /BACKERS --\u003e\n\n\u003c!-- LICENSE/ --\u003e\n\n\u003ch2\u003eLicense\u003c/h2\u003e\n\nUnless stated otherwise all works are:\n\n\u003cul\u003e\u003cli\u003eCopyright \u0026copy; 2012+ \u003ca href=\"http://thedev.infinityatlas.com\"\u003eChase Colman\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\nand licensed under:\n\n\u003cul\u003e\u003cli\u003e\u003ca href=\"http://spdx.org/licenses/MIT.html\"\u003eMIT License\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\n\n\u003c!-- /LICENSE --\u003e\n","funding_links":["https://github.com/sponsors/balupton","https://patreon.com/bevry","https://opencollective.com/bevry","https://ko-fi.com/balupton","https://liberapay.com/bevry","https://bevry.me/fund"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocpad%2Fdocpad-plugin-highlightjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocpad%2Fdocpad-plugin-highlightjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocpad%2Fdocpad-plugin-highlightjs/lists"}