Style Extension

The style extension exists to apply, as the name suggests, style to markdown text via the "style" command. The list of available configuration options is provided in Table 1.

Extension Configuration

Table 1: Available configure options for the StyleExtension object.

KeyDefaultDescription
activeTrueToggle for disabling the extension. This only changes the initial active state, use setActive to control at runtime.

Style Command

Style can be applied to blocks of text via the block versions of the "style" command. For example, to center text horizontally use the "halign" setting as follows.

Example 1: Example use of "style" command for a block of text.

!style halign=center
This text should be centered.

This text should be centered.

Example 2: Example use of "style" command for a block of text with multiple paragraphs.

!style! halign=center
This text should be centered.

As should this text.
!style-end!

This text should be centered.

As should this text.

Inline text may also be styled, for example the following creates colored text within a box.

Example 3: Example use of "style" command for inline text.

It is possible to create [!style color=red border=2](red text within a box) using the "style"
command.

It is possible to create red text within a box using the "style" command.

The complete list of available settings is provide in Table 2.

Table 2: Available settings for the 'style' command.

KeyDefaultDescription
styleNoneThe style settings that are passed to rendered HTML tag.
classNoneThe class settings to be passed to rendered HTML tag.
idNoneThe class settings to be passed to the rendered tag.
halignNoneThe horizontal alignment ('center', 'left', or 'right')
borderNoneThe size of the border in pixels
colorNoneSet the color of content.
fontsizeNoneSet the font size.
fontweightNoneSet the font weight.