-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add custom formatting to cli tessellate cmd #362
Conversation
I think it worth mentioning that this can be finally done:
|
@nical if you have time give it a try, you might end up writing some formatter that will fail. Also do you think the doc is enough? |
cli/README.md
Outdated
``` | ||
vertices: [@vertices{sep=, }{({position.x}, {position.y})}]\nindices: [@indices{sep=, }{{index}}] | ||
``` | ||
If you want to use `{` and `}` in the format string you have to write `\{` and `\}`, as normally `{}` groups mark a variable expension. Here's an example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, "expansion"
I love it! I'm almost able to do a json output ( Running into issues with I'm happy to land this as is and keep iterating on it unless you prefer to do some more polish before it host the master branch. |
I'll add at least |
Ok, I added A JSON like output with
|
Nice! Why is the trailing |
Basically, If the |
I see. It'd be nice to come back and simplify the syntax eventually, but the feature is already super cool in its current state so I'm happy to merge this as is (I'd merge it right now but there is still [wip] in the title so I am not sure whether you want to add more stuff). |
Add --format flag to tessellate subcommand. Update CLI readme. Closes nical#289
938edfb
to
204c6ad
Compare
I updated the README and squashed the commits. I thinks it's ok to merge (for) now. |
What's working:
Same output as before using the default format string.
Custom format strings which don't contain
{}
inside expansion blocks (so far) work as expected.Escaping
{}
in format string with\{
and\}
.For the future: