-
Notifications
You must be signed in to change notification settings - Fork 819
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
WebHost: fix option doc indent #3513
Conversation
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.
Makes sense to me and works.
I checked a couple options pages I'm familiar with & some other random options pages to see if anything looks obviously messed up as well
Not an expert on whether it is "the best solution", but I do like that it matches the solution for yaml generation
@@ -196,7 +196,7 @@ | |||
{% macro OptionTitle(option_name, option) %} | |||
<label for="{{ option_name }}"> | |||
{{ option.display_name|default(option_name) }}: | |||
<span class="interactive" data-tooltip="{% filter dedent %}{{(option.__doc__ | default("Please document me!"))|escape }}{% endfilter %}">(?)</span> | |||
<span class="interactive" data-tooltip="{{(option.__doc__ | default("Please document me!"))|replace('\n ', '\n')|escape|trim}}">(?)</span> |
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.
This looks like it assumes PEP8 formatting. Can we be assured all worlds conform to PEP8, and if not, are we okay with the idea that worlds which don't conform to it might have borked tooltip text?
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.
What would it break on?
I think
"""stuff on a single line"""
"""First line not indented
Second line indented
"""
"""
First line indented
Second line indented
"""
All work with this.
But yeah I mean there could be something I'm missing. I'm pretty sure most, if not all worlds conform to one of these three though.
For the record, this is just the yaml template code but rewritten in Python, so actually, anything that breaks with this new change would break in yaml too, and I discovered this:
"""
underindented first line
"""
straight up fails unit tests because the template yaml cannot be generated.
* WebHost: fix option doc indent * Update macros.html
* WebHost: fix option doc indent * Update macros.html
* WebHost: fix option doc indent * Update macros.html
* WebHost: fix option doc indent * Update macros.html
What is this fixing or adding?
Apparently in the big option website revamp the rendering of option documentation diverged from how it is rendered to yaml. So this copy pastes and adapts the yaml filters for webhost, so they look the same/similar.
How was this tested?
localhost.
If this makes graphical changes, please attach screenshots.
Before:



After:
YAML: