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

Booleans (true|false) are rendered as Python booleans (True|False) #101

Open
ricanontherun opened this issue Aug 3, 2021 · 3 comments
Open

Comments

@ricanontherun
Copy link

ricanontherun commented Aug 3, 2021

Given the follow template and data file:

template.mustache

true={{true-value}}
false={{false-value}}

data.json

{
  "true-value": true,
  "false-value": false
}

I receive the following output:

$ chevron -d data.json template.mustache
true=True
false=False

In my opinion, this should not work this way, booleans should be rendered in supported JSON format (true|false)

@dcmoore-gd
Copy link

Interesting. The chevron tool understands JSON as a data input format, but I don't believe there's any JSON support for output. I think it's all just text really other than the HTML escaping functionality.

@ricanontherun
Copy link
Author

The way I see it, input (true|false booleans) should not be transformed into something else (True|False booleans) on output. If you agree, and are looking for some help ... I'd be willing contribute a patch for this. Let me know!

@dcmoore-gd
Copy link

I think the only way to do that reliably in something like Mustache is to do those imports as strings instead of booleans.

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

No branches or pull requests

2 participants