Is there a function to print the content of the editor (with syntax coloring)?
I guess the default method is to create a window with just the editor content, and print the window. However, I don’t know how to disable the scrolling.
EDIT: I will explore the full screen mode. Probably the way to go…
For Print, it does NOT works with the full screen addon and setting the option viewportMargin: Infinity (to get the full text printed). Since you can only print a browser window, I still need to find a way to remove the scrolling control.
I have problem with the mode argument of CodeMirror.runMode.
When I check the source code of the demo, I see
function doHighlight() {
CodeMirror.runMode(document.getElementById("code").value, "application/xml",
document.getElementById("output"));
}
The second argument for the mode is "application/xml".
In my case, I use the ruby mode. The ruby.js script file is in the same folder as the codemirror.js file. I tried to pass "ruby", "application/ruby", {name: 'ruby'}, but the highlighting does not work (the text itself is correctly transferred to the Div node).