Following warning is displayed with inclusion failure when parsing body.rst
body.rst:34: Warning: circular inclusion in "include" directive: gap.rst < gap.rst < body.rst
It is tesed on 0.17.1. I suspect wrong self.lineno from the 4th include due to short distance from the 3rd include.
body.rst
.. _my_table:
.. table:: a
:class: longtable
:widths: 100
+----------------------+
| a |
+======================+
| a |
| |
| .. include:: gap.rst |
| |
| a |
+----------------------+
| a |
| |
| .. include:: gap.rst |
| |
| a |
+----------------------+
| a |
| |
| .. include:: gap.rst |
| |
| a |
| |
| .. include:: gap.rst |
| |
| a |
+----------------------+
| a |
| |
| .. include:: gap.rst |
| |
| a |
+----------------------+
gap.rst
.. raw:: latex
\vspace{2mm}
On 2021-09-10, Yangsu Kim via Docutils-develop wrote:
Thank you for reporting.
Until this is sorted out (and maybe even afterwards),
I recommend using a substitution_ instead of an include:
body.rst
Thank you for your advise. The substitution method works correctly and better!
It seems the detection mechanism in
directives.misc.Includeis unreliable for table content because it relies on the line number (self.lineno). This is easy to understand for the minimal failing example with cells in a row:but also the case for cells in a column:
and is independent of the content of the included file ( as long as it is valid at the place of inclusion).
(maybe
self.linenois local to a table cell in tables??)On 2021-10-03, Mickey Endito via Docutils-develop wrote:
The common feature is, that nested parsing can fool the current circular inclusion heuristics.
Fixed in r8851. Thanks for reporting.
Fixed in Docutils 0.18.