Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Usage statements, hyperlinks, and usage button

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111176] Re: Usage statements, hyperlinks, and usage button
  • From: "Scot T. Martin" <smartin at seas.harvard.edu>
  • Date: Fri, 23 Jul 2010 07:08:24 -0400 (EDT)

As my question in 2010 is still relevant to 2004, I'll post here some code 
that I put together yesterday that might also be relevant to someone else 
in future years for developing usage statements:

With[
  {
   hyperlinkConstructor :=

    Function[
     {text, linkText, linkLocation},

     With[
      {preText =
        "\!\(\*ButtonBox[\(" <> linkText <>
         "\),Active->\"True\",BaseStyle->\"Link\",ButtonData->\"",
       postText = "\"]\)"
       },

      With[
       {hyperlinkText = StringJoin[preText, linkLocation, postText]},
       text <> " " <> hyperlinkText
        ]
      ]
    ]
   },

  n::usage =
   hyperlinkConstructor[
    "n[a_] .... explanation that uses a NormalDistribution.",
    "Read more about NormalDistribution.",
    "paclet:ref/NormalDistribution"
    ]
  ]



On Thu, 22 Jul 2010, David Park wrote:

> If you create paclet documentation with Workbench, then Mathematica itself
> automatically adds the RightGuillermet (??) to the usage message and it
> links to the corresponding Function page in the documentation.
>
> But this whole process is rather flakey and hidden from the user. In the
> present Workbence 2.0, and Mathematica 7.0.1 there is, for example, a bug if
> the application contains more than one package. Then some additional
> statements must be added to the PacletInfo.m file, and those statements
> generate warnings in Workbench - but work all right. This will probably be
> fixed in the next Mathematica release.
>
> Why can't usage messages be freed from their archaic String format?
>
>
> David Park UMLF
> djmpark at comcast.net
> http://home.comcast.net/~djmpark/
>
>
>
>
> From: Scot T. Martin [mailto:smartin at seas.harvard.edu]
>
> Scanning through the MathArchives, I see others have faced the challenge
> before of trying to get hyperlinks into usage statements. Is the link
> below from 2004 still current for 2010 or are there now improved
> approaches?
>
> http://forums.wolfram.com/mathgroup/archive/2004/Apr/msg00220.html
>
>
>
>
>
>
>


  • Prev by Date: Re: Hatched shading?
  • Next by Date: Re: A Question About Directive
  • Previous by thread: Re: Usage statements, hyperlinks, and usage button
  • Next by thread: FDTD Code or Example? (2D wave eqn, rect grid, coords x,y,t)