在新版本的 Mathematica 中制作版本 5 旧文档的工作副本

发布于 2024-11-02 23:40:52 字数 933 浏览 2 评论 0原文

在新版本的 Mathematica 中,我们有 功能齐全的老式 Mathematica 帮助浏览器。但版本 5 的旧文档并未包含在新版本的 Mathematica 中。该旧版文档仅占用 209 МB 磁盘空间,如果能够在新版本的 Mathematica 中访问它将会非常有用。

Mathematica 5.2 和 Mathematica 7 或 8 安装在同一台计算机上,如何才能通过老式的帮助浏览器从新版本中访问旧文档?

我尝试将文档文件夹复制到

C:\Program Files\Wolfram Research\Mathematica\5.2\Documentation

旧版

C:\Documents and Settings\All Users\Application Data\Mathematica\Application\LegacyDocumenation

帮助浏览器中,现在旧版帮助浏览器中的“帮助浏览器”显示为插件。但它不能正常工作。

有关调整 Mathematica 5 中帮助浏览器外观的一些有用信息,请参见 此处。但我不知道如何将其应用于新版本的Mathematica

In new versions of Mathematica we have fully functional old-fashioned Mathematica Help Browser. But the legacy documentation of version 5 is not included in new versions of Mathematica. This legacy documentation takes only 209 МB of disk space and it would be useful to have it accessible from within the new versions of Mathematica.

Having Mathematica 5.2 and Mathematica 7 or 8 installed on the same machine, how can one make the legacy documentation accessible from within a new version through the old-fashioned Help Browser?

I tried to copy the Documentation folder from

C:\Program Files\Wolfram Research\Mathematica\5.2\Documentation

to

C:\Documents and Settings\All Users\Application Data\Mathematica\Application\LegacyDocumenation

and inside of the legacy Help Browser now appear "Help Browser" as an AddOn. But it does not work properly.

Some useful information on tuning the appearance of the Help Browser in Mathematica 5 can be found here. But I do not know how to apply this to new versions of Mathematica.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清欢 2024-11-09 23:40:52

解决方案

顺便说一句,我已经找到了将所有 Mathematica 5.2 文档添加到新版本 Mathematica 中旧版帮助浏览器中的方法。

关键是位于目录(Windows 下)中的“HelpBrowserSetup.tr”文件,

C:\Program Files\Wolfram Research\Mathematica\7.0\SystemFiles\FrontEnd\TextResources

应将其内容替换为:

@@resource HelpBrowserSetup
BrowserCategory["Help Browser", None, {
    HelpDirectoryListing[{"RefGuide"}, False],
    HelpDirectoryListing[{"AddOns"}, False],
    HelpDirectoryListing[{"MainBook"}, False],
    HelpDirectoryListing[{"OtherInformation"}, False],
    HelpDirectoryListing[{"GettingStarted"}, False],
    HelpDirectoryListing[{"Tour"}, False],
    HelpDirectoryListing[{"Demos"}, False],
    BrowserCategory["Master Index", None, {HelpMasterIndex[]}]
}]

然后,Mathematica$InstallationDirectory 中的“Documentation”文件夹em> 5.2 应复制到新版本Mathematica$InstallationDirectory 并替换(一个不重要的文件将被替换)。另一种可能性是将其复制到目录(在 Windows 下)

C:\Documents and Settings\All Users\Application Data\Mathematica

(可能 $UserBaseDirectory 也合适)。

现在启动 Mathematica 并评估

FrontEndTokenExecute["HelpDialog"]

旧版帮助浏览器将打开并包含 5.2 版中的所有文档!

screenshot

编辑

我刚刚找到了更简单的解决方案。人们可以按如下方式修改“HelpBrowserSetup.tr”文件:(

@@resource HelpBrowserSetup
HelpDirectoryListing[SystemHelpPath, False, True, True]

或者简单地将该文件从版本 5.2 安装复制并替换到新版本的文件夹中)。

对于安装了 Mathematica 5.2 的用户来说,

您无需复制文档。您有两种可能性:

1.) 仅将“HelpBrowserSetup.tr”文件从版本 5.2 安装复制到新版本的文件夹。然后评估类似的内容

SetOptions[$FrontEnd, 
 SystemHelpPath -> 
  Union[SystemHelpPath /. 
    Options[$FrontEnd, 
     SystemHelpPath], {"C:/Program Files/Wolfram \
Research/Mathematica/5.2/"}]]

