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

Multi line strings? #5

Open
eldoy opened this issue Oct 17, 2021 · 4 comments
Open

Multi line strings? #5

eldoy opened this issue Oct 17, 2021 · 4 comments

Comments

@eldoy
Copy link

eldoy commented Oct 17, 2021

Any plans to finish this? Looks interesting. I would use it if there was support for multi line strings. Any idea how you'd want that to look?

@gilbert
Copy link
Owner

gilbert commented Oct 21, 2021

Hey @eldoy! I imagine python's multiline string syntax would do well:

project {
  title Add multiline strings
  descriptionHtml """
    This feature would be
    <b>great</b> to have.
  """
}

Triple quotes seem to be the least conflicting with any longer form text content one would want to write (unless you're writing python code within zaml, I suppose!). Perhaps most notably, it keeps clear of markdown and html.

The other aspect to consider is whitespace. As a developer, I would not want the above to convert to this...

"\n    This feature would be\n    <b>great</b> to have.\n"

The extra indentation whitespace would be annoying to deal with. By default, it should behave like Ruby's squiggly heredoc. The dedent package may be a solution for this.

@eldoy
Copy link
Author

eldoy commented Oct 21, 2021

@gilbert Yeah, that makes sense, it's also what TOML has. Agree about the white space, that is what annoys me with backtick strings in Javascript, indent should be visual only.

@gilbert
Copy link
Owner

gilbert commented Oct 24, 2021

Multiline strings are in! Let me know if you need a case I didn't cover.

@eldoy
Copy link
Author

eldoy commented Oct 24, 2021

@gilbert Oh nice, that was quick! I'll check it out. Thanks!

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