Template:Code:Basic

From Wikibooks, open books for an open world
Jump to navigation Jump to search
{{{1}}}
{{{2}}}
Purpose
This template matches the styling of more involved two part templates ginned together to write about software languages (Code). It's purpose is theory or narrative exposition and an example below:
Actual Wikibook use example:

As usual, avoid spaces in between the braces. Here's an example that demonstrates how this syntax works:

{{code:Basic|Default value assignment
|<syntaxhighlight lang="bash">$ echo $NEWVAR

$ echo ${NEWVAR:=newval}
newval
$ echo $NEWVAR
newval</syntaxhighlight>}}

As with the default value syntax, the colon is optional.

As usual, avoid spaces in between the braces. Here's an example that demonstrates how this syntax works:

Default value assignment
$ echo $NEWVAR

$ echo ${NEWVAR:=newval}
newval
$ echo $NEWVAR
newval


As with the default value syntax, the colon is optional.