swyddfa / esbonio

A language server for working with Sphinx projects.
https://docs.esbon.io/
121 stars 21 forks source link

[Feature]: Make clickable paths to .uml files (for the uml directive) #817

Open annetre opened 1 month ago

annetre commented 1 month ago

What would you like to see

Hi,

The extension works fine and makes clickable paths and open files with their paths for common directives (figure, image,literalinclude and so on) with Ctrl + Click.

image

Please, introduce the same behavior for the uml directive.

image

alcarney commented 1 month ago

I assume that the .. uml:: directive is from the sphinxcontrib-plantuml extension?

I definitely want to make sure that it is possible to support this. However, I won't be adding support for this directly to esbonio itself.

Since roles and directives can do practically anything, esbonio needs to be "taught" how each role/directive behaves and what features it should try and provide. So while it makes sense for esbonio support whatever Sphinx provides, it would be impractical to try and add built-in support for the wider ecosystem.

For this reason I've always intended for esbonio to be extensible and my hope is with the upcoming 1.0 release this will finally become a reality. To cut a long story short, my aim is in the worst case scenario you would have to add a few lines to your conf.py to "teach" esbonio about the .. uml:: directive

def setup(app):
    """This is just a sketch, I'm sure the details will change!"""
    if hasattr(app, 'esbonio'):
        app.esbonio.register_directive("uml", argument_provider='filepath')

Best case, the 1.0 release is a huge success and extensions themselves start including the necessary integrations with esbonio and everything Just WorksTM out of the box! :sweat_smile:

Anyway, I'm going to need an API like this myself in order to re-implement features like this for the 1.0 release so you can be reasonably confident that a solution you can try will be available in a reasonable time frame :)

annetre commented 1 month ago

Hi @alcarney ,

Yes, you are correct; this directive pertains to the sphinxcontrib-plantuml extension.

Thank you for your engagement and interest in this feature. I hope this feature will be implemented in the future.

Wishing you great success!