Prism (a lightweight, extensible syntax highlighter) support for Cedar policy language based on Grammar specification for Cedar policy syntax and for Cedar schema based on Grammar specification for Cedar schemas and mapped to Prism tokens.
Web browser <script src=>
usage example from test/static/index.html
(adjust the script src
paths as required):
<script src="prism.js"></script>
<script src="prism-cedar.js"></script>
Install the project dependencies using npm install
.
src/prism-cedar.js
is the main source file.
The npm run build
script uses esbuild to create dist/prism-cedar.min.js
with the --minify
option.
npm run test
uses vitest to syntax highlight test/data/*.cedar
and test/data/*.cedarschema
files and compares against a generated .html
File Snapshots for each Cedar and Cedar schema file.
View the static test/static/index.html
in your browser which loads dist/prism-cedar.min.js
. The test/static
folder includes a downloaded copy of PrismJS 1.29.0.
When new test/data/*.cedar
or test/data/*.cedarschema
files are created, npm run testdata
will update the contents of each index.html
file.
Pull requests require a Developer Certificate of Origin (DCO) to certify the right to submit the code they are contributing to the project. Either add the -s
or the --signoff
flag to your commits or update your .vscode/settings.json
with git.alwaysSignOff
.
{
"git.alwaysSignOff": true
}
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.