sphinx-contrib / matlabdomain

A Sphinx extension for documenting Matlab code
Other
64 stars 45 forks source link

Fix issue with auto-linking and class/module name clash. #237

Closed joeced closed 7 months ago

joeced commented 7 months ago

In version 0.21.1 we introduced handling for class/modules with this structure:

module/
    module.m  # a class

However, auto-linking was not handled correctly

joeced commented 7 months ago

@rdzman I hope you have time to review this change, as it affects the auto-linking feature.

itsmoosh commented 7 months ago

This still breaks for my project with repeated directory names.

rdzman commented 7 months ago

It looks fine for my use cases. I ran it on a large project of mine that makes extensive use of auto-linking and it does not appear to have introduced any issues. The HTML output is identical to what it was before this PR.

But, I have not looked at the issue mentioned by @itsmoosh.

itsmoosh commented 7 months ago

Created PR #238 with my proposed fix. short_names cannot be used to replace items in entities_table when names of modules overlap with any other module, function, class, etc., because entries in entities_table will always be overwritten and this will always cause errors.

joeced commented 7 months ago

Thanks a lot @itsmoosh and @rdzman for testing and contributing to the project. Much appreciated.