flexy-to-twig

1.0.10 • Public • Published

Flexy to Twig converter

This tool converts X-Cart 5 Flexy templates (original version is found on PEAR) to the Twig syntax.

Installation:

The recommended way is to install globally via:

npm install -g flexy-to-twig

Or install locally:

npm install flexy-to-twig

(in that case you will need to either run converter as ./node_modules/.bin/flexy-to-twig or somehow alter your PATH)

Usage:

flexy-to-twig example.tpl

The above command will print generated twig template contents to stdout. Redirect stdout to file to actually create a twig template file:

flexy-to-twig example.tpl > example.twig

To recursively convert all files starting from the skins subdirectory:

find skins/ -name '*.tpl' -exec bash -c 'file="{}" ; flexy-to-twig "{}" > ${file%.tpl}.twig' -- {}  \;

Instructions to modify & build:

The converter is based on Jison parser generator, the build process is automated with gulp. Install the npm dependencies and run gulp:

npm install
gulp

The source file for the flexy grammar is bundled with AST converter in flexy-to-twig.jison

Readme

Keywords

Package Sidebar

Install

npm i flexy-to-twig

Weekly Downloads

10

Version

1.0.10

License

ISC

Last publish

Collaborators

  • eng1neer