GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove superflous whitespaces in `layout.html`. by ezio-melotti · Pull Request #107067 · python/cpython

Conversation

@ezio-melotti

@ezio-melotti ezio-melotti commented Jul 22, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This came up in python/python-docs-zh-tw#496: after adding sphinx-lint to the CI workflow it reported 2 errors caused by trailing whitespace:

sphinx.po:295: trailing whitespace (trailing-whitespace)
sphinx.po:306: trailing whitespace (trailing-whitespace)

These are caused by two strings in sphinx.po (at line 299 and 313), that are taken from layout.html.

This PR remove those spaces from layout.html that should generate a .po without trailing whitespace and fix the issue, even though I wasn't able to test it.

The spaces after the <a>s don't create issues but shouldn't be there, whereas the ones before are the problematic ones and I think they can be removed since in both cases there is a newline, which -- once rendered -- should translate to a space before the link in the output.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mattwang44 reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@ezio-melotti
Remove superflous whitespaces in layout.html.
425b10f
@bedevere-bot bedevere-bot added the awaiting core review label Jul 22, 2023
@ezio-melotti
ezio-melotti requested review from CAM-Gerlach, JulienPalard and hugovk July 22, 2023 20:53
@ezio-melotti ezio-melotti added docs Documentation in the Doc dir skip issue skip news labels Jul 22, 2023
hugovk
hugovk approved these changes Jul 23, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

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.

Another option is to add a dash inside the brackets, something like read the {%- endtrans %} or read the {%- endtrans -%} (https://stackoverflow.com/a/57075716/724176), but this approach is fine too.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ezio-melotti reacted with eyes emoji
All reactions
  • 👀 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jul 23, 2023
@JulienPalard

JulienPalard commented Jul 23, 2023

Copy link
Copy Markdown
Member

Works as expected, tested using make htmlview SPHINXOPTS='-D html_context.outdated=1' and ./venv/bin/sphinx-build -b gettext -j8 -Dgettext_compact=0 . ../pot/.

ezio-melotti reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JulienPalard
JulienPalard approved these changes Jul 23, 2023
View reviewed changes
@JulienPalard
JulienPalard merged commit 956b3de into python:main Jul 23, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Jul 23, 2023
@ezio-melotti
ezio-melotti deleted the rm-ws-layout branch July 23, 2023 21:44
@ezio-melotti

ezio-melotti commented Jul 23, 2023

Copy link
Copy Markdown
Member Author

Thanks for the review and for testing it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mementum pushed a commit to mementum/cpython that referenced this pull request Jul 23, 2023
@ezio-melotti @mementum
Remove superflous whitespaces in layout.html. (pythonGH-107067)
f7825a6
carljm added a commit to carljm/cpython that referenced this pull request Jul 24, 2023
@carljm
Merge branch 'main' into superfix
9a6bdfa
* main: (73 commits)
  Thoroughly refactor the cases generator (python#107151)
  Docs: Add missing markup to Argument Clinic docs (python#106876)
  pythongh-107162: Document errcode.h usage in its comment (python#107177)
  pythongh-106320: Remove private _PyDict C API (python#107145)
  Fix PyVectorcall_Function doc versionadded (python#107140)
  Docs: Remove duplicate word in Argument Clinic howto heading (python#107169)
  pythongh-107017: Change Chapter Strings to Texts in the Introduction chapter. (python#107104)
  pythongh-106320: Remove private _PyObject C API (python#107159)
  Docs: fix typo in os.pwrite docstring (python#107087)
  pythongh-105291: Add link to migration guide for distutils (python#107130)
  pythongh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (python#107062)
  pythongh-106320: Remove _PyBytes_Join() C API (python#107144)
  pythongh-106320: Remove private _PyObject C API (python#107147)
  pythongh-106320: Remove _PyTuple_MaybeUntrack() C API (python#107143)
  pythongh-106320: Remove _PyIsSelectable_fd() C API (python#107142)
  Remove superflous whitespaces in `layout.html`. (pythonGH-107067)
  pythongh-107122: Update what's news for dbm.*dbm.clear() method (pythongh-107135)
  pythongh-107122: Add clear method to dbm.ndbm module (pythongh-107126)
  pythongh-62519: Make pgettext search plurals when translation is not found (python#107118)
  pythongh-107122: Add clear method to dbm.gdbm.module (pythongh-107127)
  ...
@mattwang44

mattwang44 commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

Thanks for fixing this issue!
I wonder if this PR will be backported to 3.11 or 3.12? It'd allow us to bring/sync this change into the sphinx.po of the downstream translation repos.

ezio-melotti reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ezio-melotti ezio-melotti added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jul 25, 2023
@miss-islington

miss-islington commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

Thanks @ezio-melotti for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

Thanks @ezio-melotti for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

This comment was marked as resolved.

Sign in to view
@miss-islington miss-islington assigned JulienPalard Jul 25, 2023
@miss-islington

This comment was marked as resolved.

Sign in to view
@ezio-melotti ezio-melotti mentioned this pull request Jul 25, 2023
[3.12] Remove superflous whitespaces in layout.html. (GH-107067) #107251
Merged
@bedevere-bot

bedevere-bot commented Jul 25, 2023

Copy link
Copy Markdown

GH-107251 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jul 25, 2023
@ezio-melotti ezio-melotti mentioned this pull request Jul 25, 2023
Add sphinx-lint to the ci workflow and Makefile. python/python-docs-zh-tw#496
Merged
@ezio-melotti

ezio-melotti commented Jul 25, 2023

Copy link
Copy Markdown
Member Author

This was also backported to 3.11 in #107252
Both PRs include a change from #104100 that fixes the problem that was causing the conflict.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity ZeroIntensity removed the needs backport to 3.11 only security fixes label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JulienPalard JulienPalard JulienPalard approved these changes
@hugovk hugovk hugovk approved these changes
@CAM-Gerlach CAM-Gerlach Awaiting requested review from CAM-Gerlach

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@JulienPalard JulienPalard

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@ezio-melotti @JulienPalard @mattwang44 @miss-islington @bedevere-bot @hugovk @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.