Function Repository Resource:

 AddDocumentationTools

Source Notebook

Add a toolbar for formatting function documentation to a notebook

Contributed by: Richard Hennigan (Wolfram Research)

ResourceFunction["AddDocumentationTools"][]

adds a documentation toolbar to the current InputNotebook.

ResourceFunction["AddDocumentationTools"][notebook]

adds a documentation toolbar to the NotebookObject notebook.

Details and Options

ResourceFunction["AddDocumentationTools"] adds to any notebook the same toolbar that function resource definition notebooks have under the "Tools" menu.
By default, ResourceFunction["AddDocumentationTools"] will alter the style definitions of the notebook in order to properly display some formatted elements.
To preserve style definitions, use the option "SetStyleDefinitions"→False.
To remove the toolbar, click the button on the right side of the toolbar.

Examples

Basic Examples (1) 

Add a documentation toolbar to a notebook:

In[1]:=
nbo = NotebookOpen[FindFile["ExampleData/document.nb"]]
Out[1]=
In[2]:=
ResourceFunction["AddDocumentationTools"][nbo]
In[3]:=
NotebookClose[nbo]

Scope (1) 

If the notebook already has docked cells, AddDocumentationTools appends the toolbar after the existing cells:

In[4]:=
nbo = CreateNotebook["Testing"]
Out[4]=
In[5]:=
ResourceFunction["AddDocumentationTools"][nbo]
In[6]:=
NotebookClose[nbo]

Options (2) 

By default, the stylesheet of the given notebook is modified in order to display some formatted items correctly:

In[7]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/fb838f71-c55c-4fce-8cd1-d63fe8d36935"]
Out[7]=
In[8]:=
ResourceFunction["AddDocumentationTools"][nbo]
In[9]:=
NotebookClose[nbo]

Use "SetStyleDefinitions"→False to preserve the original stylesheet:

In[10]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/820bb033-8f99-4edb-953c-c99fe41f4bca"]
Out[10]=
In[11]:=
ResourceFunction["AddDocumentationTools"][nbo, "SetStyleDefinitions" -> False]

Note that some items will be missing style definitions (such as delimiters, tables, etc.):

In[12]:=
NotebookClose[nbo]

Version History

  • 1.0.0 – 14 July 2020

Related Resources

License Information