-
Notifications
You must be signed in to change notification settings - Fork 11
DocBasics
We'll build custom documentation for the function PacletInstall
First we open a template for it:
temp=DocGen["SymbolPage", PacletInstall, Method->"Template"]//CreateDocument
Then we edit the call signatures to be a bit more helpful:
(The differently styled cells are simply inline cells. They will be appropriately converted.)
Next we can play with the details:
Add some examples:
Note the orange brackets—these indicate that we're making examples cells. If you use the wrong cell style you can change it in the "Insert Style"
menu in the top bar. The In-and-Out labels on the left were changed using the "Insert Object"
menu.
Finally we'll change the linked content on the bottom:
And now we can build our page a few ways. The most basic is to just use the "Generate"
button in the top bar and select "Ref Page"
:
If we want more control we can also generate it via the DocGen
function:
DocGen["SymbolPage", Evaluate@temp, CellContext->Notebook]
(*Out:*)
This allows us to directly save this in a different location
DocGen["SymbolPage", Evaluate@temp,
CellContext->Notebook,
Method->{"Save", Directory->$TemporaryDirectory}
]
(*Out:*)
{{"/private/var/folders/9t/tqc70b7d61v753jkdbjkvd640000gp/T/ReferencePages/Symbols/PacletInstall.nb"}}
And we can save without the path extension parts:
fil=
DocGen["SymbolPage", Evaluate@temp,
CellContext->Notebook,
Method->{"Save", Directory->$TemporaryDirectory, Extension->False}
][[1, 1]]
(*Out:*)
"/private/var/folders/9t/tqc70b7d61v753jkdbjkvd640000gp/T/PacletInstall.nb"