Opened 11 years ago

Closed 9 years ago

#2490 closed enhancement (fixed)

Support for modelica:// URIs for scripts in HTML

Reported by: Dietmar Winkler Owned by: Martin Sjölund
Priority: normal Milestone: 1.9.1
Component: OMEdit Version: trunk
Keywords: Cc:

Description (last modified by Dietmar Winkler)

For some time now OMEdit 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 of 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 to specify it in my Library instead.

Change History (8)

comment:1 by Dietmar Winkler, 11 years ago

Description: modified (diff)

comment:2 by Dietmar Winkler, 11 years ago

Description: modified (diff)

comment:3 by Martin Sjölund, 11 years ago

Owner: changed from Adeel Asghar to Martin Sjölund
Status: newassigned

comment:4 by Martin Sjölund, 11 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r18682 (have a look; it was not very hard) :)

comment:5 by Martin Sjölund, 11 years ago

Oh, just remember to put your local mathjax on a diet as the library is huge if you include everything. https://groups.google.com/forum/#!topic/mathjax-users/7lzyzXMw5ek

comment:6 by Dietmar Winkler, 11 years ago

Excellent an especially thanks for the link as I was also recently worried about MathJax huge size.

comment:7 by Dietmar Winkler, 9 years ago

Resolution: fixed
Status: closedreopened

Seems to have been broken again as part of #3311.

comment:8 by Adeel Asghar, 9 years ago

Resolution: fixed
Status: reopenedclosed

Fixed again in c6988d4/OMEdit.

Note: See TracTickets for help on using tickets.