python-sphinx

How to output a custom static file in Sphinx?

北战南征 提交于 2021-02-05 06:01:29
问题 Using Sphinx, one can include static files in the _static folder of the build output. How could I copy a static file to the root of the build folder? Background: I'm hosting the output of a Sphinx project in Azure App Services, and because of a mp4 video in a few pages, I need a "web.config" file with the following entry: <staticContent> <mimeMap fileExtension=".mp4" mimeType="video/mp4" /> </staticContent> I need Sphinx to include the web.config in the root of the build folder. 回答1: Use html

How to output a custom static file in Sphinx?

倾然丶 夕夏残阳落幕 提交于 2021-02-05 06:01:20
问题 Using Sphinx, one can include static files in the _static folder of the build output. How could I copy a static file to the root of the build folder? Background: I'm hosting the output of a Sphinx project in Azure App Services, and because of a mp4 video in a few pages, I need a "web.config" file with the following entry: <staticContent> <mimeMap fileExtension=".mp4" mimeType="video/mp4" /> </staticContent> I need Sphinx to include the web.config in the root of the build folder. 回答1: Use html

Sphinx does not recognize subfolders

若如初见. 提交于 2021-02-05 03:20:33
问题 I'm new in using Sphinx . I'm able to create HTML documentations as long as my files are in the source top folder. As soon as I'm putting them in a subfolder in the source directory , Sphinx does not include the document into the build. Sphinx tells me after generating that the test document is not included. So, it sees the file but does not include it. Did I miss anything? Do I have to specify any subfolders in the index.rst file or in the config.py ? My index.rst file: Welcome to python

Markdown output for Sphinx based documentation [closed]

ぃ、小莉子 提交于 2021-02-04 09:19:08
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Improve this question I found myself with a use case, where in addition to generating HTML and PDF from my Sphinx based documentation sources, I would also like to generate a Markdown version of the reStructuredText source files. My preliminary research didn't find any core or

How to remove bullets from numbered toctree in restructured text?

给你一囗甜甜゛ 提交于 2021-02-04 08:07:25
问题 I am using a toctree in Sphinx to automatically generate a table of contents for a webpage. .. toctree:: :maxdepth: 2 :numbered: First Second Third which creates (roughly): First Second Third I want the numbers, but I don't want the bullets. Is there some magic I'm missing that gives me the enumerated list without the bullets? 回答1: That's a minor annoyance which can be corrected with a custom style. .toctree-wrapper ul li { list-style-type: none; } To override the default style sheet, you can

Custom role to link PDF file as static content

喜你入骨 提交于 2021-01-29 10:51:19
问题 I am trying to write a custom role for Sphinx to allow linking to PDF files that are then displayed in the browser (rather than being downloaded when using the :download: role). I have got as far as a role that creates a link to the PDF file: :pdf:`Document Title <pdf/document.pdf>` generates something like: <a href="pdf/document.pdf>Document Title</a> However, I don't know how to get Sphinx to copy the pdf directory to the output directory. Is this possible? 回答1: Use html_static_path in your

genindex and modindex footer links don't work in readthedocs.io

纵饮孤独 提交于 2021-01-29 06:49:46
问题 I have a Python project using Sphinx for docs. I am building the docs remotely on readthedocs.io service. I used sphinx-quickstart and it generated an index.rst file with these links in the footer: Indices and tables ~~~~~~~~~~~~~~~~~~ * :ref:`genindex` * :ref:`modindex` * :ref:`search` When I push changes to readthedocs.io and build the docs, my build succeeds. Docs that I manually linked via toctree directive all work fine. The search link works fine. But the genindex link goes to an empty

Why no search result for the cjk(chinese) word in python's documentation generator--sphinx search bar?

好久不见. 提交于 2021-01-29 06:04:00
问题 I build a simple project which contain only one article,the title is yahoo股票历史数据下载 ,and the file yahoo股票历史数据下载.rst ,only contain one sentence 问题:为何可以通过浏览器下载yahoo股票历史数据,无法使用wget curl下载? String in english can be searched. To search cjk(chinese) word "股票" with grep command. grep -n -r "股票" myproject /source/research/yahoo股票历史数据下载.rst:yahoo股票历史数据下载 /source/research/yahoo股票历史数据下载.rst:问题:为何可以通过浏览器下载yahoo股票历史数据,无法使用wget curl下载? /build/html/research/yahoo股票历史数据下载.html: <title>1. yahoo股票历史数据下载 —

Sphinx documentation: translation (i18n) of conf.py variables

二次信任 提交于 2021-01-29 02:50:40
问题 In a sphinx documentation project, how to add translations to the variables defined in conf.py ? Case in point: The project Variable is "<Brand Name> Setup and Configuration Manual" , where I would like to have the latter part translated. Using the standard i18n facilities, those values are missing from the .pot files. I also could not find out how to get at the commandline-specified language within conf.py (to translate via hardcoded dictionary). 回答1: As mentioned in the comments above, this

Can I remove the “src” package from python doc generated with sphinx?

 ̄綄美尐妖づ 提交于 2021-01-28 14:37:00
问题 I have a python project and a structure like this project |-- doc |-- src |-- mod_1.py | |-- Class1 |-- package1 |-- mod_2.py |-- Class2 I used sphinx-apidoc to create my documentation and the path to my submodules look like this src.mod1 src.package2.mod2 Now I wonder, if there is a way to remove the src prefix? To make the path look like this mod1 package2.mod2 回答1: After raising an issue at GitHub sphinx #3113, shimizukawa came up with a solution: Remove __init__.py from src folder Set