Last modified: 2009-07-19 17:46:05 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 T21681, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19681 - add an explicit action=view_source to present a page's markup
add an explicit action=view_source to present a page's markup
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-13 01:50 UTC by S Page
Modified: 2009-07-19 17:46 UTC (History)
2 users (show)

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


Attachments

Description S Page 2009-07-13 01:50:01 UTC
"Copy markup from page Xyz" is an extremely common instruction when telling people how to make edits in MediaWiki.  Yet this is extremely complicated and prone to error.  If users just visit the page, they don't get the markup, but if you tell users to edit page Xyz, select its markup and copy it, the moment users visit they're presented a UI that doesn't match what you want them to do — it encourages them to edit, tells them to preview, asks for a summary, etc.  It also wastes CPU, MediaWiki renders the page, then renders the complicated editing UI.

Instead MediaWiki should have a dedicated action to view markup.

The code for this action is already present in MediaWiki!  On many wikis, if you view a protected page, the [edit] tab turns into [View source], and if you choose the edit action you're presented with an uneditable text box with the markup and "You can view and copy the source of this page".  See e.g. http://semanticweb.org/index.php?title=MediaWiki:Smw_import_foaf&action=edit  So all that's needed is an action that triggers this behavior, with a slightly different introductory paragraph.  Maybe reuse the optional parameter &preview to show what the markup looks like.

Notes:
* I have a mild preference for action=view_markup because I confuse MediaWiki's "view source" with my browser's "View source", but I don't feel strongly about the terminology.
* action=raw eventually provides the markup of a page, but it's way too user-unfriendly: it triggers a download dialog and "What should Firefox do with this file", and lacks the explanatory "You can view and copy the source of this page".
* http://www.mediawiki.org/wiki/Manual:Creating_pages_with_preloaded_text discusses workarounds for for the specific case of creating a new page from a template, e.g. using the CreateBox extension.
Comment 1 Dan Jacobson 2009-07-13 13:35:21 UTC
Maybe there should be
action=raw&Content-Type=text/plain or
action=raw&content-type=text/plain etc.
or format=text/plain... (sounds like the API)
type of overriding possibilities...
Comment 2 Platonides 2009-07-13 13:45:58 UTC
>It also wastes CPU, MediaWiki renders the page, then renders the
> complicated editing UI.

The editing UI is rendered-client (toolbar et al.). Messages are cached.
It's not a problem.
Comment 3 S Page 2009-07-14 02:28:56 UTC
(In reply to comment #1)
> Maybe there should be
> action=raw&Content-Type=text/plain or
> action=raw&content-type=text/plain etc.
> or format=text/plain... (sounds like the API)
> type of overriding possibilities...

That's a different bug, you're welcome to file it.  This bug requests the same user-friendly, in-wiki presentation of markup that action=edit ''already'' implements (but only when the page is protected).
Comment 4 Splarka 2009-07-14 02:37:25 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > Maybe there should be
> > action=raw&Content-Type=text/plain or
> > action=raw&content-type=text/plain etc.
> > or format=text/plain... (sounds like the API)
> > type of overriding possibilities...
> 
> That's a different bug, you're welcome to file it. 

Bug 8775 "ctype=text/plain" is WONTFIX. See bug for details.
Comment 5 Dan Jacobson 2009-07-14 10:01:39 UTC
And bug2845#c13 says why they don't just use text/plain in the first place.
Comment 6 Brion Vibber 2009-07-19 17:46:05 UTC
Source is available in editing view. There's no benefit to adding a second way to get at the same thing, but arbitrarily restricted.

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


Navigation
Links