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
- Add entries in the table of contents for domain objects (e.g.
`py:function`, `rst:role`, etc). Supported domains are Javascript,
Python, and reStructuredText.
- Support content in `py:module` and `js:module` directives.
- Add the `noindexentry` and `noindex` flags to more domains.
- Add `toc_object_entries_show_parents` configuration setting
- Update documentation and tests
Since 4.0, :ivar: items has not been rendered as hyperlinks. So any
modules, classes and tilda are now harmful. This removes the prefixing
filter for napoleon_use_ivar option.
refs: #5129 and #5977
After the release of 4.0.0, some 3rd party extensions have became not
working with the latest Sphinx because `force_decode()` function was
removed. It was deprecated since Sphinx-2.0 and warned for the removal
since 3.0.
This reverts the removal and extends its deprecation period to 5.0.0. I
hope it helps users of these extensions.
At present, some attributes of env object are considered as optional
because they have been initialized by None on the constructor. But
they have always been fullfilled actually.
To be clear the type hints of the env object, this makes the `app`
argument for the BuildEnvironment class required. It can ensure the
attributes of env object are not optional.
Since 1.6, sphinx.util.logging module became the default logging
interface of Sphinx. It allows sphinx-components to output log
without the app (or env) object. According to the policy,
DocumenterBridge.warn() is no longer needed and should be replaced by
the logging module.
DocumenterBridge.filename_set has been used since its beginning. On the
other hand, in docutils, record_dependencies attribute is well-used to
store the list of dependency files. So this renames it to docutils'
standard attribute.
To make directives' behavior consistent, the :file: option for
csv-table directive now recognizes an absolute path as a relative
path from source directory.
To choose appropriate content for pending_xref node on resolving,
this introduces a new custom node `pending_xref_condition`. It only
has a condition for the filtering and contents of the reference.
Add new configuration variables: `html_permalinks` and
`html_permalinks_icon`.
This refines the settings around HTML permalinks.
* html_add_permalinks
* Deprecated.
* html_permalinks
* Enable or disable permalinks feature.
* html_permalinks_icon
* Change the icon for permalinks
To embed the external favicon and logo image, this adds new template
variable `favicon_url` and `logo_url` that point the external URL or
relative path for the favicon/logo file from current file. It helps to
use it on template files.
The anchors for viewcode was generated in the reading phase only if
supported builder is used. It causes anchors are missing on the
incremental build after the build for non supported builder.
This introduces `viewcode_anchor` node to insert the anchor even if non
supported builders. They will be converted to the anchor tag in the
resolving phase for supported builders. Or, they will be removed for
non supported builders.
These attributes were used to cache checked links and avoid issuing
another web request to the same URI.
Since 82ef497a8c, links are pre-processed
to ensure uniqueness. This caching the results of checked links is no
longer useful.
So far, linkcheck scans all of references and images from documents, and
checks them parallel. As a result, some URL would be checked twice (or
more) by race condition.
This collects the URL via post-transforms, and removes duplicated URLs
before checking availability.
refs: #4303
To keep compatibility with the standard doctree model of docutils,
this stops to use 'default' value as a default value of the align
attribute for figure and table nodes.
To control the visibility of variables, ModuleDocumenter have to load
docstring of them on `get_object_members()` phase. This reimplements
it and `get_module_members()` helper to fetch docstring on earlier
phase (as ClassDocumenter does).