Last modified: 2014-02-15 13:14:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40932, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38932 - Downloadable code blocks (suggestion from IRC)
Downloadable code blocks (suggestion from IRC)
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
master
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy, javascript
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-01 21:50 UTC by Mark Holmquist
Modified: 2014-02-15 13:14 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mark Holmquist 2012-08-01 21:50:40 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
Comment 1 Mark Holmquist 2012-08-01 21:54:27 UTC
Note for later: This is for people on #octave, and the person who asked for it was carandraug+dev@gmail.com (no BZ account)
Comment 2 Tim Landscheidt 2013-03-07 04:04:33 UTC
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.
Comment 3 Tim Landscheidt 2014-02-15 13:14:12 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links