Orange Forum • View topic - Add-on development: widget contextual help

Add-on development: widget contextual help

A place to ask questions about methods in Orange and how they are used and other general support.

Add-on development: widget contextual help

Postby axanthos » Tue Aug 20, 2013 20:55

Hi,

Working on the documentation of Orange Textable, I find myself wondering how to specify that a given .rst file is the one that should be displayed when the user right-clicks on an instance on the canvas and selects Help in the contextual menu.

Thanks in advance

Re: Add-on development: widget contextual help

Postby Ales » Thu Aug 22, 2013 12:13

If you are writing the help documentation using sphinx, then you can specify the documentation root to the canvas using 'orange.canvas.help' entry point

Code: Select all
{'orange.canvas.help': (
        'intersphinx = some_package_name.and.path:some_name')}


and inside some_package_name/and/or/path.py

Code: Select all
some_name = [
    ("http://example.com/doc/", None),
    ("http://alternative.example.com/doc", None)
]

(the tuples here have the same meaning as described in http://sphinx-doc.org/ext/intersphinx.html, except that the second entry if not None should always be an absolute path)

Then if you have a widget named 'Widget Name' you just have to make sure that in sphinx :ref:`Widget Name` would resolve to the proper page intended to be shown.

When specifying the documentation urls you can also use some string substitutions. For instance Orange itself uses this
Code: Select all
intersphinx = (
     # root in development mode
     ("{DEVELOP_ROOT}/docs/build/html/", None),
     # URL is taken from PKG-INFO (Home-page)
     ("{URL}/docs/latest/",
      "{URL}/docs/latest/_objects/")
)

Here the first entry would resolve to the local documentation when installed in 'develop' mode,
and the second to http://orange.biolab.si/docs/latest, because of the 'url' parameter passed to setup function in setup.py.

Re: Add-on development: widget contextual help

Postby axanthos » Thu Aug 22, 2013 19:52

Thanks a lot, I'll work on this and hopefully post an updated version soon.


Return to Questions & Support



cron