Skip to main content

A templating engine with a simple templating language specifically designed for type inference, allowing consumers to provide users with slots of determined types.

Project description

YATLA 📑: Yet Another Templating Language (Again!)

YATLA is a templating engine with a simple templating language specifically designed for type inference, allowing consumers to provide users with slots of determined types.

Roadmap 🗺️

  • Add numerical blocks
  • Add type inference. Go from a template -> list of typed parameters
  • Write own lexer to respect whitespace
  • Write own own parsing system
  • Add template validation (preventing non-unique identifiers...)
  • Publish as pip-installable package
  • Add foreach loops
  • Add numerical function calls
  • Improve Python interface
  • Think about object accessors

Sample Template

This sample template gives a whirlwind tour of YATLA's functionality.

This a sample template.

This line contains a {{ slot }}.

Slots can also contain mathematical expressions: {{ 3 + factor * 7 }}.
With full support for operator precedence: {{ (3 + factor) * 7 }}.

Foreach loops are also valid. For example:

This is the {{ factor }} times table:
{{ foreach num in num_list }}
    {{ factor }} * {{ num }} = {{ factor * num }}
{{ endforeach }}

There is also a standard library of mathematical functions.
Comparing {{ factor }} and {{ num }}, the largest is {{ Maximum(factor, num) }} and the smallest is {{ Minimum(factor, num) }}.
{{ RoundUp(15, 2) }} = 16, and {{ RoundDown(15, 2) }} = 14. 

From the template above, YATLA will identify the parameters in the template, and infer their types:

  • slot: string or number
  • factor: number
  • num: number
  • num_list: number array

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvement, please submit an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

YATLA is developed and maintained by Eugene Prout.

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

yatla-0.4.0.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

yatla-0.4.0-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

Supported by

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