Documentation Center User Guide
| Searching | Documenting Classes |
| Navigating | Exporting Documentation for Classes |
| Printing | Retrieving Links |
| Viewing Documentation of Classes |
Documentation Center is used to browse the System Modeler documentation and library documentation, as well as browse and edit the embedded documentation of classes. To open Documentation Center, choose Documentation Center from the Help menu.
Viewing the System Modeler Documentation Center.
The orange tile at the top is the main entry point for beginners to get started with System Modeler itself. The yellow tiles contain documentation for modeling, simulation, analysis and deployment of the created models using System Modeler. Next come the green tiles, which embody documentation on the underlying modeling language, i.e. Modelica and Modelica Standard Library, as well as any bundled and additional libraries. In particular, the Modelica Language tile contains a full copy of the book Modelica by Example by Michael M. Tiller. Finally, the blue and gray tiles on the bottom contain links about the integration of the product with the Wolfram Language and various other resources on Modelica.
Searching
The top address bar in Documentation Center also functions as a search bar, allowing you to search in the System Modeler documentation and the Modelica by Example book, as well as in the embedded documentation of the libraries shipped with the product. Search by entering your search term and press Return or click the Search button to the right of the search bar.
To find text on the currently viewed page, use the find bar accessible by pressing Ctrl+F. The find bar will be available at the bottom of the window.
Navigating
Documentation Center keeps a record of all viewed pages. It is possible to go back and forth in this history of visited pages by clicking the Back and Forward buttons on the toolbar. The back and forward mouse buttons can be used as well, if available.
The Back and Forward buttons on the toolbar of Documentation Center.
Click the Home button on the toolbar to go back to the front page of Documentation Center.
The Home button on the toolbar of Documentation Center.
When showing class documentation, the top of Documentation Center also contains a hierarchy where you can click any level of the hierarchy to get to the documentation for that level. If you click the level you are currently showing documentation for, which is the rightmost in the hierarchy, that class is opened in a class window.
Printing
The page currently viewed in Documentation Center can be sent to the printer by pressing Ctrl+P.
Viewing Documentation of Classes
To get information about classes in the Modelica Standard Library or any other documented class in Model Center, right-click the icon of a class in the Class Browser and choose View Class Documentation. It is also possible to get information about classes by right-clicking components in the graphical views or in the component window and choosing View Class Documentation from the popup menu, or by pressing F1.
Clicking the View Class Documentation button on the toolbar in either Model Center or Simulation Center will show the documentation of the currently active class in the Class Window or Experiment Browser.
Pressing F1 will show the documentation for the currently selected class or component, or the currently active class if none is selected. This works in most views.
When viewing the documentation of an example model, a diagram will be shown. Click this diagram to open Simulation Center and simulate the model.
Viewing License Agreements of Installed Libraries
Libraries that are installed from a System Modeler Archive (*.sma file) may contain a license agreement. Such a license agreement can be viewed from the library's documentation page. Select the top-level package of the library in the Class Browser and press F1. If the library has a license agreement, it is linked from within the License section of the page.
Documenting Classes
The documentation for a class consists of information embedded in the class as an annotation (the information and revisions sections) as well as information that is autogenerated by System Modeler, including information about parameters, variables, constants, and components. The documentation provided by annotations can be edited using the edit mode of Documentation Center. While viewing the page you want to edit in the browser, click the Edit button on the toolbar to switch to edit mode; clicking it again will take you back to view mode, where you can see the results of your changes. Note that the edit mode is disabled for read-only classes as these cannot be edited.
The Edit button on the toolbar of Documentation Center.
The default documentation editor is a what-you-see-is-what-you-get (WYSIWYG) editor that lets you edit the information section of the documentation in an environment similar to that of a word processor.
Editing the embedded documentation of a class in the WYSIWYG editor.
The format of the embedded documentation is standard HTML. If you are familiar with HTML, or if you require more control than what is provided by the WYSIWYG editor, you may want to switch to the HTML editor. This is done by clicking the arrow of the Edit button and choosing Edit Information in HTML editor from the drop-down menu for the Information section or Edit Revisions in HTML editor for the Revisions section.
The HTML editor lets you edit the documentation in plain HTML. You may switch back and forth between the editors as well as the editing of the Information and Revisions sections at any time by using the drop-down menu of the Edit button.
Editing the embedded documentation of a class in the HTML editor.
Finding and Replacing Text in the HTML Editor
The find and replace toolbar allows you to search in the HTML editor and to make text substitutions if you wish. To open the find and replace toolbar, press Ctrl+F.
Enter the text you intend to search for in the Find text field. The search is performed while you are typing, and if the text is found, it will be selected in the document. Click the Find Next button or press Return to find the next occurrence of the text or click the Find Previous button to find the previous occurrence. The search automatically continues past the end or start of the document into the unsearched portion. If the text is not found at all, the background color of the text field will turn red.
Clicking the Replace button will substitute the first occurrence of the text you search for with the text entered in the Replace text field. To replace all occurrences of the text, click the Replace All button.
Check the Case sensitive checkbox to restrict the search to look only for occurrences that match the uppercase and lowercase characters you enter. You can also choose to search only for whole words, rather than matching the text as it occurs within words, by checking the Whole word checkbox.
Both the Find and Replace text fields keep a history of previously entered text that persists across sessions. Press the up or down arrow key while in a text field to cycle through its history. The Case sensitive and Whole word settings are also remembered.
Close the find and replace toolbar by clicking the close button or pressing the Esc key.
Images in the Documentation
Images can be included in your documentation as long as they are in an image file format supported by System Modeler: BMP, GIF, JPEG, PNG, SVG and WebP. The Modelica URL protocol (modelica://) is the preferred protocol for referencing image files in HTML. To be able to use a Modelica URL, the Modelica class must first be saved to a *.mo file, and the images to include must be possible to reference using a path relative to that *.mo file.
The easiest way to add images to your documentation is by drag and drop of image files onto the editor or by copying image files and then pasting them where you want them in the editor. This works in both the WYSIWYG and the HTML editors. The result of either operation is an HTML <img> tag with a valid Modelica URL referencing the image.
Links in the Documentation
To create links to the documentation of another Modelica class, format the URL as modelica:// followed by the name of the Modelica class. You can also create links that will open a class window for the specified class. This is done by adding a hash sign (#) and the name of the view to the link. For instance, the link modelica://Modelica.Math.asin#diagram will show the Diagram View of the Modelica.Math.asin class when clicked.
Links to files are most easily created by dropping the files on either the WYSIWYG or HTML editor. The HTML editor also supports creating links to files by copying the files and then pasting them in the editor. As the Modelica URL protocol is used to reference the files, the files must be possible to reference using a path relative to the *.mo file of the class whose documentation is edited.
Modelica links (links that start with modelica://) are handled by Documentation Center, while external links are delegated and opened in your system's default web browser. For example, clicking a link to a Modelica *.mo file referenced with a Modelica URL will load the file into System Modeler, while clicking a link to an external webpage, such as http://www.wolfram.com, will open that page in your system's default web browser.
Exporting Documentation for Classes
Documentation of classes can be exported to HTML. From Documentation Center, this is done by clicking the Share button to the far right inside the top address bar. Choose Save Page as HTML to bring up the Documentation Generator dialog.
The Documentation Generator is also accessible from the main window of Model Center and the Class Browser. To export the documentation of the class of the currently active Class Window, choose File ▶ Export ▶ Class Documentation as HTML from the main window menu. In the Class Browser, you can right-click any class whose documentation you want to export and choose Export ▶ Class Documentation as HTML from the context menu.
The Documentation Generator dialog lets you specify the output directory for the HTML documentation. If your classes use components from other libraries, you can choose to generate links to the documentation pages of these libraries. The documentation for any linked or referenced external libraries will not automatically be generated, but once generated, the links will allow you to navigate among the pages of different libraries. For the links to work, documentation of all interlinked libraries must be generated in the same output directory, or at a later time copied to the same parent directory.
Exporting the documentation of the BioChem library to HTML.
The Documentation Generator is recursive and will generate the documentation for the target class and all of its child classes. This makes it just as easy to generate the documentation for an entire library as for a single example model or component. Note, however, that the generator will never generate documentation for a class at a higher hierarchical level than the level of the target class. This usually means that if only the documentation for a single example model is generated, the components of the model will not be linked to in the generated documentation page of the model if the components are located in another branch of the library.
Retrieving Links
A link to the currently viewed page in Documentation Center can be copied to the clipboard by clicking the Share button inside the top address bar. Select Copy Link from the drop-down menu. A link to an online version of the page can be copied with Copy Link to Online Documentation. To directly open the online version of the current page, click the Open Online Documentation in a Web Browser menu item.