Placeholder

Using placeholders you can control in which way code snippets will be inserted into current page.

$(selection)

This placeholder will be replaced by current selection. It works similar to |...| with one difference: you can not define a default value.

Codesnippet Selected in document Result
<h1>Hello, $(selection)!<h1> (nothing) Hello, !
<h1>Hello, $(selection)!<h1> you Hello, you!
<h1>Hello, |World|!<h1> (nothing) Hello, |World|!
<h1>Hello, |World|!<h1> you Hello, you!

$(selection) should be used in case your code contains '|' chars that should not be interpreted as insertion marks. If $(selection) is defined, '|' chars are ignored.

$(now[;format="format-string"])

Inserts the current date and/or time. Using the optional format string you can specify the format of the result. A complete overview of valid formats can be found on Microsoft. Some examples:

Placeholder Result Comment
$(now) 4/13/2009 Default
$(now;format="d") 4/13/2009 Short date
$(now;format="D") Monday, April 13, 2009 Long date
$(now;format="f") Monday, April 13, 2009 2:12 PM Full date/time (short time)
$(now;format="F") Monday, April 13, 2009 2:12:40 PM Full date/time (long time)
$(now;format="dd.MM.yyyy") 13.04.2009 German date format
$(now;format="MM\/dd\/yyyy") 04/13/2009 US date format

$(prompt:variable)

Defines a variable that content can be set before code snippet is inserted into current page.

Example

To comment my CSS files I use the CSSDoc convention, and the excellent documentation of the YAML-Framework as a real life example. To insert a simple CSS comment in both English and German I have created following code snippet:

/* (en) $(prompt:en) | (de) $(prompt:de) */
$(selection)

When pasting this code snippet into a (CSS) file following dialog appears:

Codesnippets: define variablesAs you can see you can define for each variable an own content.

Note

The code snippet contains one '|' char to split English and German comment. To avoid this char will be interpreted as insertion mark I use $(selection) instead of |...| to insert current selection into code.

 The result would look like this:

/* (en) english comment sample | (de) Beispiel Deutscher Kommentar */

$(clipboard)

Insert text content of the clipboard.