A minimal templating library for Dyalog APL that renders .aplp pages by substituting placeholder markers with values from a supplied APL namespace.
- Load and parse
.aplptemplate files containing HTML or text - Placeholder syntax:
<!--⋄ VariableName ⋄--> - Substitute markers with variables from a provided namespace (ctx)
- No external dependencies required
- Packaged for Tatin package manager
- Add
APLPageto yourapl-dependencies.txtor run:]tatin.InstallPackages APLPage
- Rebuild or reload your workspace to include the APLPage namespace.
-
Create or use an existing namespace as the template context. Assign any variables you want to inject:
ctx←⎕NS '' ⍝ Empty namespace ctx.Title←'My Site' ctx.UserName←'Alice'
-
Call the
GenPagefunction with your context and the path to a.aplpfile:html←ctx APLPage.GenPage 'APLPages/welcome.aplp'
-
Serve, display, or write the resulting
htmlstring as needed.
In your .aplp template files, insert markers where dynamic content should appear:
<h1><!--⋄ Title ⋄--></h1>
<p>Welcome, <!--⋄ UserName ⋄-->!</p>The GenPage function will replace each <!--⋄ Name ⋄--> with the text value of ctx.Name.
APLPage/
cider.config # Cider project configuration
apl-package.json # Tatin package descriptor
APLSource/
APLPage/
APLPage.aplc # Core GenPage implementation
This project is released under the MIT License.
Version 0.1.2