(其中“C:/Program Files/Wolfram Research/Mathematica/5.2/”是 Mathematica 5.2 的 $InstallationDirectory)。

,所有安装的版本 6 之前的附加组件将不会出现在旧版帮助浏览器中):

@@resource HelpBrowserSetup
HelpDirectoryListing[{"C:/Program Files/Wolfram Research/Mathematica/5.2/"}, False, True, True]

然后评估

FrontEndTokenExecute["RebuildHelpIndex"]
FrontEndTokenExecute["HelpDialog"]

2.) 只需按如下方式修改“HelpBrowserSetup.tr”文件(但在这种情况下 将帮助浏览器项目添加到帮助菜单

为此,我们只需在 MenuSetup.tr 中的适当位置添加行 MenuItem["Help Browser...", "HelpDialog"],

HelpMenu["&Help", 
{
    MenuItem["Documentation &Center", "OpenHelpLink"],
    MenuItem["Help Browser...", "HelpDialog"],

screenshot

The solution

Incidentally I have found the way to add all Mathematica 5.2 documentation to the legacy Help Browser in new versions of Mathematica.

The key is the "HelpBrowserSetup.tr" file located in the directory (under Windows)

C:\Program Files\Wolfram Research\Mathematica\7.0\SystemFiles\FrontEnd\TextResources

One should replace its contents with:

@@resource HelpBrowserSetup
BrowserCategory["Help Browser", None, {
    HelpDirectoryListing[{"RefGuide"}, False],
    HelpDirectoryListing[{"AddOns"}, False],
    HelpDirectoryListing[{"MainBook"}, False],
    HelpDirectoryListing[{"OtherInformation"}, False],
    HelpDirectoryListing[{"GettingStarted"}, False],
    HelpDirectoryListing[{"Tour"}, False],
    HelpDirectoryListing[{"Demos"}, False],
    BrowserCategory["Master Index", None, {HelpMasterIndex[]}]
}]

Then, the "Documentation" folder from the $InstallationDirectory of Mathematica 5.2 should be copied to the $InstallationDirectory of new version of Mathematica with replacement (one unimportant file will be replaced). Another possibility is to copy it to directory (under Windows)

C:\Documents and Settings\All Users\Application Data\Mathematica

(probably the $UserBaseDirectory is also appropriate).

Now start Mathematica and evaluate

FrontEndTokenExecute["HelpDialog"]

The legacy Help Browser will open and will contain all the documentation from the version 5.2!

screenshot

Edit

I just have found even simpler solution. One may modify the "HelpBrowserSetup.tr" file as follows:

@@resource HelpBrowserSetup
HelpDirectoryListing[SystemHelpPath, False, True, True]

(or simply copy with replacement this file from the version 5.2 installation to the new version's folder).

Addition for those who have Mathematica 5.2 installed

You need not to copy the Documentation. You have two possibilities:

1.) Copy only the "HelpBrowserSetup.tr" file from the version 5.2 installation to new version's folder. Then evaluate something like

SetOptions[$FrontEnd, 
 SystemHelpPath -> 
  Union[SystemHelpPath /. 
    Options[$FrontEnd, 
     SystemHelpPath], {"C:/Program Files/Wolfram \
Research/Mathematica/5.2/"}]]

(where "C:/Program Files/Wolfram Research/Mathematica/5.2/" is the $InstallationDirectory of Mathematica 5.2).

2.) Just modify the "HelpBrowserSetup.tr" file as follows (but in this case all installed pre-version 6 Add-Ons will not appear in the legacy Help Browser):

@@resource HelpBrowserSetup
HelpDirectoryListing[{"C:/Program Files/Wolfram Research/Mathematica/5.2/"}, False, True, True]

and then evaluate

FrontEndTokenExecute["RebuildHelpIndex"]
FrontEndTokenExecute["HelpDialog"]

P.S. Adding Help Browser item to the Help menu

For this we just need to add row MenuItem["Help Browser...", "HelpDialog"], in appropriate place in MenuSetup.tr:

HelpMenu["&Help", 
{
    MenuItem["Documentation &Center", "OpenHelpLink"],
    MenuItem["Help Browser...", "HelpDialog"],

screenshot

清引 2024-11-09 23:40:52

警告:我最近了解到,为新文档构建索引可能会在 Windows 计算机中产生不良影响。请阅读 Alexey 的评论以了解更多详细信息。据我所知,Mac OS X 中一切正常。一旦确定问题根源,我将提供更新。

在这里,我提出了一个功能,允许任何笔记本成为 Mathematica 8 中文档中心的一部分。您可以首先让 Mathematica 评估以下内容:

Clear[FormatDoc, AddDocs];
FormatDoc[dir_, last_, num_, appName_, pacFile_, index_] := 
 Module[{dirs, nbs, nb, str, comma = ",", title, tags}, 
  nbs = FileNames[dir <> "/*.nb"];
  dirs = FileNames[dir <> "/*"];
  Do[If[last && i == Length@nbs, comma = ""];
   str = FileNameDrop[nbs[[i]], {1, num}];
   title = StringDrop[FileNameTake[nbs[[i]]], -3];
   Print[Row[{Style["Adding: ", "MSG", Black], 
      Style[str, "MSG", Blue]}]];
   str = StringDrop[str, -3];
   WriteString[pacFile, 
    "\t\t\t\t\"" <> str <> "\"" <> comma <> "\n"];
   nb = NotebookOpen[nbs[[i]]];
   tags = 
    DeleteDuplicates@
     Flatten@Map[#[[2]] &, 
       Cases[NotebookGet[
         nb], (_Dummy | (CellTags -> _)), \[Infinity]]];
   SetOptions[nb, 
    DockedCells -> 
     FEPrivate`FrontEndResource["FEExpressions", "HelpViewerToolbar"],
     Saveable -> False, 
    WindowTitle -> 
     "Mathematica 5.2 | " <> FileNameDrop[str] <> " | " <> title, 
    TaggingRules -> {"ModificationHighlight" -> False, 
      "Metadata" -> {"context" -> appName <> "`", "keywords" -> tags, 
        "index" -> True, 
        "label" -> "Mathematica 5.2 | " <> FileNameDrop[str], 
        "language" -> "en", "paclet" -> appName, "status" -> "", 
        "summary" -> ToString@tags, "synonyms" -> {}, 
        "title" -> title, "windowtitle" -> title, "type" -> "Doc", 
        "uri" -> 
         StringReplace[FileNameJoin[{appName, str}], "\\" -> "/"]}, 
      "SearchTextTranslated" -> "", "LinkTrails" -> ""}];
   NotebookSave[nb];
   NotebookClose[nb];
   DocumentationSearch`AddDocumentationNotebook[index, nbs[[i]]];, {i,
     Length@nbs}];
  Do[If[DirectoryQ[dirs[[i]]], str = FileNameDrop[dirs[[i]], {1, num}];
    Print[
     Row[{Style["Adding from: ", "MSG", Black], 
       Style[str, "MSG", Gray]}]];
    FormatDoc[dirs[[i]], last, num, appName, pacFile, index];], {i, 
    Length@dirs}]]
AddDocs[appName_] := 
 Module[{appDir, appDocs, dirs, pacFile, index, indexDir, str, num}, 
  appDir = FileNameJoin[{$UserBaseDirectory, "Applications"}];
  appDocs = 
   FileNameJoin[{appDir, appName, "Documentation", "English"}];
  indexDir = FileNameJoin[{appDocs, "Index"}];
  dirs = FileNames[appDocs <> "/*"];
  If[Length@dirs == 0, 
   Print[Style["There are no documents to add... ", "MSG", Orange]];
   Return[]];
  Print[Row[{Style["Working in: ", "MSG", Black], 
     Style[appDocs, "MSG", Red]}]];
  num = Length@FileNameSplit[appDocs];
  index = 
   DocumentationSearch`NewDocumentationNotebookIndexer[indexDir];
  pacFile = OpenWrite[FileNameJoin[{appDir, appName, "PacletInfo.m"}]];
  WriteString[pacFile, "Paclet[
                Name -> \"" <> appName <> "\",
                Version -> \"5.2.0\",
                MathematicaVersion -> \"7+\",
                Extensions -> {
                    {
                        \"Kernel\",
                        \"Context\" -> {
                        }
                    },
                    {
                        \"Documentation\",
                        Language -> \"English\",
                        LinkBase -> \"" <> appName <> "\",
                        Resources -> {\n"];
  Do[If[DirectoryQ[dirs[[i]]], str = FileNameDrop[dirs[[i]], {1, num}];
    Print[
     Row[{Style["Adding from: ", "MSG", Black], 
       Style[str, "MSG", Gray]}]];
    FormatDoc[dirs[[i]], i == Length@dirs, num, appName, pacFile, 
     index];], {i, Length@dirs}];
  WriteString[pacFile, "\t\t\t}
                }
            }
          ]\n"];
  Close[pacFile];
  DocumentationSearch`CloseDocumentationNotebookIndexer[index];
  PacletManager`RestartPacletManager[];]

如何使用它:

在一个新文档或您评估函数的同一文档中,首先找出这个变量是什么:

$UserBaseDirectory

在我的例子中,因为我使用的是Mac OS XI,所以得到:

/Users/jmlopez/Library/Mathematica

找出你的变量是什么。在此目录中,您应该会看到文件夹 Applications。在 Applications 内创建用于放置 MMA5 文档的文件夹。我将我的文件夹命名为 MMA5,因为它很短,但您可以给它任何您想要的名称,对于 Alexey,我们可以将其称为 LegacyDocumentation。在此文件夹内传输 MMA5 安装目录中名为 Documentation 的文件夹的副本。

我们快完成了。现在调用函数AddDocs。该函数仅采用一个参数:我们希望添加其文档的应用程序的名称。就我而言,由于我将文件夹命名为 MMA5,因此我将按如下方式调用它:

AddDocs["MMA5"]

接下来您应该看到的是一系列笔记本出现和消失以及一系列正在打印的消息。以下是该消息序列的一部分:

Output

由于 MMA5 的文档相当广泛,因此此过程将需要一段时间。我对这个函数做了一个计时,它说大约需要 40 秒(对我来说似乎更长)。

你完成了。 MMA5 的文档现在应该可以在文档中心找到。

试驾

假设您希望查找有关 DSolve 的一些信息。如果您搜索 DSolve,您会看到以下内容:

DSolve MM8

查找 MMA5 文档我们需要点击“搜索包含 DSolve 的所有页面”中的 DSolve 链接。现在我们得到这样的东西:

DSolve MM5

在上面的屏幕截图中,我用红色标记了允许我们访问的条目Mathematica 5 文档。我无法为文档中的每个文件编写一个很好的摘要,因此我只是让 Mathematica 编写位于笔记本中的 CellTags 。这就是您看到字符串列表的原因。

如果您单击第一个红色条目,这就是我们获得的

Jackpot

这样您就得到了遗留文档的工作副本致力于新版本的 Mathematica。我还没有在 MMA7 中测试过这个,但我感觉它会起作用。如果有人尝试这样做,请告诉我。

注意

如果您想将其应用于不同应用程序中的其他文档。您需要注意这一点:

    WindowTitle -> 
     "Mathematica 5.2 | " <> FileNameDrop[str] <> " | " <> title,
    TaggingRules -> {
      "ModificationHighlight" -> False,
      "Metadata" -> {
        "context" -> appName <> "`",
        "keywords" -> tags,
        "index" -> True,
        "label" -> "Mathematica 5.2 | " <> FileNameDrop[str],
        "language" -> "en",
        "paclet" -> appName,
        "status" -> "",
        "summary" -> ToString@tags,
        "synonyms" -> {},
        "title" -> title,
        "windowtitle" -> title,
        "type" -> "Doc",
        "uri" -> 
         StringReplace[FileNameJoin[{appName, str}], "\\" -> "/"]
        },

请注意,我在标签中硬编码了“Mathematica 5.2”。如果需要,您甚至可以将其更改为“LegacyDocumentation”。这只是一个标签。另一个重要的一点是
关键字。我已将 keywords 设置为变量 tags。笔记本中的每个单元格都可以选择添加CellTags。如果您要编写一些文档,则应该使用它们。我就利用这个让文档中心知道如何查找文档。这是我最近才学到的东西,我一定会在一个包中实现。

如果您想编写一个完整的应用程序及其文档,我建议您查看我的帖子 将笔记本集成到 MMA 文档中心。在这里您将找到更多信息,让您了解我在此处提供的功能如何工作。

最后,我想补充一点,我也在 Windows 机器中对此进行了测试,并且运行良好,这就是这行代码背后的原因:

StringReplace[FileNameJoin[{appName, str}], "\\ “-> "/"]

编辑:

我更改了该函数,以便它可以在 MMA7 中正确工作。结果 pacletInfo.m 文件需要包含行 MathematicaVersion ->; 7+,以便它可以在 MMA7 和 MMA8 中工作。

编辑2:

我在复制和粘贴该函数时犯了一个错误。现在应该修复了。如果您同时拥有 MMA7 和 MMA8,我建议仅在 MMA7 中运行一次。这样,MMA7 和 MMA8 都可以使用该文档。

WARNING: I recently learned that building the index for new documentation can have undesired effects in a windows machine. Please read Alexey's comments for more details. As far as I can tell, everything is working fine in Mac OS X. I'll give an update once I determine what the source of the problem is.

Here I present a function to allow any notebook to become part of the documentation center in Mathematica 8. You can start by letting Mathematica evaluate the following:

Clear[FormatDoc, AddDocs];
FormatDoc[dir_, last_, num_, appName_, pacFile_, index_] := 
 Module[{dirs, nbs, nb, str, comma = ",", title, tags}, 
  nbs = FileNames[dir <> "/*.nb"];
  dirs = FileNames[dir <> "/*"];
  Do[If[last && i == Length@nbs, comma = ""];
   str = FileNameDrop[nbs[[i]], {1, num}];
   title = StringDrop[FileNameTake[nbs[[i]]], -3];
   Print[Row[{Style["Adding: ", "MSG", Black], 
      Style[str, "MSG", Blue]}]];
   str = StringDrop[str, -3];
   WriteString[pacFile, 
    "\t\t\t\t\"" <> str <> "\"" <> comma <> "\n"];
   nb = NotebookOpen[nbs[[i]]];
   tags = 
    DeleteDuplicates@
     Flatten@Map[#[[2]] &, 
       Cases[NotebookGet[
         nb], (_Dummy | (CellTags -> _)), \[Infinity]]];
   SetOptions[nb, 
    DockedCells -> 
     FEPrivate`FrontEndResource["FEExpressions", "HelpViewerToolbar"],
     Saveable -> False, 
    WindowTitle -> 
     "Mathematica 5.2 | " <> FileNameDrop[str] <> " | " <> title, 
    TaggingRules -> {"ModificationHighlight" -> False, 
      "Metadata" -> {"context" -> appName <> "`", "keywords" -> tags, 
        "index" -> True, 
        "label" -> "Mathematica 5.2 | " <> FileNameDrop[str], 
        "language" -> "en", "paclet" -> appName, "status" -> "", 
        "summary" -> ToString@tags, "synonyms" -> {}, 
        "title" -> title, "windowtitle" -> title, "type" -> "Doc", 
        "uri" -> 
         StringReplace[FileNameJoin[{appName, str}], "\\" -> "/"]}, 
      "SearchTextTranslated" -> "", "LinkTrails" -> ""}];
   NotebookSave[nb];
   NotebookClose[nb];
   DocumentationSearch`AddDocumentationNotebook[index, nbs[[i]]];, {i,
     Length@nbs}];
  Do[If[DirectoryQ[dirs[[i]]], str = FileNameDrop[dirs[[i]], {1, num}];
    Print[
     Row[{Style["Adding from: ", "MSG", Black], 
       Style[str, "MSG", Gray]}]];
    FormatDoc[dirs[[i]], last, num, appName, pacFile, index];], {i, 
    Length@dirs}]]
AddDocs[appName_] := 
 Module[{appDir, appDocs, dirs, pacFile, index, indexDir, str, num}, 
  appDir = FileNameJoin[{$UserBaseDirectory, "Applications"}];
  appDocs = 
   FileNameJoin[{appDir, appName, "Documentation", "English"}];
  indexDir = FileNameJoin[{appDocs, "Index"}];
  dirs = FileNames[appDocs <> "/*"];
  If[Length@dirs == 0, 
   Print[Style["There are no documents to add... ", "MSG", Orange]];
   Return[]];
  Print[Row[{Style["Working in: ", "MSG", Black], 
     Style[appDocs, "MSG", Red]}]];
  num = Length@FileNameSplit[appDocs];
  index = 
   DocumentationSearch`NewDocumentationNotebookIndexer[indexDir];
  pacFile = OpenWrite[FileNameJoin[{appDir, appName, "PacletInfo.m"}]];
  WriteString[pacFile, "Paclet[
                Name -> \"" <> appName <> "\",
                Version -> \"5.2.0\",
                MathematicaVersion -> \"7+\",
                Extensions -> {
                    {
                        \"Kernel\",
                        \"Context\" -> {
                        }
                    },
                    {
                        \"Documentation\",
                        Language -> \"English\",
                        LinkBase -> \"" <> appName <> "\",
                        Resources -> {\n"];
  Do[If[DirectoryQ[dirs[[i]]], str = FileNameDrop[dirs[[i]], {1, num}];
    Print[
     Row[{Style["Adding from: ", "MSG", Black], 
       Style[str, "MSG", Gray]}]];
    FormatDoc[dirs[[i]], i == Length@dirs, num, appName, pacFile, 
     index];], {i, Length@dirs}];
  WriteString[pacFile, "\t\t\t}
                }
            }
          ]\n"];
  Close[pacFile];
  DocumentationSearch`CloseDocumentationNotebookIndexer[index];
  PacletManager`RestartPacletManager[];]

How to use it:

In a new document or the same one where you evaluated the functions start by finding out what this variable is:

$UserBaseDirectory

In my case, since I'm using Mac OS X I get:

/Users/jmlopez/Library/Mathematica

Find out what yours is. In this directory you should see the folder Applications. Inside Applications create the folder where you will be placing the MMA5 documentation. I named my folder MMA5 because it is short but you can give it any name you want, in the case of Alexey we can call it LegacyDocumentation. Inside this folder transfer a copy of the folder named Documentation found in the installation directory for MMA5.

We are almost done. Now call the function AddDocs. This function takes only one argument: The name of the application whose documentation we wish to add. In my case, since I named the folder MMA5 I will call it as follows:

AddDocs["MMA5"]

The next thing you should see is a sequence of notebooks appearing and disappearing as well as a sequence of messages being printed. Here is part of that sequence of messages:

Output

Since the documentation of MMA5 is quite extensive this process will take a while. I did a timing on this function and it said it took about 40 seconds (It seemed a lot longer to me).

You are done. The documentation of MMA5 should now be available in the documentation center.

Test Drive

Say you wish to look up some information on DSolve. If you search for DSolve you see the following:

DSolve MM8

To look up for the MMA5 documentation we need to click on the link for DSolve located in "Search for all pages containing DSolve". Now we obtain something like this:

DSolve MM5

In the above screenshot I have marked in red the entries that give us access to the Mathematica 5 documentation. I have no way of writing a nice summary for each of the files in the documentation so I just made Mathematica write the CellTags located in the notebooks. This is why you see a list of strings.

If you click on the first red entry this is what we obtain

Jackpot

So there you have it, a working copy of legacy documentation working on the new version of Mathematica. I have not tested this in MMA7 but I have a feeling it would work. If someone tries this please let me know.

NOTES

If you want to apply this to other documents in a different application. You need to pay attention to this:

    WindowTitle -> 
     "Mathematica 5.2 | " <> FileNameDrop[str] <> " | " <> title,
    TaggingRules -> {
      "ModificationHighlight" -> False,
      "Metadata" -> {
        "context" -> appName <> "`",
        "keywords" -> tags,
        "index" -> True,
        "label" -> "Mathematica 5.2 | " <> FileNameDrop[str],
        "language" -> "en",
        "paclet" -> appName,
        "status" -> "",
        "summary" -> ToString@tags,
        "synonyms" -> {},
        "title" -> title,
        "windowtitle" -> title,
        "type" -> "Doc",
        "uri" -> 
         StringReplace[FileNameJoin[{appName, str}], "\\" -> "/"]
        },

Notice that I have hardcoded "Mathematica 5.2" in the label. You may even want to change this to "LegacyDocumentation" if you want. This is just a label. Another important point is
the keywords. I have set keywords to the variable tags. Every cell in a notebook has the option to add CellTags. If you are going to write some documentation you should use them. I have taken advantage of this to let the documentation center know how to search for the documents. This is something I have just recently learned and I will definitely implement in a package.

If you ever feel like writing a complete application with its documentation I suggest you take a look at my post integrating notebooks to MMA doc center. Here you will find more information that will let you figure out how the functions I have provided here work.

As a final note I'd like to add that I have also tested this in windows machine and it worked fine, that's the reason behind this line of code:

StringReplace[FileNameJoin[{appName, str}], "\\" -> "/"]

EDIT:

I changed the function so that it can correctly work in MMA7. Turns out that the pacletInfo.m file needs to have the line MathematicaVersion -> 7+ so that it can work in MMA7 and MMA8.

EDIT 2:

I made a mistake while copying and pasting the function. It should be fixed now. If you have both MMA7 and MMA8, I suggest running it only once in MMA7. That way the documentation will be available to both MMA7 and MMA8.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文