Closed htgoebel closed 7 months ago
The issue is independent of the CLI so I moved the issue here.
The AttributeError is caused inside sphinx
internal code. https://github.com/rstcheck/rstcheck-core/issues/3#issuecomment-1681934867 mentioned that this error can be caused from include directives, but it mostly occurs with language-less code-blocks as far as I know.
Unfortunately this issue is almost a decade old (https://github.com/rstcheck/rstcheck-core/issues/3#issuecomment-1140405059) and I don't have a fix for this. But I am open for PRs if you find a fix.
What wonders me in your case is, that you seem to use rst2html5
and not sphinx
for building you docs. The issue only occurs if sphinx
is installed inside the venv from where you are running rstcheck
. And when you install rstcheck
it only installs sphinx
too if you run something like pip install rstcheck[sphinx]
. Therefore it could be a simple fix to remove sphinx
if you do not use it.
Closing as duplicate/in favor of #3.
Sorry, I missed that #3 also mentions include directives.
I'm using sphinx for building the docs. Above I just used rst2html5 to show/test that index.rst compiles fine when using just rst2x.
When not installing sphinx in the environment I get lots of "Unknown interpreted text role" and "Unknown directive type" errors. Thus this seems to not be the solution either :-/
Ah ok. Yeah all those unknown things are then probably sphinx things which are not part of basic RST.
To Dos
Example Code (rst)
Relevant log output
Description
The file above is named
index.rst
. There is a second file (_common_definitions.txt
):rst2html5.py index.rst
works as expected: the output html contains the included text.rstcheck index.rst
gives the warning shown above.Additionally:
Operating System
Linux
Operating System Details
No response
Python Version
3.10
rstcheck Version
rstcheck CLI Version: 6.2.0 rstcheck-core Version: 1.2.0
Additional Context
No response