%META:TOPICINFO{author="ProjectContributor" date="1460513988" format="1.1" version="1"}%
%META:TOPICPARENT{name="UserDocumentationCategory"}%
---+!! What is Topic Markup Language (!TML)?

The special text format used in Foswiki topics to simplify topic text.

Foswiki lets you work using a WYSIWYG editor, which for most people is the easiest way to enter and edit text. many people prefer typing and editing in plain text (i.e. text without visible formatting), and Foswiki provides a simple formatting language called TML (Topic Markup Language) for this (you don't need to know HTML, though you can use it if you want). Topics are stored in TML, and differences are displayed using it, so it's worth knowing the basics even if you only use WYSIWYG. It's all laid out below.

%TOC{depth="4"}%

---++ Markup Basics

A quick introduction:

   * Separate each *paragraph* with a blank line.

   * To display a *bold type* word or phrase, use asterisks: =*bold type*=.

   * To display an _italic_ word or phrase, use underscores: =_italic_=.

   * To display __bold with italics__ word or phrase, use _double_ underscores: =__bold italic__=.

   * To display a word or phrase in =MONOSPACED TYPE=, use equal signs: =<nop>=like this==.

   * Use =<nop>=<nop>=double equal signs=== for bold: ==bold mono==.

   * To display colored text, enter:__ =%<nop>RED% red text %<nop>ENDCOLOR% and %<nop>GREEN% green text %<nop>ENDCOLOR%= to get %RED% red text %ENDCOLOR% and %GREEN% green text %ENDCOLOR%.
      * =%&lt;color&gt;%= text must end with =%<nop>ENDCOLOR%=. If you want to switch from one color to another one you first need to end the active color with =%<nop>ENDCOLOR%=, e.g. write =%<nop>RED% some text %<nop>ENDCOLOR% %<nop>GREEN% more text %<nop>ENDCOLOR%=.
      * %WIKIPREFSTOPIC% defines some commonly used colors: *%YELLOW% %<nop>YELLOW%%ENDCOLOR%, %RED% %<nop>RED%%ENDCOLOR%, %PINK% %<nop>PINK%%ENDCOLOR%, %PURPLE% %<nop>PURPLE%%ENDCOLOR%, %TEAL% %<nop>TEAL%%ENDCOLOR%, %NAVY% %<nop>NAVY%%ENDCOLOR%, %BLUE% %<nop>BLUE%%ENDCOLOR%, %AQUA% %<nop>AQUA%%ENDCOLOR%, %LIME% %<nop>LIME%%ENDCOLOR%, %GREEN% %<nop>GREEN%%ENDCOLOR%, %OLIVE% %<nop>OLIVE%%ENDCOLOR%, %MAROON% %<nop>MAROON%%ENDCOLOR%, %BLACK% %<nop>BLACK%%ENDCOLOR%, %GRAY% %<nop>GRAY%%ENDCOLOR%, %SILVER% %<nop>SILVER%%ENDCOLOR%* and *%<nop>ENDCOLOR%*.

   * To display headings, type (from the beginning of a line) three dashes (-), from one to six plus signs (+), a space, and your heading text.
      * The quantity of plus signs is related to the size of the heading - the more plus signs you use, the smaller the heading.
      * You can insert a nested table of contents, generated from headings, by placing =%<nop>TOC%= wherever you like on a page (see [[%SYSTEMWEB%.Macros]] for more =%<nop>TOC%= options).

   * Use ==&lt;verbatim&gt;== to enclose code excerpts, filenames, and other unformatted text:<verbatim class="tml">
 <verbatim>
 unformatted text!
 and more of it!
 </verbatim></verbatim>

---++ Formatting text

Full list of text formatting capabilities:

%INCLUDE{"EditingShorthand"}%

---++ Using HTML

%INCLUDE{"UsingHTML"}%

---++ Macros

Macros are names enclosed in percent signs that are that are expanded to some other text when the topic is displayed. For example, =%<nop>TOPIC%= is expanded to %TOPIC%, the title of this topic.

Some macros can take arguments in curly braces - for example, =%<nop>INCLUDE{"OtherTopic" ARG="arg"}%=.

Macros are fully expanded _before_ any of the [[EditingShorthand][text formatting rules]] are applied.

Many macro definitions are built-in, and others ([[%SYSTEMWEB%.PreferenceSettings][preference settings]]) are predefined for your convenience. You can also define your own
[[%SYSTEMWEB%.PreferenceSettings][preference settings]] at the entire site, individual web, or individual topic level. For more information, see *[[Macros]]* Plugins can extend the functionality of Foswiki into many other areas, and often implement new macros. There are a huge number of plugins available from the [[Foswiki:Extensions.WebHome][foswiki site]]. Check on current Plugin status and settings for this site in [[%SYSTEMWEB%.InstalledPlugins]].

---++ Common Editing Errors

Foswiki formatting rules are fairly simple to use and quick to type. However, there are some things to watch out for:

   * *Q:* Text enclosed in angle brackets like =&lt;filename&gt;= is not displayed. How can I show it as it is?
      * *A:* The ='&lt;'= and ='&gt;'= characters have a special meaning in HTML, they define HTML tags. You need to escape them, so write ='&amp;lt;'= instead of ='&lt;'=, and ='&amp;gt;'= instead of ='&gt;'=. <br /> Example: Type ='prog &amp;lt;filename&amp;gt;'= to get ='prog &lt;filename&gt;'=.

   * *Q:* Why is the ='&'= character sometimes not displayed?
      * *A:* The ='&'= character has a special meaning in HTML, it starts a so called character entity, i.e. ='&amp;copy;'= is the =&copy;= copyright character. You need to escape ='&amp;'= to see it as it is, so write ='&amp;amp;'= instead of ='&amp;'=. <br /> Example: Type ='This &amp;amp; that'= to get ='This &amp; that'=.

---
*Related Topics:* WYSIWYG
