# linking usage message to package documentation

I am trying to write documentation for a package I made, using Workbench. Let's say I have a function test, first I write a usage message as:

usage::test = "Description of test."


This is located in the .m file, outside of the private context.

Then using workbench I create a documentation page for this symbol. Having done this, and after building the documentation and deploying the package, this documentation page for test is indeed accessible through the standard documentation menu by searching for test.

However, what I have been unable to do is to get a link to this page when evaluating ?test, as the built-in functions have, something like:

?test
(*Description of test. >> *)


I have also tried with the ApplicationMaker package, where it does work. However, before moving everything there I'd like to know if there's a simple fix for Workbench.

edit: I've tried editing the PacletInfo.m, to read:

Paclet[
Name -> "testPackage",
Version -> "0.0.1",
MathematicaVersion -> "9+",

Extensions -> {
{
"Kernel",
Context->{"testPackage"}
},
{
"Documentation",
Resources->{"ReferencePages/Symbols/test"},
Language -> "English",
}
}
]


(Compared to what Workbench creates, I added the "Kernel" extension, the Resources and the LinkBase) But this doesn't fix the problem.

• Make sure PacletInfo.m has proper "Documentation" and "Kernel" Extensions. By default Workbench (at least version 2) creates PacletInfo.m file that doesn't have sufficient Extensions for Mathematica versions 9+. – jkuczm Sep 12 '16 at 11:26
• @jkuczm I just tried that and edited the question, it doesn't seem to help. – Jansen Sep 12 '16 at 13:06
• Strange, I just created test project and it worked for me. Which operating system and Mathematica version are you using? – jkuczm Sep 12 '16 at 13:41
• @jkuczm Hmm very strange, I tested once more, and when I load the package with << testPackage  it doesn't work, but when I load it with Needs["testPackage"] it does work, and any subsequent time I load it with << testPackage  it now does work, even in a new Mathematica session. This is in Mathematica 11, OSX. Anyway it does work now, so thanks :) – Jansen Sep 12 '16 at 14:58
• @jkuczm ... turns out that part of the question is also a duplicate: mathematica.stackexchange.com/questions/125661/…. I added a link to it over on my question. I really wanna get an answer to this someday, so I just threw a bounty on it as well. :D – billc Jul 18 '17 at 4:58

From the comment by jkuczm,

Make sure PacletInfo.m has proper "Documentation" and "Kernel" Extensions.

Within the "Kernel" extension, set the Context` to match your package context and name.