Guidelines for figure authoring - #4813
henrikt-ma wants to merge 1 commit into
Conversation
|
The guidelines seem sensible to me, but I'll wait for other opinions before leaving an approving review in case there are dissenting opinions. |
There was a problem hiding this comment.
Thanks a lot @henrikt-ma valuable work!
Just one minor change: The destination of this link is not found.
<a href="modelica://Modelica.UsersGuide.Conventions.Documentation.Figures">Figures embedded in HTML documentation</a>
After fixing that (I don't know what you wanted to link) I'll approve it!
Anyhow, I'll try to update my PR #4811 following these recommendations.
I suppose this is a link to line 1848 of the same file Modelica/UsersGuide/Conventions.mo. |
| annotation (Documentation(info="<html> | ||
| <p> | ||
| The use of figures in example models shall consider the following guidelines. | ||
| Figures are defined in the <code>figures</code> sub-annotation of the <code>Documentation</code> annotation, explained in detail in <a href=\"https://specification.modelica.org/maint/3.6/annotations.html#annotations-for-figures\">Section 18.2.2 <em>Figures</em> of the Modelica 3.6 specification</a>. |
There was a problem hiding this comment.
| Figures are defined in the <code>figures</code> sub-annotation of the <code>Documentation</code> annotation, explained in detail in <a href=\"https://specification.modelica.org/maint/3.6/annotations.html#annotations-for-figures\">Section 18.2.2 <em>Figures</em> of the Modelica 3.6 specification</a>. | |
| Figures are defined in the <code>figures</code> sub-annotation of the <code>Documentation</code> annotation, explained in detail in | |
| <a href=\"https://specification.modelica.org/maint/3.6/annotations.html#annotations-for-figures\">Section 18.2.2 <em>Figures</em> of the Modelica 3.6 specification</a>. |
| The full specification of the markup is given in the Modelica specification, but things to keep in mind include: | ||
| </p> | ||
| <ol> | ||
| <li>A newline means paragraph break; line breaks within a paragraph are not possible.</li> |
There was a problem hiding this comment.
Is this relevant even when long captions shall be avoided?
|
|
||
| <p> | ||
| When a figure contains multiple plots, let each plot be described by one paragraph in the caption, and start each paragraph with a plain reference to the plot it describes (for example, <code>%(plot:tracking)</code>), followed by one space, and then the paragraph text. | ||
| See <a href=\"modelica://Modelica.Blocks.Examples.PID_Controller\">PID_Controller</a> for an example. |
There was a problem hiding this comment.
Better to have a code snippet here. (Who wants to search for it in PID_Controller?)
There was a problem hiding this comment.
Or both - a code snippet with the paragraphs, and stating is from PID_Controller.
I don't think you need the full plot in the snippet, and thus it makes sense to have a reference for that.
Obviously a code snippet may get out of sync - but I don't think it is too problematic in this case.
| <li><p> | ||
| Conveying the axis unit (not allowed according to the Modelica specification). | ||
| </p></li> | ||
| <li><p> | ||
| As substitute for curve legends, or showing information already present in the curve legends. | ||
| </p></li> | ||
| <li><p> | ||
| Quantity names, for the sake of consistency across the library. | ||
| (Nothing prevents a tool from using <code>quantity</code> attributes of the plotted variables to automatically and consistently present quantity names when no <code>label</code> is given.) | ||
| </p></li> |
There was a problem hiding this comment.
This is just about the code indentation:
| <li><p> | |
| Conveying the axis unit (not allowed according to the Modelica specification). | |
| </p></li> | |
| <li><p> | |
| As substitute for curve legends, or showing information already present in the curve legends. | |
| </p></li> | |
| <li><p> | |
| Quantity names, for the sake of consistency across the library. | |
| (Nothing prevents a tool from using <code>quantity</code> attributes of the plotted variables to automatically and consistently present quantity names when no <code>label</code> is given.) | |
| </p></li> | |
| <li> | |
| Conveying the axis unit (not allowed according to the Modelica specification). | |
| </li> | |
| <li> | |
| As substitute for curve legends, or showing information already present in the curve legends. | |
| </li> | |
| <li> | |
| Quantity names, for the sake of consistency across the library. | |
| (Nothing prevents a tool from using <code>quantity</code> attributes of the plotted variables to automatically and | |
| consistently present quantity names when no <code>label</code> is given.) | |
| </li> |
tobolar
left a comment
There was a problem hiding this comment.
@henrikt-ma Thanks for preparing this valuable guidelines.
My comments
- The Titles and Captions would be necessary even for one figure with just one plot, right? This seems tough to me.
- For Identifiers, a possible recommended simple identifiers could be
fig-i(i=1,..) andplot-i-j(j=1,...)? (and without index where just one figure)
Guidelines for figures are needed now that we are about to add figures to examples on a large scale, as noted in #4811.
Specifically, #4811 (comment) requested that the guidelines should be introduced in a separate PR (this one).
Note that the use of a right$y$ axis is currently not supported by the specification. This is the topic of modelica/ModelicaSpecification#3938.