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.

On this page:

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: =like this=.

  • Use ==double equal signs== for bold: bold mono.

  • To display colored text, enter:__ %RED% red text %ENDCOLOR% and %GREEN% green text %ENDCOLOR% to get red text and green text .
    • %% text must end with %ENDCOLOR%. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%.
    • DefaultPreferences defines some commonly used colors: %YELLOW%, %RED%, %PINK%, %PURPLE%, %TEAL%, %NAVY%, %BLUE%, %AQUA%, %LIME%, %GREEN%, %OLIVE%, %MAROON%, %BLACK%, %GRAY%, %SILVER% and %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 %TOC% wherever you like on a page (see System.Macros for more %TOC% options).

  • Use ==
    == 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 =<filename>= is not displayed. How can I show it as it is?
          * *A:* The ='<'= and ='>'= characters have a special meaning in HTML, they define HTML tags. You need to escape them, so write ='<'= instead of ='<'=, and ='>'= instead of ='>'=. <br /> Example: Type ='prog <filename>'= to get ='prog <filename>'=.
    
       * *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. ='&copy;'= is the =©= copyright character. You need to escape ='&'= to see it as it is, so write ='&amp;'= instead of ='&'=. <br /> Example: Type ='This &amp; that'= to get ='This & that'=.
    
    ---
    
    *Related Topics:* WYSIWYG
    

This topic: System > Category > UserDocumentationCategory > TopicMarkupLanguage
Topic revision: 17 Oct 2025, FayazMohammed
This site is powered by FoswikiCopyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback