Difference between revisions of "Help markup"

From The Battle for Wesnoth Wiki
(update syntax)
(Information on formatting tags)
Line 1: Line 1:
 
== Help Markup ==
 
== Help Markup ==
This page documents the markup used by the [[GUIWidgetInstanceWML#Rich_Label|Rich Label]] widget. This is basically a modified version of the [[https://wiki.wesnoth.org/InterfaceActionsWML#Formatting|Pango markup]] already being used by other GUI2 widgets to show formatted text. Specifically, it adds the ability to add links, tables and images (inline and floating) alongside formatted text.
+
This page documents the markup used by the [[GUIWidgetInstanceWML#Rich_Label|Rich Label]] widget. This is a markup language based on the [[InterfaceActionsWML#Formatting|Pango markup]] already being used by other GUI2 widgets to show formatted text and the earlier GUI1 help markup. Specifically, you can add links, tables and images (inline and floating) alongside formatted text.
 +
 
 +
Both GUI1 style syntax (<code><img>src='path/to/myimage.png'</img></code>) and newer XML style syntax (<code><img src='path/to/myimage.png'/></code>) are supported. The new syntax is recommended. The internal XML parser doesn't support nested tags at the moment (limitation might be removed in the future). Use single quotes inside markup.
  
 
=== Formatting Tags ===
 
=== Formatting Tags ===
 +
* '''bold/b''': Makes the text bold.
 +
* '''italic/i''': Makes the text italic.
 +
* '''underline/u''': Adds an underline to text.
 +
* '''header''': Shows the text formatted as a heading (serif font at size 20 and color white).
 +
* '''span/format''': Applies various types of formatting to the marked up text. Similar to the Pango span tag, but only the following attributes are supported:
 +
** '''face/font_family'''
 +
** '''size/font_size'''
 +
** '''color/fgcolor/foreground'''
 +
** '''bgcolor/background'''
 +
** '''weight'''
 +
** '''style'''
 +
For documentation on these attributes of '''span/format''', please see the [[https://docs.gtk.org/Pango/pango_markup.html#pango-markup|Pango docs]].
  
 
=== Image Tags ===
 
=== Image Tags ===

Revision as of 04:30, 29 July 2024

Help Markup

This page documents the markup used by the Rich Label widget. This is a markup language based on the Pango markup already being used by other GUI2 widgets to show formatted text and the earlier GUI1 help markup. Specifically, you can add links, tables and images (inline and floating) alongside formatted text.

Both GUI1 style syntax (<img>src='path/to/myimage.png'</img>) and newer XML style syntax (<img src='path/to/myimage.png'/>) are supported. The new syntax is recommended. The internal XML parser doesn't support nested tags at the moment (limitation might be removed in the future). Use single quotes inside markup.

Formatting Tags

  • bold/b: Makes the text bold.
  • italic/i: Makes the text italic.
  • underline/u: Adds an underline to text.
  • header: Shows the text formatted as a heading (serif font at size 20 and color white).
  • span/format: Applies various types of formatting to the marked up text. Similar to the Pango span tag, but only the following attributes are supported:
    • face/font_family
    • size/font_size
    • color/fgcolor/foreground
    • bgcolor/background
    • weight
    • style

For documentation on these attributes of span/format, please see the [docs].

Image Tags

Links

Table Tags