sphinx-doc / sphinx-doc/sphinx

Customizing hideSearchWords in doctool.js

Open
#8,768 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

html theme type:enhancement
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Hello! When writing a custom theme, what is the recommended way to edit the code generated by hideSearchWords in the function below?

https://github.com/sphinx-doc/sphinx/blob/241577f65eea94a08944bf096bd704b495282373/sphinx/themes/basic/static/doctools.js#L238

The use case is, for instance, adding a button or customize the text and wrapping it in some fields matching the rest of the theme. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with sphinx/themes/basic/static/doctools.js at the hideSearchWords function around line 238, then review how custom themes are expected to override generated code. Determine whether an existing customization entry point supports adding a button and changing the text and wrapping fields; done means documenting or defining a clear supported approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.