Downloading packages in a clean session on textbook and character pages using Mathematica Workbench 2.0

I am developing documentation for a package with Workbench. So far i have used

Quit[]
Needs["mypackage`"]

at the beginning of each textbook. This is because I want a clean global environment and package loading to run simultaneously.

I ran some assemblies and everything worked as expected, but I wonder: is there a better way to have a clean global context and load the context context automatically every time the tutorial is run for my MMA package?

In other words: the transition from one textbook to another or from a textbook back to a regular MMA laptop, is it possible that all the characters defined in the textbook examples will be “forgotten”? On the standard pages of the MMA manual, this is what seems to be happening.

I assume this can be done in the context of a local / laptop.

But how will this work in practice?

thanks for the help

+5
source share
1 answer

For each tutorial, select Evaluation> Notebook default context menu> Unique for this notebook . This will make every laptop a new, unique context. So you don't need Quit[](which seems like a pretty radical method.) There are probably several ways to make sure the cell is Needsrunning, but make it the initialization cell, probably the easiest.

+9
source

All Articles