asciidoctor / brackets-asciidoc-preview

Live Preview of AsciiDoc for Adobe Brackets
MIT License
51 stars 16 forks source link

Print/Export/Open in new browser window #14

Closed kurtharriger closed 9 years ago

kurtharriger commented 9 years ago

If I right click on preview the Print option is disabled. There is a view source link but it doesn't seem to do anything.

I'm looking for an easy way to edit and preview documents containing typeset math. I've found editing html with mathjax seem to work really well. I typically use the browser to print to pdf and add a few page break tags and some print media queries where I need them.

I'm not very familiar with asciidoc, but it seems more semantically rich and this extension for brackets makes it almost perfect... except that I can't export/print or otherwise get the same results outside of brackets using the commandline tools. If I try to run asciidoc outside of brackets it doesn't typeset the math and the fonts and styles are all different. An html export with css would be ideal.

mojavelinux commented 9 years ago

I like the idea. :+1:

To get you going in the interim, I strongly recommend using the Asciidoctor.js Chrome extension. It should provide nearly everything you get with Asciidoctor, including the MathJax integration. The benefit of using that extension for your use case is that printing from the browser should just work (I just verified it with a sample document).

https://chrome.google.com/webstore/detail/asciidoctorjs-live-previe/iaalpfgpbocpdfblpnhhgllgbdbchmia

nerk commented 9 years ago

As it currently stands, Brackets does not support printing at all! Its on the sprint backlog, though. As soon as printing becomes available in Brackets, I'm going to implement printing for the preview extension.

HTML export is a great idea and could be implemented independently. As Dan suggested, using the Chrome extension would be the best workaround for the moment.

mojavelinux commented 9 years ago

Regarding the HTML export, note that Asciidoctor.js does now support creating a full HTML document (header_footer enabled), so you won't even need to call the Ruby version at all.

kurtharriger commented 9 years ago

Thanks for the info on the Chrome Extension!

nerk commented 9 years ago

I am considering to add a menu entry "Show in browser" to the preview pane's popup menu. This will simply launch the system's standard browser with the generated HTML. From the browser, it can then be saved, printed, converted to PDF, etc.

mojavelinux commented 9 years ago

Sounds like a good approach.