-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unspecified HTML anchor in modelica URI needs clarification #2445
Comments
I would say that this wasn't part of the design, since the specification says:
I don't see any indication that other fragments should be supported in the current specification. Obviously it would still be a good idea to support both layers and parts like this - we just need to avoid ambiguities; and ensure that it goes together with some minor cleanup of Modelica URI schemas that is already planned.. |
If you replace the I don't see a reason why this shouldn't work.
|
|
I agree there are ambiguities for #diagram, #info #text and #icon. In my opinion, we would be fine with defining those to always have the specific meaning of referencing the layers. If you want to use anchors in pages, you can then name them something different. |
I just realized that this is actually a bit more complicated in general: In Dymola (and several other tools) we also generate HTML-files from the documentation (with several options). That implies that we combine documentation-layers from several classes; and in turn that means that if several classes have identical anchors we would need to do something special. Additionally Dymola (don't know about other tools) allow linking to components in diagram, icon and text-layers (the syntax is #diagram$e.f:g,h for selecting components g and h in the sub-component e.f; I'm not saying that the syntax is ideal). It seems as if this sort of corresponds to the anchors in the info-layer in some way - so it would be good if they were considered together. (And then there are the new figures.) And finally we have parts of the generated HTML that it may be natural to link to - e.g. table of parameters. |
In SystemModeler, we don't currently export single HTML pages with multiple class documentation layers in it. We currently only do one page per class, like this: https://reference.wolfram.com/system-modeler/libraries/Modelica/Modelica.html
I agree.
I don't think the specification should get involved in this. |
Yes, when cleaning this up, I think it would be best to not use fragments for the layers. First, we have the obvious risk of collisions with user-defined anchor names. Second, a fragment appears at the end of the URI, but the layer (or figure) is a selection directly on the model. Since a colon is allowed in the path of a URI, we could do something like this instead to link to the anchor with name
This generalizes nicely to hierarchical documentation in the future:
For figures in the future, the fragment could be defined naturally refer to a figure or plot identifier:
|
We do the same in MapleSim. We only export multiple classes per page when generating external documentation (i.e. intended for use in a stand-alone web browser). |
We only export one class per page in that case as well, but I can see why you would like the single page with everything in some scenarios. |
Specifically, in that case we produce one HTML page per package, so the links to non-package classes within the package are all links to anchors. |
Could keep anchors, but:
|
Henrik: Also change predefined fragments from anchor to something else, to avoid ambiguity for figure-fragments. |
Note that "fragment identifier" is the technical name for the id following # https://en.wikipedia.org/wiki/Fragment_identifier Whereas anchor is the anchor-point in the hypertext: https://en.wikipedia.org/wiki/HTML_element#Anchor Closes modelica#2445
* Allow user defined fragments, and state that they may be renamed. Closes #2445 * And follow URI-recommendation and use lower-case ("modelica://") Co-authored-by: Dietmar Winkler <dietmar.winkler@dwe.no>
It does not seem possible to refer to HTML anchors within the modelica URI, see the following proof of concept, which does not work in Dymola 2020, SimulationX 4.0 or WSM 12.
The text was updated successfully, but these errors were encountered: