Skip to main content

Template Engine for HTML

Project description

Fox Template Engine Manual

Install

  1. Open your project in terminal
  2. activate virtual env
  3. Input 'pip install foxTemplateEngine'

How to use?

from foxTemplateEngine.template_engine import transform # transform() is a func for render your template to vanilla HTML

transform('test', {}) # test - path to your file, {} - context

Example

Before (project/test)

body
 % repeat 4 %
 h1
  {{ context['var'] }}
   START LOOP
   % repeat 2 %
   LOOOOOOOP
   % end %
   END LOOP
 .h1
 % end %
.body

Start this code

from foxTemplateEngine.template_engine import transform

transform('test', {
  'var': 'Hello, World!',
})

After (project/test.html)

<body>
 <h1>
  Hello, World!
   START LOOP
   LOOOOOOOP
   LOOOOOOOP
   END LOOP
 </h1>
 <h1>
  Hello, World!
   START LOOP
   LOOOOOOOP
   LOOOOOOOP
   END LOOP
 </h1>
 <h1>
  Hello, World!
   START LOOP
   LOOOOOOOP
   LOOOOOOOP
   END LOOP
 </h1>
 <h1>
  Hello, World!
   START LOOP
   LOOOOOOOP
   LOOOOOOOP
   END LOOP
 </h1>
</body>

See tests for a better understanding of how the package works!

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

foxTemplateEngine-1.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

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