KnitScript Runner
An extension for running KnitScript (.ks) files and compiling them to .k (knitout) and .dat files from directly within the file.
Features
- "Run" button in the editor title for .ks files
- Right-click option in Explorer for .ks files
- Automatic compilation to both .k (knitout) and .dat files
- Configurable Python path and output directory
- Automatic detection and prompting for python variables used in KnitScript files
- Option to enable/disable prompting for additional custom parameters
Requirements
- You must have the knit_script Python package installed
- Python must be in your PATH or configured in the extension settings
- You must have the "knitout-to-dat.js" or other compiler available in your working directory
Extension Settings
This extension contributes the following settings:
knitscriptRunner.pythonPath : Path to the Python executable (default: "python3")
knitscriptRunner.outputDirectory : Directory where output files will be saved (default: same directory as source)
knitscriptRunner.promptAdditionalParams : Whether to prompt for additional parameters beyond detected variables (default: true)
How to Use
- Open a .ks file in VS Code
- Click the play button in the editor title or right-click the file in Explorer and select "Run KnitScript File"
- Enter values for all variables expected in "pyargs" (and optionally additional ones, this can be toggled on/off in settings)
- The file will be compiled to both .k and .dat files
Release Notes
0.2.0
Initial release of KnitScript Runner.
License
This extension is licensed under the MIT License.
| |