r106870 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106869‎ | r106870 | r106871 >
Date:21:37, 20 December 2011
Author:reedy
Status:reverted (Comments)
Tags:
Comment:
For r106521/r106865, wrap long example description strings

Follows up r106439
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiBase.php
@@ -280,11 +280,11 @@
281281 $msg .= " $v\n";
282282 } else {
283283 if ( is_array( $v ) ) {
284 - $msg .= implode( "\n", array_map( array( $this, 'indentExampleText' ), $v ) );
 284+ $msgExample = implode( "\n", array_map( array( $this, 'indentExampleText' ), $v ) );
285285 } else {
286 - $msg .= " $v";
 286+ $msgExample = " $v";
287287 }
288 - $msg .= "\n $k";
 288+ $msg .= wordwrap( $msgExample, 100, "\n" ) . "\n $k";
289289 }
290290 }
291291 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r106878Revert r106870: doesn't seem like it would format things consistently as expe...brion22:05, 20 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106439Prep work for * (bug 33147) API examples should explain what they do...reedy15:28, 16 December 2011
r106521More example conversions/additions...reedy19:10, 17 December 2011
r106865Revert r106521: creates lots of long, unwrappable lines in help outputbrion21:26, 20 December 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   22:04, 20 December 2011

This seems insufficient; URLs and text should probably be consistently on separate lines for clarity.

#Comment by Reedy (talk | contribs)   22:07, 20 December 2011

They do?

Example:
  Purges the "Main Page" and the "API" page
    api.php?action=purge&titles=Main_Page|API
Help page:
  [https://www.mediawiki.org/wiki/API:Purge https://www.mediawiki.org/wiki/API:Purge]
#Comment by Reedy (talk | contribs)   22:08, 20 December 2011

There's probably a couple of extra spaces that should have gone in after the \n on the wordwrap, to make the text align up..

Status & tagging log