I am looking for an efficient way to transfer the contents of a Mathematica Notebook to a post on this site. It’s extremely tedious to do this copying and pasting cell by cell. I also tried copying and pasting as images, but the resolution is too low.
Does anyone have any suggestions?
Whats needed is an efficient mechanism for importing a nb file, or at the very least, a pdf.
PDF would be much more difficult to implement, NB would be much easier One could make a script that takes a NB file, converts all the sections and so on accordingly, and exports all the images. This would simplify the posting already considerably.
No so much. For example, there is a Wordpress plug-in that displays a pdf on a web page. Something like that would work well here.
You can already convert a Notebook and save it in html format, which saves all the graphics separately and then paste them one by one into the post. That’s what I did. It’s extremely slow, tedious and error-prone. It’s one of the main reasons why I don’t post more articles on the site.
Showing it as PDF is easy yeah, but not so nice, and near impossible to control. I meant converting the PDF back to html; that is much more tricky, unless you’re satisfied by just stills of course
The Wordpress plug-in works very nicely indeed and is trivially easy to use. No need to convert to html. The only downside is that you can’t copy/paste code. For example, see the same article posted as a pdf on my own web site here.
But, I agree, it would be much better if there was a mechanism that allowed you to import a Mathematica Notebook, or cdf, or an embedded link to a Wolfram Cloud object.
I’m quite sure they will never do it though, there are some concerns, difficulties, and limitations:
Potential to have exploits inside PDF files.
It can contain custom fonts that makes the site look very ‘un-even’, all the styles will be more or less random and not standardized. Not to mention different page-sizes, and orientations.
Searching is much more tricky (and slower) in PDF than in plain text.
As you said, copy-paste is tricker, though not impossible
Not each operating system/browser has equal PDF support, and the experience might differ a lot between systems, especially for mobile devices
A lot of people are already incredibly lazy when it comes to making a good post (i.e. I have a problem, please help, here is the notebook). I suspect this will make it even worse
Well, then, I suppose the best solution would be a mechanism to allow the import of an html folder, resolving all the links. Then you can just save a Notebook in html format and upload the html folder created by Mathematica. Easy!