Plugin JavaHelp as a separate module

Does someone know how I can put my JavaHelp Content into a separate Module?

I have the java help working as a resource folder, but I'd like to hook it up into the plugin.xml <helpset> tag.

So I moved my Help content to a new module and have it generate a jar file into out/artifacts/help.jar But I don't know how to hook up this jar to the helpset

<helpset file="help.jar" path="plugin.hs"/>


It does not seem to be registered at all when I start my plugin in the Debug environment. Should it be?

7 comments
Comment actions Permalink

out/artifacts/help.jar will not be on the classpath when you run your plugin in the debug environment, so the help won't be picked up. You can either copy help.jar to a source root and let the IntelliJ IDEA build process copy it to the output directory, or just use a fully built (prepared for deployment) plugin to test your help system.

0
Comment actions Permalink

Thanks Dimitry,
well, so lets try the fully backed plugin.

So what do I need to do so that the "Prepare Plugin Module ...." packages the artifact into the *.zip file? Or in other words where does it go? Because I have declared it as an artifact but it does not get exported.

My current my-plugin.jar is in my-plugin/lib/my-plugin.jar inside the zip file. So should the it be my-plugin/help.jar or my-pluing/lib/help.jar ?

Before I go back and forth too often, is there a way to get some log trace to find out what is happening when starting the plguin? Because neither of the above options works for me :-(

0
Comment actions Permalink

"Prepare plugin module for deployment" isn't integrated with artifacts. It packages the libraries your plugin depends on into the .zip file, which again means that your help.jar needs to be added as a library to your plugin module.

IIRC the help needs to be in my-plugin/lib/help.jar.

We do log a failure to load a plugin help set to the IntelliJ log file. You can view it using "Help | Show Log in <file manager>".

0
Comment actions Permalink

Thanks Dimitri for all your effort here to support plugin developers.

Unfortuantely I have not been able to make the described work.

First I want to validate my expectations:
* When I get the <helpset ...> to load correctly, I shoudl be able to hit "F1" in my toolwindow and up pops the help content in a help browser. No code is needed to make that happen in the ToolWindow?
* You wrote the help jar file should be in the "lib/" folder of the plugin.zip file, I see other / older posts in these forums that say it should be in the "help/" folder (meaning in the my-plugin/help/ folder). What is the right folder?
* You mention that IntelliJ logs a message when the helpset can't be loaded. I have tried many variants to place the jar, and never seen any message in the log file. Are you sure about that? Where whould I expect that message?

Last but not least, I published a project with my experiments https://bitbucket.org/conficio/intellij-samples. May be that makes it easier to track this down.

0
Comment actions Permalink

As a heads up, it's quite likely that we'll move entirely away from the JavaHelp-based system in the IntelliJ IDEA 15 timeframe. The best approach that will work both now and in the future is to publish your help online on your own server, and to open the pages there in a Web browser when the users invoke the Help action in your plugin.

0
Comment actions Permalink

Thanks Dmitry, that's good to know. Is it currently possible for us to hook into the help topic mechanism, and redirect clicks of the help topic buttons to our own doc pages?

0
Comment actions Permalink

I think there is no place that forces you to use the standard HelpManager; you can always define your own behavior. For example, in a DialogWrapper, you can override doHelpAction().

0

Please sign in to leave a comment.