6
$\begingroup$

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",
                    LinkBase->"testPackage"
                }
            }
]

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

$\endgroup$
8
  • 1
    $\begingroup$ 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+. $\endgroup$
    – jkuczm
    Commented Sep 12, 2016 at 11:26
  • $\begingroup$ @jkuczm I just tried that and edited the question, it doesn't seem to help. $\endgroup$
    – Jansen
    Commented Sep 12, 2016 at 13:06
  • $\begingroup$ Strange, I just created test project and it worked for me. Which operating system and Mathematica version are you using? $\endgroup$
    – jkuczm
    Commented Sep 12, 2016 at 13:41
  • $\begingroup$ @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 :) $\endgroup$
    – Jansen
    Commented Sep 12, 2016 at 14:58
  • 1
    $\begingroup$ @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 $\endgroup$
    – billc
    Commented Jul 18, 2017 at 4:58

1 Answer 1

3
$\begingroup$

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.

Further reading:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.