Changeset 12859

Show
Ignore:
Timestamp:
03/03/08 17:54:37 (10 months ago)
Author:
peller
Message:

Improve docs and markdown. Refs #5962

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/string.js

    r11695 r12859  
    99dojo.string.pad = function(/*String*/text, /*int*/size, /*String?*/ch, /*boolean?*/end){ 
    1010        // summary: 
    11         //              Pad a string to guarantee that it is at least 'size' length by 
    12         //              filling with the character 'c' at either the start or end of the 
     11        //              Pad a string to guarantee that it is at least `size` length by 
     12        //              filling with the character `ch` at either the start or end of the 
    1313        //              string. Pads at the start, by default. 
    1414        // text: the string to pad 
     
    3232 
    3333dojo.string.substitute = function(      /*String*/template,  
    34                                                                         /*Object or Array*/map,  
     34                                                                        /*Object|Array*/map,  
    3535                                                                        /*Function?*/transform,  
    3636                                                                        /*Object?*/thisObject){ 
     
    4141        //              For example, 
    4242        //              |       dojo.string.substitute("File '${0}' is not found in directory '${1}'.",["foo.html","/temp"]); 
    43         //              |       dojo.string.substitute("File '${name}' is not found in directory '${info.dir}'.",{name: "foo.html", info: {dir: "/temp"}}); 
     43        //              |       dojo.string.substitute("File '${name}' is not found in directory '${info.dir}'.", 
     44        //              |               {name: "foo.html", info: {dir: "/temp"}}); 
    4445        //              both return 
    45         //                      "File 'foo.html' is not found in directory '/temp'." 
     46        //              |       "File 'foo.html' is not found in directory '/temp'." 
    4647        // template:  
    47         //              a string with expressions in the form ${key} to be replaced or 
    48         //              ${key:format} which specifies a format function.  NOTE syntax has 
    49         //              changed from %{key} 
    50         // map: where to look for substitutions 
     48        //              a string with expressions in the form `${key}` to be replaced or 
     49        //              `${key:format}` which specifies a format function. 
     50        // map: hash to search for substitutions 
    5151        // transform:  
    5252        //              a function to process all parameters before substitution takes 
     
    6767        // summary: trims whitespaces from both sides of the string 
    6868        // description: 
    69         //      This version of trim() was taken from Steven Levithan's blog:  
    70         //      http://blog.stevenlevithan.com/archives/faster-trim-javascript. 
    71         //      The short yet good-performing version of this function is  
    72         //      dojo.trim(), which is part of the base. 
     69        //      This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript). 
     70        //      The short yet performant version of this function is  
     71        //      dojo.trim(), which is part of Dojo base. 
    7372        str = str.replace(/^\s+/, ''); 
    7473        for(var i = str.length - 1; i > 0; i--){