Last modified: 2014-02-15 13:14:12 UTC
DokuWiki [0] has downloadable code blocks as a matter of course. It would be cool to have that in SyntaxHighlight. My inkling is that there's very little work to do, since it would basically just be offering a link that would open a new window or so, and put in the new content (the content of the code block). I don't think there's anything complicated that needs to happen. I'll look into this later this week maybe, but if anyone else wants to whack at it for a while, be my guest! [0] https://www.dokuwiki.org/syntax#downloadable_code_blocks
Note for later: This is for people on #octave, and the person who asked for it was carandraug+dev@gmail.com (no BZ account)
The DokuWiki link changed to https://www.dokuwiki.org/wiki:syntax#downloadable_code_blocks; for the use of Gists on blogs, cf. http://www.sandywalsh.com/2011/06/effective-units-tests-and-integration.html. Some thoughts: - Some code blocks should be downloadable, some (snippets?) maybe not. I'd prefer the default to be downloadable. - There's always lots of drama with user-specified filenames on insecure browsers that MediaWiki fosters, so this needs to be checked. - Gists are saved server-side, DokuWiki seems to parse the page on every call which also means that the link may lead to updated (= different) content than shown. I haven't tried it, but data URIs should be performant, stable and supported by enough browsers. Otherwise: Really cool! :-) In many cases, I just want to copy and paste bits of the code block, but often enough I'd like to save the lot and so far have to carefully maneuver the mouse pointer twice and then still face whitespace issues & Co.
(In reply to Tim Landscheidt from comment #2) > [...] > - Gists are saved server-side, DokuWiki seems to parse the page on every > call which also means that the link may lead to updated (= different) > content than shown. I haven't tried it, but data URIs should be performant, > stable and supported by enough browsers. > [...] data URIs work fine, but unfortunately do not bear a "filename", so for example Google Chrome wants to save all data URIs as "Download". So it's probably necessary to imitate Dokuwiki and parse the page again, probably cached.