The Nova code editor uses an XML format to define syntax grammars for language definitions. This repository contains Relax NG schemas for the XML format which can be used to validate language extensions under development.
Run the validate.sh script with the extension directory as an argument:
% NovaExt-Validator/validate.sh ada.novaextension                                                 jolesen@Embla
Validating(xmllint) ada.novaextension/Syntaxes/ada.xml
ada.novaextension/Syntaxes/ada.xml validates
Validating(xmllint) ada.novaextension/Completions/ada.xml
ada.novaextension/Completions/ada.xml validatesAll XML files in the extension's Syntaxes/ and Completions/ subdirectories are validated against the Relax NG schemas. By default, the xmllint tool from libxml2 is used. Other tools can be selected by passing an option to the validate.sh script:
-jValidate using Jing.-vValidate using RNV-sValidate using XMLStarlet. This uses libxml2 under the hood, so the error messages are the same as those produced byxmllint.-rValidate against Relax NG schema usingxmllint(this is the default).-xValidate against XSD schema usingxmllint. Not recommended. The XSD schema is generated from the Relax NG original using Trang, and the translation is not without issues.
The xmllint tool comes with macOS, and the others are available in Homebrew. Jing and RNV tend to produce better error messages than the libxml2-based tools.
The *.rnc files contain the original schemas in the Relax NG compact syntax. The gen/ directory contains Relax NG XML syntax (*.rng) and W3C XML Schema Definition translations made with Trang.
After changing the original schemas, regenerate the translations by running:
% make -C genThis requires Trang to be installed. Get it from the jing-trang package in Homebrew:
% brew cask install homebrew/cask-versions/adoptopenjdk8
% brew install jing-trang