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

WebHost: fix option doc indent #3513

Merged
merged 2 commits into from
Jun 13, 2024
Merged

Conversation

Berserker66
Copy link
Member

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:
image
After:
image
YAML:
image

@github-actions github-actions bot added affects: webhost Issues/PRs that touch webhost and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jun 12, 2024
@LegendaryLinux LegendaryLinux self-assigned this Jun 12, 2024
Copy link
Member

@NewSoupVi NewSoupVi left a 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

@Exempt-Medic Exempt-Medic added the is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. label Jun 12, 2024
@@ -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>
Copy link
Member

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?

Copy link
Member

@NewSoupVi NewSoupVi Jun 13, 2024

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.

@LegendaryLinux LegendaryLinux merged commit e9ad7cb into main Jun 13, 2024
19 checks passed
@Berserker66 Berserker66 deleted the webhost_option_doc_indent branch June 13, 2024 21:45
sflavelle pushed a commit to sflavelle/Archipelago-tgc that referenced this pull request Jun 20, 2024
* WebHost: fix option doc indent

* Update macros.html
qwint pushed a commit to qwint/Archipelago that referenced this pull request Jun 24, 2024
* WebHost: fix option doc indent

* Update macros.html
GameWyrm pushed a commit to GameWyrm/Archipelago-GW that referenced this pull request Jul 4, 2024
* WebHost: fix option doc indent

* Update macros.html
AustinSumigray pushed a commit to AustinSumigray/Archipelago that referenced this pull request Jan 4, 2025
* WebHost: fix option doc indent

* Update macros.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: webhost Issues/PRs that touch webhost and may need additional validation. is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants