sphinx-doc / sphinx-doc/sphinx

Download link displays output in browser instead of downloading.

Open
#11,023 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Adding a downlod role to download a notebook successfully create the download ling in the generated dosc. However clicking on the link simply displays the notebook in the browser instead of downloading the notebook file.

How to Reproduce

========
ls -l docs/notebooks
total 64
-rw-rw-r-- 1 paul paul 326 Dec 9 17:46 index.rst
-rw-rw-r-- 1 paul paul 199 Dec 9 17:52 Manage_Credentials_download.rst
-rw-r--r-- 1 paul paul 6065 Dec 9 17:15 Manage_Credentials.ipynb

=======
cat docs/notebooks/index.rst:
.. _notebooksref:

Note Books

.. toctree::
:maxdepth: 2
:caption: Contents:

Manage_Credentials
Manage_Credentials_download

======
cat docs/notebooks/Manage_Credentials_download.rst
.. _managed_credentials_downloadref:

Manage_Credentials Download

.. only:: builder_html or readthedoc

See :download:Manage Credentials <Manage_Credentials.ipynb>.

Environment Information

sphinx-build --bug-report Please paste all output below into the bug report template text Platform: linux; (Linux-6.0.6-76060006-generic-x86_64-with-debian-11.5) Python version: 3.7.15 (default, Oct 26 2022, 04:14:11) [GCC 10.2.1 20210110]) Python implementation: CPython Sphinx version: 5.3.0 Docutils version: 0.17.1 Jinja2 version: 3.1.2

Sphinx extensions

No response

Additional context

No response

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 docs/notebooks/index.rst and docs/notebooks/Manage_Credentials_download.rst, then reproduce the behavior with sphinx-build using the reported notebook download role. Check the generated HTML link and browser behavior; done means clicking the link downloads Manage_Credentials.ipynb instead of displaying it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.