Visual studio code extension for BEL Nanopubs
- Validation against the BEL Nanopub JSONSchema
- Support for both JSON and YAML
- Snippets
- Syntax Highlighting
- Commands for converting between JSON and YAML
Snippets provided are:
!start
- starts a new nanopub document!nano
- creates a new nanopub stub!anno
- adds an annotation!assert
- adds an assertion!cite
- adds a citation
Commands can be run by first typing ctrl + shift + P
or cmd + shift + P
on macOS.
Commands provided are:
Convert to YAML
- converts the current document from JSON to YAMLConvert to JSON
- converts the current document from YAML to JSON
Note: When converting from an Untitled document, the command will overwrite the current file instead of creating a new one.
To install, search for this extension in the Extension Marketplace by going to the Extensions View () in VS Code searching for "BEL Nanopub".
-
For files to be validated against the BEL Nanopub JSONSchema, the file must be in either JSON or YAML and the file name must end with
nanopub
ornanopubs
with a suffix ofjson
,yaml
oryml
, ie.*nanopubs.json
,*nanopub.yaml
, ... -
Syntax highlighting will currently be applied to all JSON and YAML files regardless of file name.
-
To use snippets, the current file must be in either JSON or YAML, so any files ending in
.json
,.yaml
or.yml
will have access to the snippets.
To get started developing:
- Clone this repo.
- Go into the directory
- Run
npm install
- Conversion between JSON and YAML based upon openapi-lint