{"id":18718496,"url":"https://github.com/highlightjs/highlightjs-apex","last_synced_at":"2025-04-12T13:33:52.125Z","repository":{"id":39559562,"uuid":"498318735","full_name":"highlightjs/highlightjs-apex","owner":"highlightjs","description":"Highlight.js grammar for Salesforce Apex language","archived":false,"fork":false,"pushed_at":"2025-03-16T22:54:44.000Z","size":1007,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T18:03:45.330Z","etag":null,"topics":["apex","highlight","salesforce","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/highlightjs-apex","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/highlightjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2022-05-31T12:04:46.000Z","updated_at":"2025-03-16T22:54:39.000Z","dependencies_parsed_at":"2024-02-09T09:43:04.424Z","dependency_job_id":"10a3711d-ce74-49ff-a03d-1ed1fa864385","html_url":"https://github.com/highlightjs/highlightjs-apex","commit_stats":{"total_commits":92,"total_committers":4,"mean_commits":23.0,"dds":0.6521739130434783,"last_synced_commit":"0cbe946d5d577c5e0eade4b39e8be2e4f113edd5"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-apex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-apex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-apex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/highlightjs%2Fhighlightjs-apex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/highlightjs","download_url":"https://codeload.github.com/highlightjs/highlightjs-apex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036063,"owners_count":21037092,"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":["apex","highlight","salesforce","syntax-highlighting"],"created_at":"2024-11-07T13:21:38.331Z","updated_at":"2025-10-14T12:11:04.869Z","avatar_url":"https://github.com/highlightjs.png","language":"JavaScript","readme":"![](./assets/salesforce_platform.png)\n\n# Apex - a language grammar for the [Salesforce Platform](https://developer.salesforce.com)\n\n[![NPM](https://nodei.co/npm/highlightjs-apex.png)](https://www.npmjs.com/package/highlightjs-apex)\n\n![Salesforce Version](https://img.shields.io/badge/Spring_'24-0d9dda?style=flat\u0026logo=salesforce\u0026logoColor=white\u0026label=Salesforce%20Release)\n[![npm version](https://img.shields.io/npm/v/highlightjs-apex)](https://www.npmjs.com/package/highlightjs-apex)\n[![npm downloads](https://img.shields.io/npm/dt/highlightjs-apex)](https://www.npmjs.com/package/highlightjs-apex)\n![install size](https://badgen.net/packagephobia/install/highlightjs-apex)\n[![License](https://img.shields.io/github/license/highlightjs/highlightjs-apex)](https://github.com/highlightjs/highlightjs-apex/blob/main/LICENSE.md)\n[![CDN download](https://badgen.net/badge/jsDelivr/download/blue?icon=jsdelivr)](https://cdn.jsdelivr.net/npm/highlightjs-apex/dist/apex.min.js)\n\n\u003c!-- [![jsDelivr CDN downloads](https://badgen.net/jsdelivr/hits/gh/highlightjs/highlightjs-apex?label=jsDelivr+CDN\u0026color=purple)](https://www.jsdelivr.com/package/gh/highlightjs/highlightjs-apex) --\u003e\n\n[![open issues](https://badgen.net/github/open-issues/highlightjs/highlightjs-apex?label=issues)](https://github.com/highlightjs/highlightjs-apex/issues)\n\n## Demo\n\nThe screenshot was captured from a webpage using `apex.min.js` from the `dist` folder and the main `highlight.min.js` library.\n(Code is from [Salesforce Trigger Framework](https://dschach.github.io/salesforce-trigger-framework/))\n![Demo](assets/ApexHighlighting.png)\nFeel free to use any css library you'd like!\n\n## Apex code requirements\n\nThis library will highlight Apex as used in Apex classes and triggers.\n\n## SOQL requirements\n\nTo highlight a SOQL query, it MUST be enclosed in square brackets (`[` and `]`). While creating a SOQL parser as a standalone sub-language (like javascript in html/Visualforce) would be ideal, this would require users to install both packages in a project and would get too messy. Each language can contain the other, so dependencies in the parsing become unwieldy.\n\n## Usage\n\nSimply include the Highlight.js library in your webpage or Node app, then load this module. For more complex usage, see [highlight.js usage](https://github.com/highlightjs/highlight.js#basic-usage).\n\n### Static website or simple usage\n\nSimply load this module after loading Highlight.js. You'll use the minified version found in the `dist` directory. This module is just a CDN build of the language, so it will register itself as the Javascript is loaded.\n\nFor more details see [Highlight.js main page](https://github.com/highlightjs/highlight.js#highlightjs).\n\n```html\n\u003cscript type=\"text/javascript\" src=\"/path/to/highlight.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"/path/to/apex.min.js\"\u003e\u003c/script\u003e\n\u003c!-- \u003clink rel=\"stylesheet\" href=\"https://unpkg.com/highlightjs/styles/vs.css\" /\u003e --\u003e\n\u003c!-- Use any stylesheet you'd like - though Apex developers may want to use the custom theme based on MavensMate's Monokai --\u003e\n\u003clink\n\trel=\"stylesheet\"\n\thref=\"https://cdn.jsdelivr.net/npm/highlightjs-apex/src/styles/monokai-sublime-apex.css\" /\u003e\n\n\u003cscript type=\"text/javascript\"\u003e\n\thljs.highlightAll();\n\u003c/script\u003e\n```\n\nThis will find and highlight code inside of `\u003cpre\u003e\u003ccode\u003e` tags; it tries to detect the language automatically. If automatic detection doesn’t work for you, you can specify the language in the `class` attribute:\n\n```html\n\u003cpre\u003e\n    \u003ccode class=\"language-apex\"\u003e\n    ...\n    \u003c/code\u003e\n\u003c/pre\u003e\n```\n\n#### Ignoring a Code Block\n\nTo skip highlighting of a code block completely, use the `nohighlight` class:\n\n```html\n\u003cpre\u003e\u003ccode class=\"nohighlight\"\u003e...\u003c/code\u003e\u003c/pre\u003e\n```\n\n### Using directly from jsDelivr\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.min.js\"\u003e\u003c/script\u003e\n\u003cscript\n\ttype=\"text/javascript\"\n\tsrc=\"https://cdn.jsdelivr.net/npm/highlightjs-apex/dist/apex.min.js\"\u003e\u003c/script\u003e\n```\n\n- More info: \u003chttps://www.jsdelivr.com/\u003e\n\n### Using directly from the unpkg CDN\n\n```html\n\u003cscript src=\"https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js\"\u003e\u003c/script\u003e\n\u003cscript\n\ttype=\"text/javascript\"\n\tsrc=\"https://unpkg.com/highlightjs-apex/dist/apex.min.js\"\u003e\u003c/script\u003e\n```\n\n- More info: \u003chttps://unpkg.com/\u003e\n\n### With Node or another build system\n\nIf you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with Highlight.js.\n\n```javascript\nvar hljs = require('highlightjs');\nvar hljsApex = require('highlightjs-apex');\n\nhljs.registerLanguage('apex', hljsApex);\nhljs.highlightAll();\n```\n\n### Styles\n\nThere are many styles to choose from at [https://highlightjs.org/demo](https://highlightjs.org/demo). They can be downloaded from [the GitHub repository](https://github.com/highlightjs/highlight.js/tree/main/src/styles) and referenced from unpkg.com (see sample html above).\nA great stylesheet for Apex is in this repo in the [styles folder](https://github.com/highlightjs/highlightjs-apex/tree/main/src/styles).\n\n## License\n\nHighlight.js is released under the BSD 3-Clause License. See [LICENSE](https://github.com/highlightjs/highlight.js/blob/main/LICENSE) file for details.\nHighlightjs-apex is released under the MIT License. See [LICENSE](/LICENSE.md) file for details.\n\n## Author\n\nDavid Schach [https://github.com/dschach](https://github.com/dschach)\n\n## Contribution\n\nFeel free to create issues or (even better) pull requests.\n\n## Links\n\n- The official site for the Highlight.js library is \u003chttps://highlightjs.org/\u003e.\n- The Highlight.js GitHub project: \u003chttps://github.com/highlightjs/highlight.js\u003e\n- Learn more about Apex: \u003chttps://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_intro_what_is_apex.htm\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighlightjs%2Fhighlightjs-apex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhighlightjs%2Fhighlightjs-apex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighlightjs%2Fhighlightjs-apex/lists"}