Details on CALS Table Viewer development setup
Install NodeJS if it's not already installed
1. VS Code Extension Setup
Open in VS Code 1.47+
npm install
npm run watch
ornpm run compile
F5
to start debugging
2. Editing/Compiling XSLT in VS Code
This project uses XSLT and the SaxonJS XSLT processor to convert CALS tables to HTML that is shown in a VS Code WebView. SaxonJS uses a compiled form of XSLT. To generate this from the style-tables.xsl
source:
From the Command Palette, invoke Run Task
Select
Compile style-tables.xsl
from the task list
3. Technical Detail
Coding and Security
This extension uses the VS Code WebView API to render the CALS tables.
An HTML content security policy is used to ensure scripts can only access file system resources that are explicitly listed.
WebView Messages
The WebView and Visual Studio Code environment communicate in both directions via JSON messages. For example:
A message is sent to the WebView when the active editor changes
A message is sent from the WebView when an XSLT processing error is encountered