Skip to content

Bombardier-C-Kram/APLPage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

APLPage

A minimal templating library for Dyalog APL that renders .aplp pages by substituting placeholder markers with values from a supplied APL namespace.


Features

  • Load and parse .aplp template 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

Installation

Via Tatin (APL package manager)

  1. Add APLPage to your apl-dependencies.txt or run:
    ]tatin.InstallPackages APLPage
  2. Rebuild or reload your workspace to include the APLPage namespace.

Usage

  1. 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'
  2. Call the GenPage function with your context and the path to a .aplp file:

    htmlctx APLPage.GenPage 'APLPages/welcome.aplp'
  3. Serve, display, or write the resulting html string as needed.

Placeholder Syntax

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.

Directory Structure

APLPage/
  cider.config         # Cider project configuration
  apl-package.json     # Tatin package descriptor
  APLSource/
    APLPage/
      APLPage.aplc     # Core GenPage implementation

License

This project is released under the MIT License.


Version 0.1.2

About

A simple HTML template library for Dyalog APL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published