Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added command line utility to render templates; partials can be passed as a dictionary #31

Closed
wants to merge 3 commits into from

Conversation

vrde
Copy link

@vrde vrde commented Sep 13, 2011

Template __init__ now accepts the dictionary partials.
If partials is defined, templates will be loaded using the dictionary instead of the regular "file loader".
Those changes should be retro compatible.

I also added a command line utility to test/render templates.

Synopsis

usage: pystache [-h] template context

Render a mustache template with the given context.

positional arguments:
  template    A filename or a template code.
  context     A filename or a JSON string

optional arguments:
  -h, --help  show this help message and exit

@cjerdonek
Copy link
Collaborator

I'm going to create a second issue for passing partials as a dictionary so that it can be treated separately from the command-line utility part.

cjerdonek added a commit that referenced this pull request Dec 13, 2011
…lates..."

From: vrde@7667a95
Into: issue_31

Adds command-line script: pystache/commands.py
cjerdonek added a commit that referenced this pull request Dec 13, 2011
From: vrde@4c22f13
Into: issue_31

Added entry point to setup.py.  Skipped changes related to "partials can be passed
as a dictionary" because that was addressed as part of issue #47.

Conflicts:
	setup.py
cjerdonek added a commit that referenced this pull request Dec 14, 2011
@cjerdonek cjerdonek closed this Dec 14, 2011
cjerdonek added a commit that referenced this pull request Jan 9, 2012
The two test cases test, respectively, (1) context precedence and
(2) that section output not be rendered.  The two test cases were
originally proposed for inclusion in the Mustache spec test cases
in mustache/spec issues #31 and #32:

* mustache/spec#31
* mustache/spec#32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants