Caddy: Caddyfile support backtick strings

Created on 28 Apr 2019  路  14Comments  路  Source: caddyserver/caddy

1. What would you like to have changed?

Caddyfile support multi line string

2. Why is this feature a useful, necessary, and/or important addition to this project?

without supporting of multi line string, it's difficult to develop some new plugins which need user to configure some complex string such as json.

3. What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?

directive here_might_be_a_json

# now
directive here_json_file_path

4. Please link to any relevant issues, pull requests, or other discussions.

feature request

All 14 comments

If you approve this feature, I am willing to contribute

I believe the Caddyfile already supports multiline strings when enclosed in quotes.

@mholt I mean somthing like this:

`{
"name": "foo",
 "age": "bar",
}`

But now, we must do it like:

"
{\"name\":\"foo\",
\"age\":\"bar\"
}
"

Don't want to escape string

Ah, I see. So you want an alternate strings delimiter. Definitely possible.

Yes, it would be perfect if Caddyfile supports this

Feel free to submit a PR, I hope the implementation will not be too tricky!

Also consider if this could break anyone (I doubt it, but, worth considering.)

I'll try my best

@mholt what happen about this feature..? if not implemented yet can you explain me what we wan to do.

I dunno, I never got a PR from @caibirdme -- I don't have the time to do it right now but you're welcome to submit a PR for review.

@mholt can you explain what have to do. i mean which feature your expecting

As described above, I think multi-line strings delimited by ` is a good idea:

`{
"name": "foo",
 "age": "bar",
}`

@mholt im not able to understand for which scenario this will be usefull i mean when this type of object will come from whom (how to generate this scenario)

Implemented in #3242, will go out by Caddy 2.1.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kilpatty picture kilpatty  路  3Comments

jgsqware picture jgsqware  路  3Comments

wayneashleyberry picture wayneashleyberry  路  3Comments

mholt picture mholt  路  3Comments

muhammadmuzzammil1998 picture muhammadmuzzammil1998  路  3Comments