AAVSO / VStar

VStar is a visualisation and analysis tool for variable star data brought to you by AAVSO
https://www.aavso.org/vstar
GNU Affero General Public License v3.0
9 stars 3 forks source link

Basic 'help' functionality for plug-ins #379

Closed mpyat2 closed 8 months ago

mpyat2 commented 8 months ago

Implementation of the basic help functionality for plug-ins.

See the branch 'plugin-manager-help-functionality'

1) New getDocName() method in IPlugin 3) If getDocName() is implemented in the plug-in, it must return the name of the pdf document. 2) 'Help' button in the plugin manager dialog: image

dbenn commented 8 months ago

Yep, I like it. Have thought about this too.

This would supplement browsing the wiki, e.g. https://github.com/AAVSO/VStar/wiki/Observation-Source-Plug%E2%80%90ins

A modified approach would be to add a link to the wiki section, but a PDF makes as much sense as anything. The wiki may be quicker to load is one upside and a brief description may be all someone wants initially. Reminds me I need to link all PDFs in the wiki plugin pages. Happy to go with your approach though.

dbenn commented 8 months ago

Further to my last comment, rather than the name of the PDF that VStar adds a URL base prefix to, I'm thinking that it should always a full URL that's specified since then someone can write a plugin and point to the wiki or somewhere else if they wish.

Perhaps a compromise could be that the plugin logic says:

Thoughts?

mpyat2 commented 8 months ago

Hi @dbenn , I've implemented the following approach: 1) the plugin document name can be a file name (without path) resided in the base plug-in doc directory (in this case it may contain spaces and other special characters). 2) Or it can be a full document URL (in this case, spaces and special characters must be properly encoded (i.e. %20 instead of space))

Now, every plug-in returns the pdf file name if it exists in the document repository or the full URL targeting Wiki. PluginManagementDialog interprets it accordingly.

dbenn commented 8 months ago

Sounds good @mpyat2. Happy to try the code and review.

mpyat2 commented 8 months ago

Hi @dbenn ,

I've moved the HTML help call to Mediator as a static method. This allows us to use the help functionality in the plug-in dialogs. See the ZTF observation source as an example. Not all plug-ins have a dialog, however, so for them, currently, the only place to invoke help is PluginManagerDialog.

image

Cheers, Max

mpyat2 commented 8 months ago

Thank you, @dbenn !