Open MarketingPip opened 11 months ago
Reference for self -
printIframe.contentWindow.document.documentElement
Access HTML document from iframe for exports.
@nightwing looks like you've looked at this before in https://github.com/ajaxorg/ace/issues/1480#issuecomment-20201314; do you have any particular thoughts?
I guess we can add this as a demo and to the playground to make it easier to find, but i don't see a way to integrate this into the main package.
@nightwing - I seen your solution from 2014, but this just seemed like a better updated solution (that appears a few have needed via Google Searches). Tho don't ask me why I had the half baked idea to grab document element lol. We could just write it out as string the have it exportAsHTML.string()
& exportAsHTML.html()````and then a print using the exportAsHTML.html().
Being 2 new API methods. .print() & .exportAsHTML(). I think it would be a nice add to main core / editor.
ps; quick question, wanna give me an example how to get the Ace Editor current mode including caption / extensions etc?
Describe the feature
A easy function to print code from editor / export to html.
Use Case
This is a useful function for the editor. And has been requested / asked how to achieve before via Google and issues...
Proposed Solution
Other Information
Looking for some feedback from the Ace Editor team. (It would be cool if I could contribute it), just looking for some feedback on this solution.
This could also be used as export to HTML function. To properly structure the syntax highlighter as a HTML document.
Notes: print margin does NOT match... And need a better solution for removing gutters preferably via API.
Acknowledgements
ACE version used
1.4.12