with syntax highlighting and syntax validation using ANTL4 grammar and ACE worker.
Proof of concept sample editor.
The editor can communicate with other web apps using cross document messaging API (window.opener.postMessage()).
- 'submit plain' button sends the message in the form
{'contentType':'text/plain','content':'...'}
- 'submit compressed' button sends the content compressed by LZ algorithm and encoded in base64 in the form
{'contentType':'application/x-lzip','content':'FDAmHsGMFcFsFMB2AXEaAOAneAzAlgB4A...'}
The editor can be filled by initial content in following hash parameters:
- 'content' for plain/text e.g.: https://h2020-westlife-eu.github.io/prov-n-editor/#content=document%0Dentity(e1)%0DendDocument
- 'contentBase64' for base64 encoded text
- 'contentLZ' for LZ compressed and base64 encoded text,
- https://h2020-westlife-eu.github.io/prov-n-editor/
- Empty document
- short document
- longer document encoded base64
- very long document,compressed and base64
git clone
It is standalone web page, just put index.html and all related stuff (all repo) into desired location.
- get grammar into parser dir
- generate JavaScript target:
antlr4 -Dlanguage=JavaScript PROV_N.g4
- modify the
*.js
files to point to antlr4 invendor/antlr4/index
instead ofantlr4/index
- check modify the
prov-n-worker.js
to point to the generated Lexer, Parser - use index.html to directly test the output
- to build distribution - install webpack and copy-webpack-plugin
npm install -g webpack-cli
npm install copy-webpack-plugin
and executewebpack
this will producedist/
directory which can be copied into desired location - index.html contains relative links.
PROV-N editor without syntax checking at openprovenance.org/tools/editor/