-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add :indentation option to EEx #9724
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
Conversation
lib/eex/lib/eex.ex
Outdated
* `:file` - the file to be used in the template. Defaults to the given | ||
file the template is read from or to "nofile" when compiling from a string. | ||
* `:line` - the line to be used as the template start. Defaults to 1. | ||
* `:indentation` - (since v1.11.0) indentation to be added to each column. |
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.
It seems off to define an option using its name. Also I may be wrong, but I while internally it probably gets applied to each column in each line, I think lines are more important than columns here. How about:
* `:indentation` - (since v1.11.0) indentation to be added to each column. | |
* `:indentation` - (since v1.11.0) amount of spaces to be added before each line. |
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.
yeah, I'm not happy super happy with the wording either but fwiw we define e.g. :line
in terms of line :)
My first thought when I read your proposed wording is as if we somehow literally inject space characters before each line and thus adjust output but the option is about adjusting :column in the AST so that e.g. stacktraces would point to the exact spot where we e.g. call a function. (again, not saying that's what you meant but how I'd likely have interpreted it.)
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.
Right, someone could interpret it this way. Not sure how to improve it then, it could stay as is until someone else has a better idea.
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.
"an integer to be added to the column after every new line"?
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.
I went with:
* `:indentation` - (since v1.11.0) an integer added to the column after every
new line. Defaults to 0.
👍
❤️ 💚 💙 💛 💜 |
No description provided.