python-sphinx

Making Sphinx detect changes to auxiliary configuration/template files

你说的曾经没有我的故事 提交于 2019-12-23 17:36:41
问题 I'm using Sphinx (v1.4.9, with Python 3.5.1 on Windows 7, 64-bit) to write a document set with MathJax enabled. I wanted to define custom LaTeX commands to clean up my source, so I implemented this approach by adding _templates\layout.html : {% extends "!layout.html" %} {% set script_files = script_files + ["_static/mjconf.js"] %} and defining my custom commands in _static\mjconf.js : MathJax.Hub.Config({ TeX: { Macros: { dsetarr: ['{\\small \\textsf{#1 Array } \\mathsf{(#2)} }', 2], dsettype

sphinx autodoc include subfunctions

白昼怎懂夜的黑 提交于 2019-12-23 14:40:52
问题 I want to automatically include subfunctions of a function in the sphinx documentation. What is the option for this? My code looks like import numpy def mainfunc(): """ to be documented """ def subfunc(): """ to be documented as well """ By now I set in the included code.rst Code Reference ============== .. automodule:: lqgbt_lnse :members: But the output by sphinx includes only the mainfunction. 来源: https://stackoverflow.com/questions/22451195/sphinx-autodoc-include-subfunctions

sphinx autodoc include subfunctions

风流意气都作罢 提交于 2019-12-23 14:40:19
问题 I want to automatically include subfunctions of a function in the sphinx documentation. What is the option for this? My code looks like import numpy def mainfunc(): """ to be documented """ def subfunc(): """ to be documented as well """ By now I set in the included code.rst Code Reference ============== .. automodule:: lqgbt_lnse :members: But the output by sphinx includes only the mainfunction. 来源: https://stackoverflow.com/questions/22451195/sphinx-autodoc-include-subfunctions

Javascript API documenting framework with lightweight mark-up

丶灬走出姿态 提交于 2019-12-23 14:07:21
问题 I'm seeking a Javascript API documenting framework with features similar to JSDoc, but would use easy-to-type restructured text or markdown in the code comments (not html) Bonus: would integrate well with Sphinx. However, I don't want to maintain separate documentation, but generate API documentation from comments. http://code.google.com/p/jsdoc-toolkit/ 回答1: I finally found JSDuck the most suitable for the task: https://github.com/senchalabs/jsduck 回答2: InvisibleJS supports markdown and a

Javascript API documenting framework with lightweight mark-up

放肆的年华 提交于 2019-12-23 14:04:49
问题 I'm seeking a Javascript API documenting framework with features similar to JSDoc, but would use easy-to-type restructured text or markdown in the code comments (not html) Bonus: would integrate well with Sphinx. However, I don't want to maintain separate documentation, but generate API documentation from comments. http://code.google.com/p/jsdoc-toolkit/ 回答1: I finally found JSDuck the most suitable for the task: https://github.com/senchalabs/jsduck 回答2: InvisibleJS supports markdown and a

Python: How I can define in sphinx which .rst files and directories should be used?

帅比萌擦擦* 提交于 2019-12-23 13:12:39
问题 How I can define in sphinx which .rst files and directories should be used? I want to include an automatic documentation generator in my testing/building/documentation script. sphinx-quickstart was executed in my workspace and created an index.rst-file. As sphinx uses restructured text files for documentation I navigated through the workspace and create them manually with sphinx-autogen . It resulted into the tasks.rst file (see below). When I use 'make html' I get several warnings: WARNING :

How do I conditionally include a file in a Sphinx 'toctree'? [duplicate]

会有一股神秘感。 提交于 2019-12-23 10:06:32
问题 This question already has answers here : Conditional toctree in Sphinx (4 answers) Closed 4 years ago . I would like to include one of my files in my Sphinx TOC only when a certain tag is set, however the obvious approach fails: .. toctree:: :maxdepth: 5 index core utils oec plotting install news glossary .. only:: private_version todo Is there a simple way to accomplish this? 回答1: In a past I had a need to be able to compile two documentations from the same source file: a public and a

Sphinx is not able to import anything

一曲冷凌霜 提交于 2019-12-23 09:43:15
问题 I am trying to use sphinx to document a project of mine. I have used autodoc strings within all of my modules and files. I used sphinx-apidoc to automatically generate rst files for my code. So far, so good. The problem is that sphinx is not able to import any of my modules , even though I have added my project to sys.path . My unit tests pass and can import my modules just fine. I'm kind of at my wit's end; I've tried all sorts of renaming and moving and reloading and reconfiguring without

Python 3: Sphinx doesn't show type hints correctly

为君一笑 提交于 2019-12-23 08:39:40
问题 I am generating a HTML documentation of a Python 3 module automatically from its reStructuredText docstrings of its functions by using Sphinx (make HTML). The generated HTML documentation looks fine so far, but the parameter types of the function signatures, which are given in the source code as PEP484 type hints aren't shown correctly. E.g. this is some example output from the Sphinx-generated HTML doc of one of my functions: static parse_from_file(filename: str) → list Parses stuff from a

How to force non-breaking space in reStructuredText, in code environment?

夙愿已清 提交于 2019-12-23 08:35:42
问题 I have this snippet in my reStructuredText document: 1. Find the file at ``~/Google Drive/code/mac/install.sh``. Notice the code/quote environment. Notice the space between Google and Drive in the path. When rendered with Sphinx in HTML, there is a line-wrap between Google and Drive , and the space is gone. (Since this is documentation, I need everything in the code environment to appear to the user exactly as it is entered, which includes the space between 'Google' and 'Drive'. Not only