https://github.com/eventbrite/cs2mako
Clearsilver to Mako converter
https://github.com/eventbrite/cs2mako
Last synced: 3 months ago
JSON representation
Clearsilver to Mako converter
- Host: GitHub
- URL: https://github.com/eventbrite/cs2mako
- Owner: eventbrite
- License: mit
- Created: 2014-05-22T18:40:21.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-05-17T19:06:25.000Z (about 2 years ago)
- Last Synced: 2023-05-17T19:27:51.551Z (about 2 years ago)
- Language: Python
- Size: 12.7 KB
- Stars: 0
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
=======
cs2mako
=======**cs2mako** is set of Python code that is used as a script to convert
your Clearsilver templates to Mako. It was purpose built, and intended for
one-time use. Once you use it to convert your templates, you will likely
need to hand-fix the output templates to make them work in your environment.This repository is not currently maintained, as we no longer need it! (We
already converted our templates.)LICENSE
=======Feel free to fork this repository, but note that this software is shared under
the MIT license. In particular, we require that the attribution remain intact.Usage
=====Call cs2mako with no arguments to get this amazing help text:
$ cd cs2mako
$ python cs2mako
No filename specified.
Usage cs2mako [-o ] [--nointl] [--noconv]The converted Mako files will still reference variablees in "hdf" dot notation:
${ hdf.variable.named.like.this }
You will want to replace hdf with the included hdf_emulator.py. Then over time
you can replace variables being set as emulated hdf to be some proper Python objects.
In Eventbrite's case, we use Django, so we follow Django context passing conventions.About
=====**cs2mako** is a streaming tokenizer, LR(1) parser, and code-generator.
It uses Python generators to emulate a threaded message-passing environment.There are some rudimentary unit-tests, which should give you an idea of how **cs2mako** works.