Last modified: 2014-04-23 13:05:17 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 T62438, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 60438 - CodeEditor should support editing <syntaxhighlight> blocks on a page
CodeEditor should support editing <syntaxhighlight> blocks on a page
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
CodeEditor (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-26 09:16 UTC by Gryllida
Modified: 2014-04-23 13:05 UTC (History)
3 users (show)

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


Attachments

Description Gryllida 2014-01-26 09:16:16 UTC
Script viewer software should support sections and section editing, using one-line comments (or special formatting therein) for heading syntax.

---------------------------------------------

/* Foo */

Foo.prototype.bar = function(){
...
};
Foo.prototype.baz = function(){
...
};

^^^^^ everything above is in the Foo section

/* Foo 2 */ <---------- this becomes a heading

Foo2.prototype.bar = function(){
...
};

Foo2.prototype.baz = function(){
...
};

^^^^^ everything above is in the foo 2 section


---------------------------------------------
Comment 1 Andre Klapper 2014-01-27 11:40:43 UTC
Hi, what is "Script viewer"? Is this [[mw:Extension:CodeEditor]]?
Comment 2 Gryllida 2014-01-27 22:39:47 UTC
Whatever I see when reading or editing [[Special:MyPage/common.js]]. (There is one extension which highlights the code when reading it, and another extension which is responsible for the code editor; I don't know which one this bug falls under, since both of them would have to support editing a section of a JS or CSS script.)
Comment 3 Gryllida 2014-01-27 22:40:18 UTC
(Or Lua script.)
Comment 4 Helder 2014-01-30 11:00:04 UTC
See also
https://bugzilla.wikimedia.org/show_bug.cgi?id=43008#c2
Comment 5 Gryllida 2014-01-30 11:42:55 UTC
https://test.wikipedia.org/wiki/User:Gryllida/common.js
a stupid ugly workaround

https://test.wikipedia.org/wiki/User:Gryllida/afch2/v2
with sections

syntax highlight ok, code-editor does not pick it up
Comment 6 Derk-Jan Hartman 2014-03-25 22:00:46 UTC
Can I ask why ?

I mean a section in Javascript is usually not a self-contained unit, it only has meaning icw all the other stuff. So I'm trying to understand why you would want to edit it in that way. Can you clarify how this helps you to edit code ?
Comment 7 Gryllida 2014-03-26 00:32:44 UTC
There are two reasons behind this.

1) Usually people contain different objects in different files. On wiki, browsing (or simply creating) different files and subfiles of a JS file is far from intuitive. It could make sense to add support for sections.

2) Inline (POD-like) documentation would benefit readability. See i.e. http://juerd.nl/site.plp/perlpodtut .

In other words, CodeEditor should be capable of editing any <source> block on a page without entering edit mode for the entire page. I am renaming the bug title accordingly.
Comment 8 Derk-Jan Hartman 2014-04-23 13:05:17 UTC
We actually have a geshi module that does this in the CodeEditor codebase, but it's only the editor mockup, it's not actually able to make changes to the wikitext right now.

Because you seem to be interested in similar functionality, I have fixed up the module in this patch: https://gerrit.wikimedia.org/r/#/c/127451/

Making it fully work would be quite some additional work still, but it's not as far away as I initially figured. The biggest problem is that we need to make sure not to implement everything a dozen times (live preview, editpage, visual editor and inline code editor).

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


Navigation
Links