standardnotes / math-editor

[Moved to https://github.com/standardnotes/app]
GNU Affero General Public License v3.0
2 stars 5 forks source link

Missing "html-text" and "md" export buttons, and missing render script in export #26

Open jpgill86 opened 3 years ago

jpgill86 commented 3 years ago

Thanks for creating such a wonderful extension for Standard Notes!

The buttons in the top-right, seen in the screenshot on this page, are labeled:

In the desktop app (Windows), I have all of these buttons. However, in the web app (https://app.standardnotes.org/), "html-tex" and "md" are missing. They are absent from mobile (Android) too, but I miss them much more from the web app, which is my preferred platform.


Additionally, if the html-tex output is downloaded on desktop, I get something simple, but which does not render as math when opened in a browser. For example:

<p>This is a simple example: $$y = x^2$$</p>

If the same input is used on Upmath, a script is included that allows the math to render properly:

<script src="https://i.upmath.me/latex.js"></script>
<p>This is a simple example: $$y = x^2$$</p>

Are these differences intentional? What I'd like to be able to do on both desktop and web is have a one-click solution for generating fully portable HTML files with properly rendered math. Right now, I can work around these differences by exporting html-tex from desktop and manually adding the <script> line, but it would be very convenient to have the Upmath experience built into both platforms. I realize Markdown Math ≠ Upmath, but I hope you understand where I'm coming from!

I am using Markdown Math version 1.3.4.

JaspalSuri commented 3 years ago

Hi @jpgill86, thank you for bringing this to our attention. I'll get in touch with our Extensions dev on this. I do not see those buttons on either the web app nor the desktop app for v1.3.4 for the editor. I'll check to see if they were removed recently.

As for the latter issue, I think it has to do with providing some added privacy for users who don't want to load in a script from Upmath's website unknowingly. I'll ask to see if it would be possible to add in some elements to the user interface that would provide this option and communicate it clearly with the user.

jpgill86 commented 3 years ago

@JaspalSuri, thanks for the response!

Another possibility would be to include the JavaScript itself directly in the exported HTML file, making it fully self-contained. Looks like it is published under the MIT License, which I think is even more permissive than this extension's AGPL-3.0 License (I'm not an expert!):

Strange that I see the buttons on desktop but you don't! Are you using Windows too?


Edit: Upon closer inspection, making the exported HTML fully self-contained may require more than just dropping in latex.js, as it seems to reference an external server:

It would still be really nice to make it self-contained though, so that the result is viewable offline for the next 100 years! Something to look into!


Edit 2: Looks like Upmath does all equation rendering server-side, an intentional design decision, so that's not the route to total self-containment. Something like embedded MathJax would be the best alternative.

It also looks like there has been discussion of related issues here: #10, #11.

JaspalSuri commented 3 years ago

Hi @jpgill86, just wanted to let you know that I've created a task for this for our dev team to review, so even if you don't receive a response from us soon, please know that someone will eventually look into this.