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.7.tar.gz (7.1 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.7-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: textglue-0.0.7.tar.gz
  • Upload date:
  • Size: 7.1 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.7.tar.gz
Algorithm Hash digest
SHA256 936f7f7070e06903ab2556152030d23cf66ce9205c237345c3a9fa571c99663a
MD5 c5d70c2612ce7101490d9c447e269099
BLAKE2b-256 81941df6b0de74d6a87a20307090e67a2c814f756d4494fc4b28d969a26ff961

See more details on using hashes here.

File details

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

File metadata

  • Download URL: textglue-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b65f17719aa60149e44a3dacbb0856e605e902f6f14e5bc6abd31d5dce27467d
MD5 70b23b106a6c82596ec0de2410b18501
BLAKE2b-256 c7e77745677627ab4610ef887122d8d10fa041455f70a9db618394b4cc14eba3

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