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 — Use correct block, enable built-in slash keypress by miketheman · Pull Request #141 · python/python-docs-theme

Conversation

@miketheman

@miketheman miketheman commented Jul 27, 2023

Copy link
Copy Markdown
Member

Includes a commit removing a duplicate block.

When the template was made responsive, the choice was made to override
the body_tag fragment.
The body_tag block is a literal <body> which allows the theme developer
to set properties on the body tag.
See: sphinx-doc/sphinx#4140

Instead, use the document block as documented.
https://www.sphinx-doc.org/en/master/development/templating.html#blocks

Overriding the correct block places the mobile-nav section after the
majority of the other HTML parts, which enables the correct function of
the / keyboard shortcut.

Resolves #130
Closes #131
Closes #135

Sorry, something went wrong.

Uh oh!

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

All reactions
miketheman added 2 commits July 27, 2023 12:30
@miketheman
chore: remove unnecessary responsive layout
44e62dd
The CSS in the base template was updated to include this directive in #7695
and released in sphinx v3.1.0.

The original implementation was in python#46, prior to the basic theme
including it, and now we have the same meta tag duplicated.

Remove the block, and reduce the duplication.

Signed-off-by: Mike Fiedler <[email protected]>
@miketheman
fix: override correct tag
788fee7
When the template was made responsive, the choice was made to override
the `body_tag` fragment.
The `body_tag` block is a literal `<body>` which allows the theme developer
to set properties on the `body` tag.
See: sphinx-doc/sphinx#4140

Instead, use the `document` block as documented.
https://www.sphinx-doc.org/en/master/development/templating.html#blocks

Overriding the correct block places the `mobile-nav` section _after_ the
majority of the other HTML parts, which enables the correct function of
the `/` keyboard shortcut.

Resolves python#130
Closes python#131
Closes python#135

Signed-off-by: Mike Fiedler <[email protected]>
@miketheman miketheman mentioned this pull request Jul 27, 2023
Enable search shortcuts #135
Closed
@miketheman

miketheman commented Jul 27, 2023

Copy link
Copy Markdown
Member Author

@hugovk I think this one is the thing we want!

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk

hugovk commented Jul 27, 2023

Copy link
Copy Markdown
Member

Thanks!

Preview: https://python-docs-theme-previews--141.org.readthedocs.build/en/141/

With this, slash highlights the search box in the top right in desktop view:

image

But not the one in mobile view:

image

Which is the more useful way around.

miketheman 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.

hugovk
hugovk approved these changes Jul 27, 2023
View reviewed changes
@hugovk
hugovk merged commit 0a7bf86 into python:main Jul 29, 2023
@miketheman
miketheman deleted the miketheman/layout branch July 29, 2023 10:33
This was referenced Aug 5, 2023
Docs: skip python-docs-theme 2023.7 to fix mobile menu python/cpython#107666
Merged
Mobile menu not working #144
Closed
This was referenced Aug 14, 2023
Make option to invert/modify colors for documentation pages #145
Closed
Revert "Use correct block, enable built-in slash keypress" #146
Merged
Focus search box when pressing slash #130
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Focus search box when pressing slash

Uh oh!

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

2 participants

@miketheman @hugovk
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.