How to run the standalone Madoko editor in a web browser without internet connection?

Dec 18, 2014 at 12:02 AM
The reference manual says
"Madoko can also run inside a web browser or as a .NET executable. "

That's all I can find so far from the documentation. I am a novice user (node.js, npm are all new to me). I cannot figure out how the standalone Madoko editor can be run in a web browser without internet connection.

Any instructions would be very much appreciated. Thanks.
Coordinator
Dec 18, 2014 at 1:26 AM
Hi, I will try to clarify the manual about this. Anyway,
  • There is the standard Madoko command line tool that you can install through npm install -g madoko. This tool is also available as a web-component and
    a .NET executable. However, it is just a render engine -- it has no editor, preview, cloud connection etc.
  • There is Madoko.net -- this is a full editor, preview, cloud connection, etc. and internally uses the Madoko core engine to render a preview on-the-fly. Since this is a HTML5 web-application it also works when you are offline. of course, in off-line mode you cannot access your cloudstorage but otherwise the editor and preview etc. works fine.
Hope that helps,
-- Daan
Dec 18, 2014 at 5:10 PM
Hi @Daan

Thanks for creating Madoko. I like very much the on-the-fly preview of the reveal.js-based presentation and the ways to customize the presentation. It would be even better if the Madoko editor can be used offline. Do you have a plan, or even a timeline, to make the Madoko editor available as a standalone app, such as the two editors below?

StackEdit
offline app for both Firefox and Chrome:
https://chrome.google.com/webstore/detail/stackedit/iiooodelglhkcpgbajoejffhijaclcdg?hl=en
online version: https://stackedit.io/

Marxico
offline Chrome app:
https://chrome.google.com/webstore/detail/marxico/kidnkfckhbdkfgbicccmdggmpgogehop?hl=en
online version: http://marxi.co/

Thanks.
Andrew
Coordinator
Dec 18, 2014 at 5:44 PM
Hi @acatyim,

Thanks :-)

Just to clarify, the madoko.net editor already has a manifest and already works off-line. Try it out -- just open https://www.madoko.net/editor.html when off-line and you should be able to continue working on the last document you were editing.

Of course, being off-line means you cannot sync with the cloud or generate PDF's through the LaTeX server but otherwise everything should work.

Now, it would be nice to package madoko too as a 'chrome app' as the above examples do -- thanks for the pointers; it seems quite easy to do this packaging.
Dec 18, 2014 at 7:01 PM
Thanks for your reply, Daan.

StackEdit and Marxico can do on-the-fly preview of equations even in offline mode. But Madoko does not seem to be able to. Is there a simple way, like a meta data reference, to point Madoko to a local MikTeX installation so that it can also generate offline equation preview on the fly? And if so, can it generate offline preview of a reveal.js installation when pointed to the local installation?
Coordinator
Dec 18, 2014 at 8:50 PM
All other markdown processors are very limited in LaTeX support since they all use MathJax to render the math; that will not do for a serious academic paper with, say, TikZ figures or lots of math definitions.

But for simple math, you can also use MathJax in Madoko and that will work in offline mode too (if you have loaded it once). Just add the following metadata keys to your document:
Math Mode: dynamic
MathJax     : true
Madoko cannot use local installs since it runs in a webbrowser which does not give access to the local file system. However, I am planning to release a npm package that would allow you to run a Madoko server locally where you can use your own local LaTeX.

btw. you can generate a presentation that uses a local install of revealjs: just set the Reveal Url to something local, like . -- it won't work in the preview but the generated HTML file will have all those local references in it.
Dec 18, 2014 at 10:10 PM
Excellent, thanks.
Dec 19, 2014 at 4:45 PM
@daan, please consider the following metadata key and value with regard to the possibility of introducing different modes (Issue 13):
LaTeX offline-preview default:
    Math Mode  : dynamic
    MathJax       : true
Presentation html-output:
    Reveal Url    : ../reveal.js
(Because .mdk files are stored in a folder of the same name, it seems to make sense to have the local reveal.js folder placed in the same directory where other mdk document folders would be saved and use ../reveal.js to override the html-preview default https://cdn.jsdelivr.net/reveal.js/2.6.2 for generating html output slides.)

Thanks for your consideration.
Coordinator
Dec 19, 2014 at 4:50 PM
Ha, great idea to have an "offline" mode! Thanks!. And also to be able to combine modes! I will definitely add these things :-)

For now, I just pushed an update that has a 'preview' mode, and negated modes by prefixing with "no". So you can have a rule:
@nopreview Reveal Url: ../reveal.js
as an aside, I am fairly hesitant to follow pandocs full Yaml syntax for metadata; currently I use the much simpler multimarkdown approach which seems more in the spirit of markdown (although I admit that the mode keys are a fairly advanced thing)