There is one function called refreshPreview()
which, according to the docs,
forces the preview to be updated. This method is only available after run() was called.
So you can probably call that function in the click handler to the button that you will create to control refreshes, for example:
var converter1 = Markdown.getSanitizingConverter();
var editor1 = new Markdown.Editor(converter1);
editor1.run();
editor1.refreshPreview(); //<- something like this
Now as for preventing a refresh on each keydown and keypress events (that's how PageDown does it I guess), I think you have at least two options:
- Write your custom javascript/jquery code that overrides keydown/keypress events for the input text area
Edit file Markdown.Editor.js
(around lines 593-627 in my version) so as to comment out the lines where event handlers are set up for keypress and keydown events. In particular, I think it's the following line that triggers refreshes from key events:
util.addEvent(panels.input, "keydown", handleModeChange);
Hope this helps.