Skip to main content

textglue - An simple static template system

Project description

textglue

Text Glue

An extremely simple text based static templating system

Commands

  • textglue init - creates a minimal starter project.
  • textglue demo - creates a more complex demonstration project.
  • textglue render - builds the project.

About

textglue supports only two tags:

{{file:_body.html}} {{template:_body.html}}

The "file" tag includes the raw source of the file, while the template tag recursively evaluates the file as another template. By default, the maximum recurse depth for templates is 8.

Files with an underscore prefix are ignored unless used in a template. Files with a ".html" extension are rendered as a template, and files without an underscore prefix or ".html" extension, are directly copied to the output folder.

The textglue.json file lets you configure a source directory "src", an output folder "out", as well as the prefix for which files to ignore when rendering

Be careful!

The default input and output folders are "src" and the current directory ".". If the output is not the working directory, and the source and output folders are different, then 'textglue render' will delete the output folder every build.

Template Arguments or Variables

You can provide arguments to a text glue template, by adding the argument name and value separated by a colon after the template value.

{{template:./_href.html name:"Home Page" url:"/"}}

You can then use these arguments as variables within the template, by surrounding the argument name with double curly brackets and prefixing with the dollar sign: {{$arg}}

<a href="{{$url}}">{{$name}}</a>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textglue-0.0.8.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

textglue-0.0.8-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file textglue-0.0.8.tar.gz.

File metadata

  • Download URL: textglue-0.0.8.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for textglue-0.0.8.tar.gz
Algorithm Hash digest
SHA256 e4d387814737d09ae4b7be52235eeb8dcd4dd470000beffc6ca6201409da8177
MD5 ea33e59ea151be9994b6bb4b9b508415
BLAKE2b-256 fd6e3ebe155cdc972ddf2306624b6f3af2eda964a15dbfb276c22a41bc6a637a

See more details on using hashes here.

File details

Details for the file textglue-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: textglue-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for textglue-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 999ba86d8bdeff782287be854b9654fceabbfc54c2aafe360f7ae7409f8df10f
MD5 ecfdc7b2752e42ccf03f7f36a7ff9d25
BLAKE2b-256 c6bb9818a319adb7137da22037fcc9b7378bf63a1211a57f6fe46aa9fe91bdab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page