Closed joeced closed 7 months ago
I encountered a different problem stemming from the same assumption. The documentation for an existing project broke as of the 0.21.2 release because of this assumption.
This change to make use of short names:
https://github.com/sphinx-contrib/matlabdomain/blob/a86ae6452a582aa1f51a68e1609ffa124086e3e7/sphinxcontrib/mat_types.py#L296-L307
breaks the build for projects that use matlab_auto_link = 'all'
and have a top-level directory named the same as one nested in another directory.
For example, my project uses misc/
to contain project logos, one of which is displayed in the README. This file must be copied over into the docs, so docs/misc/
also exists, so that the relative file path from the README is able to be reused. When the short_names
block linked above is reached, the docs/misc
"module" is confused with the misc
"module" and a dict is inserted for the entities_table
entry instead of a MatModule
object.
I'll work on drafting a PR that solves my problem. It might also enable the block to work with class folders.
Hi, thanks for the report.
I'm working on this in https://github.com/sphinx-contrib/matlabdomain/pull/237. @rdzman I hope this fixes it.
Perhaps you could try to install it directly from the branch with
pip install git+https://github.com/sphinx-contrib/matlabdomain.git@fix-autolinking-in-module-class-same-names
Closed with #237
Some examples ...
https://github.com/sphinx-contrib/matlabdomain/blob/2fc26b2022f67374a4c7caa291e6f955dc4b2009/sphinxcontrib/mat_documenters.py#L237
https://github.com/sphinx-contrib/matlabdomain/blob/2fc26b2022f67374a4c7caa291e6f955dc4b2009/sphinxcontrib/mat_documenters.py#L274
https://github.com/sphinx-contrib/matlabdomain/blob/2fc26b2022f67374a4c7caa291e6f955dc4b2009/sphinxcontrib/mat_documenters.py#L313
Originally posted by @rdzman in https://github.com/sphinx-contrib/matlabdomain/issues/230#issuecomment-1863525251