Skip to content

Commit de06160

Browse files
committed
Hacky highlighting for ec text output
1 parent adbe58e commit de06160

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

website/assets/css/custom.css

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,24 @@ code, kbd, pre {
9797
padding: 1em !important;
9898
}
9999

100+
.hljs-red {
101+
color: #ff5874;
102+
}
103+
.hljs-yellow {
104+
color: #ecc48d;
105+
}
106+
.hljs-green {
107+
color: #addb67;
108+
}
109+
.hljs-bash-prompt {
110+
color: #dcdcaa;
111+
font-weight: bold;
112+
}
113+
100114
.doc pre.highlightjs {
101115
font-size: .9rem;
102-
padding-top: 0.75em;
116+
padding-top: 0.3em;
117+
padding-bottom: 0.5em;
103118
}
104119

105120
.doc pre.highlightjs code {

website/assets/js/vendor/highlight.pack.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,4 +497,22 @@ built_in:["abs","all","and","any","array.concat","array.reverse","array.slice","
497497
className:"punctuation",relevance:0},{scope:"operator",
498498
match:r.either("==","=","\\+","-","<=","<",">=",">","!=","\\|","\\*")},{
499499
scope:"string",begin:"`",end:"`"},e.HASH_COMMENT_MODE,{begin:/import rego\.v1/,
500-
keywords:"import",relevance:10}]}}})();hljs.registerLanguage("rego",e)})();
500+
keywords:"import",relevance:10}]}}})();hljs.registerLanguage("rego",e)})();
501+
502+
/*! Custom highlight Pack for Conforma output. Simulate
503+
* how it looks in the terminal with the ansi text color. */
504+
(function () {
505+
'use strict';
506+
hljs.registerLanguage('ec', function statusHighlight() {
507+
return {
508+
name: 'Conforma output',
509+
case_insensitive: false,
510+
contains: [
511+
{ begin: / \[Violation\]/, className: 'red' },
512+
{ begin: / \[Warning\]/, className: 'yellow' },
513+
{ begin: / \[Success\]/, className: 'green' },
514+
{ begin: /^\$/, className: 'bash-prompt' },
515+
]
516+
};
517+
});
518+
})();

0 commit comments

Comments
 (0)