Closed stibus closed 8 months ago
Thanks for the contribution and sorry for the late reply.
Would you have time to add a test, for instance with new test directory in test/roots
that uses a relative path.
Hi @joeced,
I'm not sure what the expectation about that test is. Basically one just needs to replace matlab_src_dir = os.path.abspath("..")
with matlab_src_dir = ".."
in tests/test_docs/conf.py
. Maybe you just want to update existing tests.
But I have seen that my code would fail if matlab_src_dir
was empty, so I adjusted the code to test this before constructing the path.
I'll accept the PR now and prepare a new release.
Included in the new version 0.21.0
. I changed it from being relative to configuration directory, rather than the source directory. In most cases it's the same, but I think it is easier to the user to be relative to conf.py
.
Once again, thanks for the contribution, very much appreciated.
Hi @joeced. Unfortunately, making the path relative to the config directory again breaks compatibility with sphinx-multiversion. It is one of those cases where config and source directory are different. sphinx-multiversion works with a single configuration but calls sphinx-build
using a temporary source directory for each version. For this to work matlab_src_dir
must be relative to the source directory. Otherwise, the documentation is built from the most recent version only.
Fixed in version 0.21.2
Thanks for the fix! I can confirm it works as expected in my project. You may want to mention in the documentation that users may still specify an absolute path.
Thanks for testing it. The documentation mentions both the option of absolute and relative paths.
Instead of having an absolute path for
matlab_src_dir
inconf.py
interpret the supplied value as path relative to the sphinx source directory. This enables the use of matlabdomain with, e.g., sphinx-multiversion which relies on running sphinx-build on different versions checked out to temporary folders. Thanks toos.path.join()
it is still possible to provide an absolute path, though.This solves https://github.com/Holzhaus/sphinx-multiversion/issues/108 which I found while looking for a solution.