Skip to main content
https://travis-ci.org/TimKam/sphinx-pretty-searchresults.svg?branch=master

Sphinx: pretty search results

Sphinx: pretty search results is an extension for the Sphinx documentation tool.

To display search results, Sphinx is fetching the source files of search hits and rendering excerpts in raw markup (Example).

This extension removes the markup from these source files (during build time), so the search results look decent.

Installation

Run pip install sphinxprettysearchresults.

Configuration

After installing the extension, all you need to do is to register it.

Add sphinxprettysearchresults to the extensions array in your conf.py file, for example:

extensions = [
   'sphinxprettysearchresults'
]

After your next build, your project will no longer display raw markup in the search result excerpts.

Since version 1.5.0, Sphinx is adding the source file extension to the source files it includes in the output folder. For example, when your source file extension is rst (specified in the config variable source_suffix as [.rst], your index file appears in the output’s source folder as index.rst.txt. If you use a Sphinx version lower than 1.5.0, it appears as index.txt. Sphinx: pretty search results considers this difference and changes its behavior according to your Sphinx version. However, if you use a Sphinx theme that expects the old file names although you are using a later Sphinx version, you can fall back to the old file names by setting the following configuration variable:

use_old_search_snippets = True

Testing

Sphinx: pretty search results uses nose as its test framework.

To run the tests, you first need to install the dev dependencies:

pip install -r dev_requirements.txt

Then, navigate to the tests directory and run:

python run.py

Metadata

Release files for sphinxprettysearchresults 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxprettysearchresults 0.3.5
File Size Uploaded
sphinxprettysearchresults-0.3.5.tar.gz 4.4 kB Details

Release files / sphinxprettysearchresults-0.3.5.tar.gz

Download URL sphinxprettysearchresults-0.3.5.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bc1c306b5c2ceadb264d9daa880b2e7aab82322e9d4dd5f876ec62f4e173d369
BLAKE2b-256 checksum
How to use checksums
64f34ac2518dc6e1556240351d3d10d59ed315e65f64e8fa6289535af1be0a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.5 This release

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page