Open cglacet opened 3 years ago
I managed to solve the issue by downgrading sphinx to 3.2.1
:
[tool.poetry.dev-dependencies]
-sphinx = "^3.3.1"
+sphinx = "3.2.1"
The error also appears on sphinx 3.3.0
.
Related to?: https://github.com/CrossNox/m2r2/issues/13
No, it's a different problem, I had #13 too but I solved it by adding this to my conf.py
:
"""Patching m2r2"""
import m2r2
current_m2r2_setup = m2r2.setup
def patched_m2r2_setup(app):
try:
return current_m2r2_setup(app)
except (AttributeError):
app.add_source_suffix(".md", "markdown")
app.add_source_parser(m2r2.M2RParser)
return dict(
version=m2r2.__version__,
parallel_read_safe=True,
parallel_write_safe=True,
)
m2r2.setup = patched_m2r2_setup
Also note that #13 has been patched, but the PR hasn't been merged yet. This mimics the patch that will (hopefully) been soon merged.
Hi @cglacet!
I was having similar errors from https://github.com/CrossNox/m2r2/issues/13, then I saw this issue and I took your patch from conf.py
and added it to my project here: https://github.com/thegrill/grill/pull/7/commits/2fc61deae156351f0444af3fc1747be0e63ee153.
I noticed the missing mdinclude
directive was fixed by adding the app.add_directive("mdinclude", m2r2.MdInclude)
call after catching the AttributeError
: https://github.com/thegrill/grill/pull/7/commits/79cbb7b9331796d30a9a56b7fe859e2438f1c2ff, like so:
...
except (AttributeError):
app.add_source_suffix(".md", "markdown")
app.add_source_parser(m2r2.M2RParser)
+ app.add_directive("mdinclude", m2r2.MdInclude)
return dict(
...
With that, my docs built properly again.
Since it was fixed directly on the patch, I feel this is related to https://github.com/CrossNox/m2r2/issues/13
I hope this helps!
IIUC, this can be closed, since the fix for #13 has already been merged, right?
Version 0.2.5
I'm not too sure what I've done, this package used to work but now I get this error:
I can still convert files without any problem, but when I run sphinx (3.3.1) I get this error when using the
mdinclude
directive.Details about my install
I tried removing and adding m2r2 back but nothing seems to work.
How does m2r2 normally registers this new directive?