Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_highlightjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
tree .
ls -Alh

- name: Upload Flix spec
- name: Upload Flix CDN distributable
uses: actions/upload-artifact@v3
with:
name: flix.min.js
path: extra/flix/dist/flix.min.js
name: flix.cdn.dist
path: extra/flix/dist

- name: Upload minimal Highlight.js with Flix bundled
uses: actions/upload-artifact@v3
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ tramp

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el
Expand Down Expand Up @@ -304,7 +303,6 @@ out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ We refer you to

## Use

### Pre-built CDN files

There are pre-built CDN files that can just be dropped in to work with
an existing highlight.js script.
These can be found in the `dist/` directory of this repository.

Note that the `dist/highlight.min.js` file is the file
built by the GitHub workflow in this repository and is a minimal
highlight.js build that only supports Flix.
This file is **NOT** part of the CDN pre-built files and should
hence not but used if you intend to use highlight.js conventionally.

### Using GitHub workflow

The highlight.js file built by the GitHub workflow
should work automatically when included on a website.

Expand Down
18 changes: 18 additions & 0 deletions dist/flix.es.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*! `flix` grammar compiled for Highlight.js 11.6.0 */
var hljsGrammar=(()=>{"use strict";return e=>{const n={scope:"number",
begin:e.C_NUMBER_RE+"(f(32|64)|i(8|16|32|64)|ii)?",relevance:0},t={
scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,{
scope:"subst",begin:/(\$|\%)\{/,end:/\}/}]},a={scope:"title",
begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,
relevance:0},r={scope:"title.class",beginKeywords:"class|enum",
end:/[:={\[\n;]|\(/,excludeEnd:!0,
contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a]},i={
scope:"title.function",beginKeywords:"def",end:/[(\[]/,excludeEnd:!0,
contains:[a]},s={scope:"literal",variants:[{begin:/\?\?\?/},{begin:/\?/,
contains:[a]}]};return{name:"Flix",keywords:{$pattern:e.IDENT_RE+"!?",
keyword:["instance","lawful","law","type","alias","yield","lazy","force","override","def","with","let","sealed","pub","object","if","then","else","for","foreach","import","use","get","set","new","catch","class","case","default","try","match","enum","and","or","not","ref","deref","as","eff","upcast","static","spawn","solve","select","region","par","namespace","without","do","resume","chan","select","inject","project","into","from","where","query","inline","discard"],
literal:["()","true","false","Nil","Some","None","LessThan","EqualTo","GreaterThan","Ok","Err"],
type:["Unit","Bool","Char","Float32","Float64","Int8","Int16","Int32","Int64","String","BigInt"],
built_in:["debug","debug!","debug!!","IO","ef","ef1","ef2","Read","Write","Channel","Eq","PartialOrder","Order","Cmp","List","Map","Set","RedBlackTree","Result","Array","ToString","toString","flip","on","identity","fst","snd","swap",">>","|>","||>","!>","print","println","bug!","unreachable!"]
},contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t,n,i,r,{scope:"meta",
begin:"@[A-Za-z]+"},s]}}})();export default hljsGrammar;
18 changes: 18 additions & 0 deletions dist/flix.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*! `flix` grammar compiled for Highlight.js 11.6.0 */
(()=>{var e=(()=>{"use strict";return e=>{const n={scope:"number",
begin:e.C_NUMBER_RE+"(f(32|64)|i(8|16|32|64)|ii)?",relevance:0},t={
scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,{
scope:"subst",begin:/(\$|\%)\{/,end:/\}/}]},a={scope:"title",
begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,
relevance:0},i={scope:"title.class",beginKeywords:"class|enum",
end:/[:={\[\n;]|\(/,excludeEnd:!0,
contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a]},r={
scope:"title.function",beginKeywords:"def",end:/[(\[]/,excludeEnd:!0,
contains:[a]},s={scope:"literal",variants:[{begin:/\?\?\?/},{begin:/\?/,
contains:[a]}]};return{name:"Flix",keywords:{$pattern:e.IDENT_RE+"!?",
keyword:["instance","lawful","law","type","alias","yield","lazy","force","override","def","with","let","sealed","pub","object","if","then","else","for","foreach","import","use","get","set","new","catch","class","case","default","try","match","enum","and","or","not","ref","deref","as","eff","upcast","static","spawn","solve","select","region","par","namespace","without","do","resume","chan","select","inject","project","into","from","where","query","inline","discard"],
literal:["()","true","false","Nil","Some","None","LessThan","EqualTo","GreaterThan","Ok","Err"],
type:["Unit","Bool","Char","Float32","Float64","Int8","Int16","Int32","Int64","String","BigInt"],
built_in:["debug","debug!","debug!!","IO","ef","ef1","ef2","Read","Write","Channel","Eq","PartialOrder","Order","Cmp","List","Map","Set","RedBlackTree","Result","Array","ToString","toString","flip","on","identity","fst","snd","swap",">>","|>","||>","!>","print","println","bug!","unreachable!"]
},contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t,n,r,i,{scope:"meta",
begin:"@[A-Za-z]+"},s]}}})();hljs.registerLanguage("flix",e)})();
Loading