]> Devi Nivas Git - chevron.git/log
chevron.git
11 years agoAdded support for delimiters to be any size
noah morrison [Thu, 6 Nov 2014 22:25:05 +0000 (17:25 -0500)]
Added support for delimiters to be any size

Instead of needing them to be 2 characters.

Also ignores all spaces in the center (instead of expecting one).

And fixed a bug where delimiters would eat some trailing characters!

11 years agoAdded the parameter partials_dict to render
noah morrison [Thu, 6 Nov 2014 22:23:07 +0000 (17:23 -0500)]
Added the parameter partials_dict to render

partials_dict will be searched before the filesystem is.
It is an easy way to only use strings and not need the filesystem.

11 years agoUpdated unittests to deal with partials.
noah morrison [Thu, 6 Nov 2014 22:16:10 +0000 (17:16 -0500)]
Updated unittests to deal with partials.

11 years agoFixed python 2 StringIO bug
noah morrison [Thu, 6 Nov 2014 20:34:32 +0000 (15:34 -0500)]
Fixed python 2 StringIO bug

In python 2 strings were not being converted to StringIOs.

The new method assumes that template is a string and tries to convert
it to a StringIO. If that fails then it assumes a file-like object.

11 years agoFixed whitespace stripping
noah morrison [Thu, 6 Nov 2014 20:25:14 +0000 (15:25 -0500)]
Fixed whitespace stripping

In the last commit I changed how tag_key was being grabbed.
This broke the way that I was stripping the whitespace.
(whitespace from the front was staying)

11 years agoRemoved peek
noah morrison [Thu, 6 Nov 2014 02:47:05 +0000 (21:47 -0500)]
Removed peek

Peek had a lot of file-object calls that were not needed,
and was an easy removal.

11 years agoRemoved cgi import
noah morrison [Wed, 5 Nov 2014 02:30:36 +0000 (21:30 -0500)]
Removed cgi import

Made my own html escape function to replace the cgi import.

Also updated the test.mustache and data.json files to have an
escaped string get printed.

11 years agoRemoved the 3 from the readme
noah morrison [Mon, 3 Nov 2014 22:00:48 +0000 (17:00 -0500)]
Removed the 3 from the readme

As far as I'm aware this project works on python2 and python3.

If this is not true it is a bug.

11 years agoRename project to entei
noah morrison [Mon, 3 Nov 2014 21:57:20 +0000 (16:57 -0500)]
Rename project to entei

11 years agoFixed the bug from last night.
noah morrison [Mon, 3 Nov 2014 21:40:48 +0000 (16:40 -0500)]
Fixed the bug from last night.

Removed some leftover code from testing that messed things up.

11 years agoAdded some documentation
noah morrison [Mon, 3 Nov 2014 04:43:51 +0000 (23:43 -0500)]
Added some documentation

And fixed some pep8 problems.

also... the code seems to not be rendering right...
how long has that been happening?

11 years agoMade unit tests more descriptive
noah morrison [Sat, 1 Nov 2014 20:33:14 +0000 (16:33 -0400)]
Made unit tests more descriptive

11 years agoFixed Indented Multiline Standalone failure
noah morrison [Sat, 1 Nov 2014 20:30:28 +0000 (16:30 -0400)]
Fixed Indented Multiline Standalone failure

* Handle empty data
* Close file instead of EOFError
* Yield final literal

11 years agoAdded unit tests
noah morrison [Sat, 1 Nov 2014 19:43:19 +0000 (15:43 -0400)]
Added unit tests

11 years agoUpdated the README
noah morrison [Sat, 1 Nov 2014 19:24:53 +0000 (15:24 -0400)]
Updated the README

11 years agoAdded a render function
noah morrison [Sat, 1 Nov 2014 19:20:45 +0000 (15:20 -0400)]
Added a render function

Render takes a template and data dictionary and returns
a mustache rendered string.

Also updated the test.mustache and added a partial.mustache file.

11 years agoStopped tokenize from yielding comment tags
noah morrison [Sat, 1 Nov 2014 19:18:53 +0000 (15:18 -0400)]
Stopped tokenize from yielding comment tags

11 years agoFixed "no escape?" bug
noah morrison [Sat, 1 Nov 2014 17:23:51 +0000 (13:23 -0400)]
Fixed "no escape?" bug

Triple brace tags were yielding "no escape?" instead of "no escape".

11 years agoDRY'd the code some
noah morrison [Sat, 1 Nov 2014 16:50:26 +0000 (12:50 -0400)]
DRY'd the code some

Added a function to grab literals and tag keys,
since the code was very similar and in two places.

Also the grab_literal function is probably more efficent,
as it doesn't peek so much.

11 years agoAdded some documentation
noah morrison [Sat, 1 Nov 2014 16:49:53 +0000 (12:49 -0400)]
Added some documentation

Documented the tokenize function.

11 years agoUpdated README
noah morrison [Fri, 31 Oct 2014 20:42:03 +0000 (16:42 -0400)]
Updated README

11 years agoChanged tokenize to use file like objects
noah morrison [Fri, 31 Oct 2014 20:36:57 +0000 (16:36 -0400)]
Changed tokenize to use file like objects

tokenize now takes a file object (or file like object).
If tokenize is given a string it turns it into a file like object.

Also renamed look to peek.

11 years agoChanged sys import to just import argv
noah morrison [Fri, 31 Oct 2014 19:38:23 +0000 (15:38 -0400)]
Changed sys import to just import argv

11 years agoRemoved unnecessary custome exception
noah morrison [Fri, 31 Oct 2014 19:06:52 +0000 (15:06 -0400)]
Removed unnecessary custome exception

The custome exception EOF was not needed,
there is a built-in one called EOFError.

11 years agoAdded section detection
noah morrison [Fri, 31 Oct 2014 19:00:03 +0000 (15:00 -0400)]
Added section detection

Unclosed sections now raise an error

11 years agoFixed README.md syntax
noah morrison [Fri, 31 Oct 2014 18:39:31 +0000 (14:39 -0400)]
Fixed README.md syntax

11 years agoAdded nicer file targeting
noah morrison [Fri, 31 Oct 2014 18:35:43 +0000 (14:35 -0400)]
Added nicer file targeting

You can now specify the data and template files from the command line.
Also added a data.json file, even though it is currently unused.

11 years agoFixed the mustache file
noah morrison [Thu, 30 Oct 2014 22:06:35 +0000 (18:06 -0400)]
Fixed the mustache file

test.mustache was invalid, I forgot to close a tag and used html inside
the non html-escaped tags (instead of a json variable name).

11 years agoinitial commit
noah morrison [Thu, 30 Oct 2014 02:43:15 +0000 (22:43 -0400)]
initial commit