Replies: 4 comments 3 replies
-
You could use the |
Beta Was this translation helpful? Give feedback.
-
@purva-thakre Thanks for the suggestion. I tried playing around with If |
Beta Was this translation helpful? Give feedback.
-
@bdg221 Sphinx expects the table to be of a particular form. https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#tables The example docstring table in the function definition is copy-pasted from the function output directly where the formatting of columns/rows does not match with how sphinx expects you to format a table. There are several options on how you can format a table for sphinx:
I just tried the following and it works as expected: I am not too familiar with |
Beta Was this translation helpful? Give feedback.
-
Closing as this appears to be fixed by #2568. Feel free to reopen if we need to continue this discussion. |
Beta Was this translation helpful? Give feedback.
-
I am working on the calibration tables for the API docs that currently look like:
Is anybody familiar with a different/better way to have Sphinx retain whitespaces in a docstring?
I was able to get it working using:
This was the only way I was able to get it to work. The table has to be under
Example:
and the first line must start with>>>
. This puts a<pre>
tag around everything indented underExample
.Looking up more about how
>>>
is used, it turns out that it is part of doctest. While I don't think anybody is directly runningcalibrator.py
(with or without the -v), it is a bit of a hacky-use in this situation. I did think about including the command lines that generate the table, but it gets a bit tricky. Thelog_results_flat()
andlog_results_cartesian()
are applied to the results of running a calibrator which requires an executor and if we want the specific output in the docs, we would need custom settings. It does not make sense to me to put all of that in a docstring that's already pretty big due to the tables.Anybody have any other ideas?
Beta Was this translation helpful? Give feedback.
All reactions