How to add a feedback widget to Sphinx
Sphinx. Show Asklet below every page of a Sphinx site with one template override.
Your snippet looks like this HTML
<iframe
src="https://asklet.io/embed/s/YOUR-SITE-ID"
title="Feedback" width="100%" height="480"
loading="lazy" referrerpolicy="unsafe-url" style="border:0"></iframe>Steps
Copy your snippet
In Asklet, open your website and click Copy website snippet at the top.
Point Sphinx at a templates folder
In conf.py, set templates_path = ['_templates'] and create the _templates folder next to conf.py.
Override the page template
With Alabaster (the default) or the Read the Docs theme, create _templates/layout.html. With Furo, create _templates/page.html. Add the iframe after {{ super() }} (examples below).
Check it on your live site
Open a page you rebuilt on a domain you listed in Asklet and answer the survey. Your answer shows up in the website's results, like any reader's.
Your snippet looks like this
<iframe src="https://asklet.io/embed/s/<your-site>" title="Article feedback" width="100%" height="480" loading="lazy" referrerpolicy="unsafe-url" style="border:0"></iframe>- Keep referrerpolicy="unsafe-url" on the iframe - Asklet uses it to know which page the reader is on, so the right survey appears.
- The home page (index) skips the survey. Change the pagename check to leave out other pages, or remove it to ask everywhere.
- Furo describes template overrides as unstable and makes no promise to keep them working, so check the survey after each Furo upgrade.
- The html builder gives addresses like /guide/install.html, and dirhtml gives /guide/install/. Patterns match both: /guide/* covers one section.
Alabaster and the Read the Docs theme
Use the src from your own snippet. The ! in "!layout.html" loads the theme's own template, and {{ super() }} keeps the page as it was.
{# _templates/layout.html #}
{% extends "!layout.html" %}
{% block document %}
{{ super() }}
{% if pagename != "index" %}
<iframe src="https://asklet.io/embed/s/<your-site>" title="Article feedback" width="100%" height="480" loading="lazy" referrerpolicy="unsafe-url" style="border:0"></iframe>
{% endif %}
{% endblock %} Furo
Furo puts the page in its own page.html, so extend that instead.
{# _templates/page.html #}
{% extends "!page.html" %}
{% block content %}
{{ super() }}
{% if pagename != "index" %}
<iframe src="https://asklet.io/embed/s/<your-site>" title="Article feedback" width="100%" height="480" loading="lazy" referrerpolicy="unsafe-url" style="border:0"></iframe>
{% endif %}
{% endblock %} Common questions
Which Sphinx themes does this work with? We built both overrides with Sphinx 9.1: layout.html with Alabaster and the Read the Docs theme, and page.html with Furo. Other themes work the same way once you find the block that holds the page body in their templates.
Is there a Sphinx extension? No, and none is needed. A template override holds one iframe, so there is nothing to install or keep updated.
Will it slow down my docs? No. The iframe loads lazily, only when a reader scrolls near it, and it adds no script to your pages.
Other platforms
All integrationsGet your first answers today.
Set-up takes a few minutes, and the free plan covers one website or app.