Opened 11 years ago

Last modified 9 years ago

#2490 closed enhancement

Support for modelica:// URIs for scripts in HTML — at Version 1

Reported by: Dietmar Winkler Owned by: Adeel Asghar
Priority: normal Milestone: 1.9.1
Component: OMEdit Version: trunk
Keywords: Cc:

Description (last modified by Dietmar Winkler)

For some time now OM supports MathJax, which is great. Now today I had to add this comment to the Modelica tracker. This lead me to play around with MathJax in my library again. Wouldn't it be great if we could load MathJax.js from a local URI to make the documentation of the library independent on online resources?

Example, instead of writing

<html>
<script type=\"text/javascript\"
  src=\"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">
</script>
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</html>

I would download and store the MathJax.js file locally and then use it like:

<html>
<script type=\"text/javascript\"
  src=\"modelica://MyLib/Resources/Scripts/MathJax.js?config=TeX-AMS-MML_HTMLorMML\"
</script>
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</html>

which means I can ship my library with a MathJax version I know works and don't depend on network connections.

Another step would then be to be able to enable the MathJax rendering globally without having to add the <script>...</script> part into every Modelica file. Could well be a configuration in OMEdit but I would actually prefer it to specify it in my Library instead.

Change History (1)

comment:1 by Dietmar Winkler, 11 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.