Theme

WARNING

This is documentation for legacy versions. For the most current version click here.

Here is the list of properties that can be configured via MarkwonTheme.Builder class.

TIP

Starting with 3.0.0 there is no need to manually construct a MarkwonTheme. Instead a Plugin should be used:

final Markwon markwon = Markwon.builder(context)
        .usePlugin(new AbstractMarkwonPlugin() {
            @Override
            public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
                builder
                        .codeTextColor(Color.BLACK)
                        .codeBackgroundColor(Color.GREEN);
            }
        })
        .build();

Controls the color of a link

namelinkColor
type@ColorInt int
defaultDefault link color of a context where markdown is displayed *

* TextPaint#linkColor will be used to determine linkColor of a context

Block margin

Starting margin before text content for the:

  • lists
  • blockquotes
  • task lists
nameblockMargin
type@Px int
default24dp

Block quote

Customizations for the blockquote stripe

Quote

Stripe width

Width of a blockquote stripe

nameblockQuoteWidth
type@Px int
default1/4 of the block margin

Stripe color

Color of a blockquote stripe

nameblockQuoteColor
type@ColorInt int
defaulttextColor with 25 (0-255) alpha value

List

List item color

Controls the color of a list item. For ordered list: leading number, for unordered list: bullet.

  • UL
  1. OL
namelistItemColor
type@ColorInt int
defaultText color

Bullet item stroke width

Border width of a bullet list item (level 2)

  • First
    • Second
      • Third
namebulletListItemStrokeWidth
type@Px int
defaultStroke width of TextPaint

Bullet width

The width of the bullet item

  • First
    • Second
      • Third
namebulletWidth
type@Px int
defaultmin(blockMargin, lineHeight) / 2

Code

Inline code text color

The color of the code content

namecodeTextColor
type@ColorInt int
defaultContent text color

Inline code background color

The color of background of a code content

namecodeBackgroundColor
type@ColorInt int
defaultinline code text color with 25 (0-255) alpha

Block code text color

The color of code block text
namecodeBlockTextColor
type@ColorInt int
defaultinline code text color

Block code background color

The color of background of code block text
namecodeBlockBackgroundColor
type@ColorInt int
defaultinline code background color

Block code leading margin

Leading margin for the block code content

namecodeMultilineMargin
type@Px int
default8dip

Code typeface

Typeface of code content

namecodeTypeface
typeandroid.graphics.Typeface
defaultTypeface.MONOSPACE

Block code typeface 3.0.0

Typeface of block code content

namecodeBlockTypeface
typeandroid.graphics.Typeface
defaultcodeTypeface if set or Typeface.MONOSPACE

Code text size

Text size of code content

namecodeTextSize
type@Px int
default(Content text size) * 0.87 if no custom Typeface was set, otherwise (content text size)

Block code text size 3.0.0

Text size of block code content

namecodeBlockTextSize
type@Px int
defaultcodeTextSize if set or (content text size) * 0.87 if no custom Typeface was set, otherwise (content text size)

Heading

Break height

The height of a brake under H1 & H2

nameheadingBreakHeight
type@Px int
defaultStroke width of context TextPaint

Break color

The color of a brake under H1 & H2

nameheadingBreakColor
type@ColorInt int
default(text color) with 75 (0-255) alpha

Typeface 1.1.0

The typeface of heading elements

nameheadingTypeface
typeandroid.graphics.Typeface
defaultdefault text Typeface

Text size 1.1.0

Array of heading text sizes ratio that is applied to text size

nameheadingTextSizeMultipliers
typefloat[]
default{2.F, 1.5F, 1.17F, 1.F, .83F, .67F} (HTML spec)

Thematic break

Color

Color of a thematic break

namethematicBreakColor
type@ColorInt int
default(text color) with 25 (0-255) alpha

Height

Height of a thematic break

namethematicBreakHeight
type@Px int
defaultStroke width of context TextPaint
Last Updated: 8/6/2019, 7:27:20 PM