Better Neoweb
Editor support for Neoweb literate programming: syntax highlighting for .nw files,
block bodies coloured by the language they are wired into, completion, and a
return-key convenience.
What it does
- Structure: chunk headers, references,
dir / file wiring, !! namespaces, ~@, ~::,
%% comments, @todo — colours come from your editor theme
- Block bodies: a chunk wired into
file<c> is read as C, file<py> as Python, and so on
- Semantic highlighting: one more layer on top of TextMate — prose, code, comment
- Completion: chunk names already defined in this document, offered inside
<<
- Return key: at the end of a chunk header, inserts an indented line and a matching
~@
Install
Search Better Neoweb in the marketplace (extension id random25160765-collab.nw).
Offline, from a VSIX (the file name is nw-<version>.vsix):
code --install-extension nw-0.2.0.vsix
For development you do not need to package anything — symlink the directory instead:
make ext
Dependencies
Block-body colouring needs three Node packages: vscode-textmate, vscode-oniguruma
and tm-grammars. This repository ships no node_modules, so run once:
make deps
Without them nothing breaks as a whole: highlighting, completion and the return-key
behaviour still work, block-body colouring is skipped, and a message tells you what is missing.
Relationship to nw
The extension does not parse .nw. It only displays and types. Structure is settled by
nw tangle --check, which reads and reports without writing a byte; nw tangle is what writes:
What looks right in the editor is not necessarily tangleable; being tangleable is what counts.