The current implementation of ``sphinx.ext.coverage`` outputs which
methods,classes, and functions are documented.
This commit adds a short summary of this report in terms of
``documented objects / total number of objects``,
both per module and total.
The purpose of this is to support
a currently not mainstream but relevant use-case:
a coverage report on the number of objects that are documented.
By having the statistics on the report or on the stdout,
a regex expression can capture the coverage percentage
(e.g. ``re.search(r'TOTAL.*?([0-9.]{4,6}\%)', d).group(1)``)
and use it e.g. in another report, a status badge, etc.
Two options were added to the configuration to allow a table
to be printed in the report and/or to stdout.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This is for the table of the Websupport.get_data() auto-documentation.
Somethink similar perhaps \setlength{\tymin}{1.5cm} at least could be a
global default; the only reason we have not changed it yet is that
perhaps some tables in user projects use really short contents such as
letter.
(what we would want to avoid is narrow columns allowed by hyphenation of
single words; maybe some thinking needed here as \sphinxAtStartPar
renders this hyphenation possible but perhaps even upstream LaTeX has
now made hyphenation of single words work in table cells).
This is a combination of 2 + 28 + 7 + and some more commits...
* Cherry-pick: Add support for booktabs-style tables to LaTeX builder
* Cherry-pick: Add support for zebra-striped tables to LaTeX builder
Co-authored-by: Stefan Wiehler <stefan.wiehler@missinglinkelectronics.com>
Above work originally initiated by @sephalon (thanks!)
Development refactored and continued by @jfbu
* latex_table_style configuration, support booktabs, colorrows, borderless
Some details:
- Simplify a bit a conditional in the longtable template
This also puts the target for a longtable with a label but no caption
above the toprule for better hyperlinking (testing shows hyperlink
target can not end up alone at bottom of previous page).
- Extend allowed syntax for colour assignments via 'sphinxsetup'
- latex_table_style new configuration value and coloured rows
For the user interface I tried to look for inspiration in
https://docutils.sourceforge.io/docs/user/config.html#table-style
which mentions booktabs and borderless. They also mention
captionbelow which we can implement later, now that architecture
is here. They don't mention coloured rows.
- Test on our own document... looks fine!
- Work-around an incompatibility of \cline with row colours
- Reverse priority of classes to allow overruling booktabs by standard
after parsing source but before letting LaTeX writer act
- Closes#8220
Commit
bb859c6696
already improved a bit, this finishes it (as :rst:dir:`rst-class` was
actually not linking to anywhere).
- Let booktabs style defaults to *not* using \cmidrule. They actually
don't make much sense there, as all \hline's are removed.
- Add \sphinxnorowcolor which allows construct such as this one in
a tabularcolumns directive:
>{\columncolor{blue}\sphinxnorowcolor}
else LaTeX always overrides column colour by row colour
- Add TableMergeColorHeader, TableMergeColorOdd, TableMergeColorEven
so single-row merged cells can be styled especially
- Extend row colours to all header rows not only the first one
(all header rows will share same colour settings)
- Auto-adjust to a no '|'-colspec for optimal handling of merged cell
- Add \sphinxcolorblend
- Workaround LaTeX's \cline features and other grid tables matters
- Add \sphinxbuildwarning for important warnings
- Fix some white gaps in merged cells of tables with vlines and
colorrows
- Work around LaTeX's \cline serious deficiencies for complex grid
tables
This commit corrects \cline badly impacting vertical spacing and
making tables look even more cramped as they usually are in LaTeX
(although one sees it clearly only with \arrarrulewidth a bit more
than the LaTeX default of 0.4pt).
Most importantly this commit solves the problem that \cline's got
masked by colour panels from the row below.
- Update CHANGES for PR #10759
- Improve documentation of new latex_table_style regarding colours
- LaTeX: box padding (t,r,b,l), borders (t,r,b,l), shadows (x,y) or radii
- LaTeX: fix#10650 via usage of our own sophisticated \fcolorbox
- LaTeX: user interface via 'sphinxsetup' to enhanced code-blocks frames
- LaTeX: user interface via 'sphinxsetup' to enhanced topic boxes
- LaTeX: CSS-named-alikes 'sphinxsetup' options for code-blocks and
topics
- LaTeX: CSS-named-alikes 'sphinxsetup' keys for warning type notices
(fix#10651)
- LaTeX: documentation of the new CSS-like options
- LaTeX: remove #10619 documentation, as the #10619 added
shadowBorderColor and shadowShadowColor now named respectively:
aside.topic_border-TeXcolor and aside.topic_box-shadow-TeXcolor
- LaTeX: use div.topic option prefix and not aside.topic for CSS-like
options
- LaTeX: keep the implicit legacy padding of warning type boxes as
default behaviour
Via a new configuration verbatimradius of 'sphinxsetup', which defaults
to 0pt.
If this dimension is non zero, the LaTeX package pict2e will be loaded
to help construct frames with rounded corners for code-blocks. And if
the LaTeX package pict2e was not found, a LaTeX warning is issued during
PDF build.
To let users know the deprecation surely, use logger.warning instead
of RemovedInSphinxXXWarning since 5.0. It will cause a crash if users
use `-W` option on their CI.
To describe the purpose more accurately, the `master_doc` is now renamed
to `root_doc`. The old name is still available. But it is recommeneded
to use new one from now on.
Compare doc/conf.py after merge at c9480f994 to what it was at 2ee033838.
It loses the modification from #8716 (merged at 38c614347) and thus
reverts doc/conf.py to former font config using mathpazo.
Prior to this the depth of the bookmarks is too low, one does not even
get to see for example what are the built-in extensions offered by
Sphinx.
Similarly the LaTeX created table of contents has not enough depth.
Dozens of contiguous pages from our documentation get only a single
link, it is very hard for newcomer to get some feeling of the scope of
Sphinx. With a more detailed table of contents (be it inside the PDF or
via the collapsable bookmark panel of PDF viewer) learning Sphinx is
easier.