Skip to main content

Python template engine.

Project description

Is a template engine built in completely other way then before.

First - you can use all python and more - you must use it if you want somwthing more then just tags.

Second - it completely iterative. You can feed iterators or generators as input and get iterative output.

Third - it works through imports. If you want to get template just import it and use. If you want include other template - import it. If you want template in some dir, import it! Like `from . import other_template`.

So, with this principles in mind, you can try this proof of concept thing, due it is not complete:

import backslant

sys.meta_path.insert(0, backslant.PymlFinder(‘./templates’, hook=’backslant_import’)) from backslant_import.home import index

for chunk in index.render(title=’The Real Thing’):

print(chunk)

And templates/home/index.bs:

html
head
title
  • yield options[‘title’]

body
div.content
h1

“Header”

I will complete feture set soon, stay tuned.

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

backslant-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

backslant-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file backslant-0.1.0.tar.gz.

File metadata

  • Download URL: backslant-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for backslant-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41bf752778a35b70279aa088742aa070de179ae0831a6e6955b224fcee5994c5
MD5 29052b47da6375330d5b8704925a6adb
BLAKE2b-256 2b37e7ce38a0248228abfa6435d4a382988fef2ad998b3239e22649e4ef9e37a

See more details on using hashes here.

File details

Details for the file backslant-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for backslant-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4e552cc85734d31e5d8a5704b29086e755b11e66931143aabb5948bb9a18785
MD5 9404a172b9055bff5d2943e0a4014584
BLAKE2b-256 08365fbe4bb936893efe311f7aac40c174d551e7b7ad20733505c3bf7e680f8f

See more details on using hashes here.

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