{"id":21789142,"url":"https://github.com/StyraInc/highlightjs-rego","last_synced_at":"2025-07-19T21:31:35.419Z","repository":{"id":263974171,"uuid":"891935633","full_name":"StyraInc/highlightjs-rego","owner":"StyraInc","description":"Syntax highlighting for Rego","archived":false,"fork":false,"pushed_at":"2025-06-26T08:44:04.000Z","size":137,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-14T05:36:42.045Z","etag":null,"topics":["highlightjs","opa","open-policy-agent","policy-as-code","rego","syntax-highlighting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StyraInc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-21T08:15:30.000Z","updated_at":"2025-06-26T08:44:06.000Z","dependencies_parsed_at":"2024-11-21T10:23:48.192Z","dependency_job_id":"f2de64e1-8297-439e-aa54-0048ae00e7cb","html_url":"https://github.com/StyraInc/highlightjs-rego","commit_stats":null,"previous_names":["styrainc/highlightjs-rego"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/StyraInc/highlightjs-rego","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fhighlightjs-rego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fhighlightjs-rego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fhighlightjs-rego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fhighlightjs-rego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StyraInc","download_url":"https://codeload.github.com/StyraInc/highlightjs-rego/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fhighlightjs-rego/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266019657,"owners_count":23864916,"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":["highlightjs","opa","open-policy-agent","policy-as-code","rego","syntax-highlighting"],"created_at":"2024-11-27T04:01:20.481Z","updated_at":"2025-07-19T21:31:30.393Z","avatar_url":"https://github.com/StyraInc.png","language":"JavaScript","funding_links":[],"categories":["IDE and Editor Integrations"],"sub_categories":["Datasource Integrations Blogs and Articles"],"readme":"# highlightjs-rego\n\n[highlight.js](https://highlightjs.org/) syntax highlighting for the\n[Rego](https://www.openpolicyagent.org/docs/latest/policy-language) language of Open Policy Agent (OPA).\n\n![Screenshot](assets/highlight-rego.png)\n\n## How to use\n\nHead over to the [releases](https://github.com/StyraInc/highlightjs-rego/releases) page and grab the minified version of\nthe Rego syntax definition file (`rego.min.js` or `rego.es.min.js`). Include it in your HTML file, and use the\n`language-rego` class for the `\u003ccode\u003e` block you want to highlight:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003ctitle\u003eHighlight.js Rego Demo\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" href=\"path/to/theme.css\"\u003e\n  \u003cscript type=\"text/javascript\" src=\"path/to/highlight.min.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\" src=\"path/to/rego.min.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\"\u003ehljs.highlightAll();\u003c/script\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n  \u003cpre\u003e\u003ccode class=\"language-rego\"\u003e\n# METADATA\n# description: Your Rego policy here!\npackage policy\n\ndefault allow := false\n\nallow if {\n    # ..conditions..\n}\n  \u003c/code\u003e\u003c/pre\u003e\n\u003c/body\u003e\n\n\u003c/html\u003e\n```\n\n## How to build\n\nBuilding from source can either be done by running the `build.sh` script in this repository, or manually\nfollowing the steps below.\n\n1. Clone the highlight.js repository\n   ```\n   git clone https://github.com/highlightjs/highlight.js.git\n   ```\n2. Clone this repository\n    ```\n    git clone https://github.com/StyraInc/highlightjs-rego.git\n    ```\n3. In the `extra` directory of the highlight.js repository, create a symlink to this repository\n    ```shell\n    ln -s /path/to/highlightjs-rego /path/to/highlight.js/extra/highlightjs-rego\n    ```\n4. In the root of the highlight.js repository, run:\n   ```shell\n   node ./tools/build.js -t cdn\n   ```\n5. You'll now find `rego.min.js` in the `build` directory\n\nMore detailed instructions for building 3rd party language support for highlight.js can be found\n[here](https://github.com/highlightjs/highlight.js/blob/main/extra/3RD_PARTY_QUICK_START.md#packaging).\n\n## Community\n\nFor questions, discussions and announcements related to Styra products, services and open source projects, please join\nthe Styra community on [Slack](https://communityinviter.com/apps/styracommunity/signup)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStyraInc%2Fhighlightjs-rego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStyraInc%2Fhighlightjs-rego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStyraInc%2Fhighlightjs-rego/lists"}