Help:Template

Revision as of 14:07, 28 September 2020 by Fhdk (talk | contribs) (Added information on the file content template)

To use a template in any document reference the template and separate arguments with pipes |.

As an example you can create a box to emphasize an important information

{{Important|It is not possible to run `makepkg` as root!}}

Which will give this result in the final document


Info
It is not possible to run `makepkg` as root!


Templates are helpers - they are not the document - so don't over do it.

You can utilize different boxtypes setting both the header and the content


Header
This is a BoxPrimary template
Header
This is a BoxSecondary template
Header
This is a BoxInfo template
Header
This is a BoxSuccess template
Header
This is a BoxWarning template
Header
This is a BoxDanger template
Header
This is a BoxLight template
Header
This is a BoxDark template

The same can be done when you need to describe how to modify an given file's content. This is a little more work but produces a nice result. Because the content of configuration file often if not always include = it is need to use named variables when passing values to the template.

{{File|file=Filename|content=Content}}

The best result is achieved by using the pre inside the content.

~/.profile
# set PATH so it includes user's private bin if it exists
export QT_QPA_PLATFORMTHEME="qt5ct"
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"

export EDITOR=/usr/bin/nano
export VISUAL=/usr/bin/nano