Command line tool to convert legacy SSI code into static HTML
SSI is a legacy templating format -- only use if you must.
- Install Homebrew and then install Java and Groovy:
$ brew install openjdk groovy
- Verify installs:
$ java --version
$ groovy --version
- Run the commands:
$ mkdir -p ~/apps/dsi
$ cd ~/apps/dsi
$ curl --remote-name https://raw.githubusercontent.com/center-key/dsi/main/dist/dsi.jar
$ curl --remote-name https://raw.githubusercontent.com/center-key/dsi/main/dist/run.sh
$ chmod +x ~/apps/dsi/run.sh
Verify your setup:
$ ~/apps/dsi/run.sh --version
Command format:
$ ~/apps/dsi/run.sh [SrcFolder] [Filename] [NewExt]
The parameters are optional.
Parameter | Description | Default Value |
---|---|---|
SrcFolder |
Specifies the location of the base HTML files and fragment HTML files. | . |
Filename |
The "file name" specifies the name of the base HTML file (ex: index.bhtml ). Wildcards ("*") are supported if quoted. |
"*.bhtml" |
NewExt |
The "new extension" specifies the file extension of the new files. | .html |
DestFolder |
Specifies the output location to save the resulting HTML files. | . |
Default command:
$ ~/apps/dsi/run.sh #convert .bhtml files to .html
Command to generate .jsp
files from src/*.bjsp
and save them to the public_html
folder:
$ ~/apps/dsi/run.sh src "*.bjsp" .jsp public_html
Supported page tags:
include
if
elif
else
endif
set
echo
See the Specification Suite in the spec folder for the syntax.