6

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.

Jansen
  • 1,223
  • 9
  • 17
  • 1
    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 withNeeds["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 thanks for pointing me here. It half-worked (>> worked, but not i-in-circle) initially, when I set up PacletInfo.m using the Eclipse text editor. However, seeing that it only half worked, & did not sync correctly with Workbench's Paclet Info Editor, I cleaned it out and tried to recreate it with the Pactlet Info Editor. That would not let me add Kernel -> Context. So I went back to the text editor. Now it does not work at all. :( Presumably there is some corrupt Eclipse state somewhere I need to clean out. Mod that, and mod the i-in-circle, this seems to be the solution. – billc Jun 22 '17 at 04:32
  • sorry, PEBKAC on my part. The string in Context->{} must end with a back-tic. This gets me reliably back to the state where the >> link works. Unfortunately, this does not seem to fix the i-in-a-circle icon from the function's hover box. That link still does not work. :/ – billc Jun 22 '17 at 04:56
  • @billc Sorry, I missed the fact that the this doesn't fix the i-in-a-circle issue. This question is not an exact duplicate of your question then. Maybe you could edit your original question mentioning that answer to this question only fixes the ">>" link issue, but not the second one, then we can try to reopen your question. Unfortunately I don't know how to fix the i-in-a-circle link. – jkuczm Jun 25 '17 at 16:03
  • 1
    @jkuczm ... turns out that part of the question is also a duplicate: https://mathematica.stackexchange.com/questions/125661/how-do-i-add-the-infobutton-in-autocomplete-that-links-to-the-documentation-page. 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 04:58

1 Answers1

3

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:

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263