latte icon indicating copy to clipboard operation
latte copied to clipboard

The current default delimiters are terrible

Open raphaelreyna opened this issue 4 years ago • 5 comments

The default delimiters used by the Go templating engine are {{ and }}, but they clash with LaTeX.

LaTTe is currenlty using #! and !# but these are terrible in almost every way.

It'd be great to get some input on better delimiters.

raphaelreyna avatar Jan 26 '21 22:01 raphaelreyna

In a custom previous project of mine I used |@ and @| as delimiters and they worked well and didn't clash at all with LaTeX. I'm having trouble getting any delimiter other than the default to work though, for some reason. Have tried {{ }}, |@ @|, !- -! and replacement simply fails.

nermolov avatar Feb 03 '21 16:02 nermolov

The defaults also clash with LaTeX when editing, constantly get You can't use 'macro parameter character #' in internal vertical mode. as an error when compiling, Makes updating template files harder as I can't work on them with the template characters inserted.

nermolov avatar Feb 03 '21 16:02 nermolov

In a custom previous project of mine I used |@ and @| as delimiters and they worked well and didn't clash at all with LaTeX.

I like it, seems like a good default.

I'm having trouble getting any delimiter other than the default to work though, for some reason. Have tried {{ }}, |@ @|, !- -! and replacement simply fails.

Hmm... I just tried this and it worked just fine for me. Are there any error messages in the logs? Here's the curl command I just ran to test this:

curl -X POST -H "Content-Type: application/json" \
-d '{"template":"XGRvY3VtZW50Y2xhc3N7YXJ0aWNsZX0KXHRpdGxle0xhVFRlIFNhbXBsZSBEb2N1bWVudH0KXGJlZ2lue2RvY3VtZW50fQpcbWFrZXRpdGxlClRoZSBQeXRoYWdvcmVhbiBUaGVvcmVtOiAKJCB8QC5hQHwgXiAyICsgfEAuYkB8IF4gMiA9IHxALmNAfCBeIDIgJApcZW5ke2RvY3VtZW50fQo=", "details": { "a": "3", "b": "4", "c": "5" }, "delimiters": {"left": "|@", "right": "@|"}}' \
--output pythagorean.pdf "http://localhost:27182/generate"

The defaults also clash with LaTeX when editing, constantly get You can't use 'macro parameter character #' in internal vertical mode. as an error when compiling, Makes updating template files harder as I can't work on them with the template characters inserted.

Yeah, the current defaults are terrible.

raphaelreyna avatar Feb 03 '21 20:02 raphaelreyna

Oh turns out I just didn't spell delimiter correctly, sorry about that. Thank you!

nermolov avatar Feb 03 '21 21:02 nermolov

Oh turns out I just didn't spell delimiter correctly, sorry about that. Thank you!

No problem, I kept questioning my spelling of it while coding this lol.

Thanks for checking out LaTTe!

raphaelreyna avatar Feb 03 '21 22:02 raphaelreyna