Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Decently styled search results for sphinx-doc projects

Project Description

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.


Run pip install sphinxprettysearchresults.


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

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

extensions = [

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


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:


Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(4.2 kB) Copy SHA256 Hash SHA256
Source None Feb 23, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers