GitHub repo: https://github.com/I6-I6/RuleEdit
To try it yourself, run it locally using Vite:
Code: Select all
git clone https://github.com/I6-I6/RuleEdit.git
cd RuleEdit
npm install
npm run devIt was built using CodeMirror 6 and written in JavaScript.
Whenever the user alters something in the text field, the text is sent to analyzer.js, which then scans through the text section by section. It returns an object containing an array of diagnostics (i.e. issues), an array of tokens (info on how to style the text) and the rule name. renderer.js takes this and applies everything.
Current features
Underline diagnostics:
- Errors: Guaranteed crash; solid red underline
- Warnings: Potential crash; solid orange underline
- Hints: Not a crash, but helpful information (such as omitting duplicates); dotted green underline
- Section headers: light blue
- Comments: italicized gray
- Keywords: pinkish red
- Numbers: tan
- Variables: orange
Things to add
- Finish logic for the rest of analyze.js
- Display diagnostic messages at the bottom (diagnostics-panel element). Click on them to jump to the line. Add buttons to ignore/quick fixes.
- Autocorrect/autocomplete/suggestions popups
- Import/export .rule files
- Table-to-tree & tree-to-table shortcuts
- Rulestring-to-table/tree shortcuts
- Color picker for @COLORS and @ICONS
- Drawing & import images features for @ICONS
- Rule preview (maybe) (using LV?)