Giter VIP home page Giter VIP logo

texthon's Introduction

Texthon

Texthon is:

  • a template processing library
  • based on Python evals
  • focused on readability and template reuse
  • versatile, but made specifically for code generation

If that sounds interesting, visit http://texthon.chipsforbrain.org/

texthon's People

Contributors

kevinic avatar

Stargazers

Omotade Iluromi avatar RajaRaviVarma avatar Nickolay Bukreyev avatar  avatar pandyxu avatar Matthew Wooller avatar Bernd Meyer avatar Hugo Sena Ribeiro avatar Бранимир Караџић avatar

Watchers

Dhanasekaran Anbalagan avatar James Cloos avatar  avatar

Forkers

ribeyeco

texthon's Issues

Basic Python API Example

Hi, nice job.

One suggestion for docs, include one minimal Python API Example, the best example that I found is this, that isn't so simple since command has lot of params.

[]'s
Hugo

No such file or directory: ‘README.rst’

$ sudo pip2.7 install texthon
Downloading/unpacking texthon
  Running setup.py egg_info for package texthon
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip-build-root/texthon/setup.py", line 3, in <module>
        with open('README.rst') as file:
    IOError: [Errno 2] No such file or directory: 'README.rst'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/tmp/pip-build-root/texthon/setup.py", line 3, in <module>

    with open('README.rst') as file:

IOError: [Errno 2] No such file or directory: 'README.rst'

Python 2.7 on Linux 3.2.

Slurp whitespace at the end of template

The current $> slurp syntax is handy but it has some shortcomings:

  1. Usually, it's more convenient to strip trailing whitespace by default at the end of a template and to let the call site set the correct combination of whitespace and newlines.
  2. When a template ends with a compound directive there is no way to strip trailing whitespace, as $> won't work after #}. This can be done at the call site, but this is not possible for main as it's never explicitly called.

Stripping trailing whitespace by default won't be backward compatible, so I propose two simple changes:

  1. To add a configuration option to strip template trailing whitespace by default.
  2. To allow $> after #}.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.