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

Rename html_last_updated_time_zone to html_last_updated_use_utc #12958

Merged
merged 3 commits into from
Oct 5, 2024

Conversation

AA-Turner
Copy link
Member

Renamed per @mgeier's suggestion

xref #12907 (comment)

A

Copy link
Contributor

@mgeier mgeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed per @mgeier's suggestion

For the record, I didn't suggest to rename it, I suggested to allow specifying arbitrary time zones, similar to what I'm doing in https://github.com/mgeier/sphinx-last-updated-by-git.

The renaming suggested by @AA-Turner is still an improvement, it makes the config value more consistent and less confusing!

BTW, while testing this, I found that the docs for html_last_updated_fmt are wrong: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_last_updated_fmt

They say "Default: '%b %d, %Y'", but the default is actually None:

app.add_config_value('html_last_updated_fmt', None, 'html', str)

@AA-Turner
Copy link
Member Author

Fixed: 86531ab.

A

# Conflicts:
#	sphinx/builders/html/__init__.py
@AA-Turner
Copy link
Member Author

I suggested to allow specifying arbitrary time zones

I'm open to this in the future, but I prefer avoiding the 'fun' of tzdata, zoneinfo, etc etc unless there is demonstrable demand -- as the docs note, this is only really useful for when the format used with html_last_updated_fmt contains the time rather than just the date.

A

@AA-Turner AA-Turner merged commit 4c638d8 into sphinx-doc:master Oct 5, 2024
22 of 23 checks passed
@AA-Turner AA-Turner deleted the config/html-tz branch October 5, 2024 15:34
@mgeier
Copy link
Contributor

mgeier commented Oct 5, 2024

this is only really useful for when the format used with html_last_updated_fmt contains the time rather than just the date.

I find it strange when a site author chooses to display the time of day. I cannot imagine a situation where I as a reader want to know the exact second when the site was updated. To me a one-day resolution is plenty.

The reason why I implemented time-zone selection in my extension is the (hypothetical, never asked for) scenario where a company in New Zealand builds their docs on a server that's set to UTC (which e.g. Github Actions and RTD and probably many others are). When they make an edit in the morning, they get a different date than when they make an edit on the same day in the afternoon. So this (hypothetical) problem also appears if only the date is displayed.

But as I said, nobody has asked for that.

@AA-Turner
Copy link
Member Author

We display the time of day on docs.python.org because we have regular rebuilds (~twice daily) instead of per-commit and it's useful to see how up-to-date it is. But a niche use-case.

A

@AA-Turner AA-Turner added this to the 8.1.x milestone Oct 6, 2024
@mgeier
Copy link
Contributor

mgeier commented Oct 13, 2024

But a niche use-case.

More importantly, this seems like something that's only interesting to a site maintainer and it delivers no value to a user, right?

You are basically bragging how often you run your CI. That's fine if that's important to you.

If you want something more user-focused, you can try my extension https://github.com/mgeier/sphinx-last-updated-by-git.
You can use that one to brag how often you touch individual documentation pages, which is arguably a greater feat.

@AA-Turner
Copy link
Member Author

I agree it's of more interest to site maintainers, yes. Though it started because CI ran ~every two days, so not something to brag about!

A

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants