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();
Link color
Controls the color of a link
name | linkColor |
type | @ColorInt int |
default | Default 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
name | blockMargin |
type | @Px int |
default | 24dp |
Block quote
Customizations for the blockquote
stripe
Quote
Stripe width
Width of a blockquote stripe
name | blockQuoteWidth |
type | @Px int |
default | 1/4 of the block margin |
Stripe color
Color of a blockquote stripe
name | blockQuoteColor |
type | @ColorInt int |
default | textColor 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
- OL
name | listItemColor |
type | @ColorInt int |
default | Text color |
Bullet item stroke width
Border width of a bullet list item (level 2)
- First
- Second
- Third
name | bulletListItemStrokeWidth |
type | @Px int |
default | Stroke width of TextPaint |
Bullet width
The width of the bullet item
- First
- Second
- Third
- Second
name | bulletWidth |
type | @Px int |
default | min(blockMargin, lineHeight) / 2 |
Code
Inline code text color
The color of the code
content
name | codeTextColor |
type | @ColorInt int |
default | Content text color |
Inline code background color
The color of background
of a code content
name | codeBackgroundColor |
type | @ColorInt int |
default | inline code text color with 25 (0-255) alpha |
Block code text color
The color of code block text
name | codeBlockTextColor |
type | @ColorInt int |
default | inline code text color |
Block code background color
The color of background of code block text
name | codeBlockBackgroundColor |
type | @ColorInt int |
default | inline code background color |
Block code leading margin
Leading margin for the block code content
name | codeMultilineMargin |
type | @Px int |
default | 8dip |
Code typeface
Typeface of code content
name | codeTypeface |
type | android.graphics.Typeface |
default | Typeface.MONOSPACE |
3.0.0
Block code typefaceTypeface of block code content
name | codeBlockTypeface |
type | android.graphics.Typeface |
default | codeTypeface if set or Typeface.MONOSPACE |
Code text size
Text size of code content
name | codeTextSize |
type | @Px int |
default | (Content text size) * 0.87 if no custom Typeface was set, otherwise (content text size) |
3.0.0
Block code text sizeText size of block code content
name | codeBlockTextSize |
type | @Px int |
default | codeTextSize 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
name | headingBreakHeight |
type | @Px int |
default | Stroke width of context TextPaint |
Break color
The color of a brake under H1 & H2
name | headingBreakColor |
type | @ColorInt int |
default | (text color) with 75 (0-255) alpha |
1.1.0
TypefaceThe typeface of heading elements
name | headingTypeface |
type | android.graphics.Typeface |
default | default text Typeface |
1.1.0
Text sizeArray of heading text sizes ratio that is applied to text size
name | headingTextSizeMultipliers |
type | float[] |
default | {2.F, 1.5F, 1.17F, 1.F, .83F, .67F} (HTML spec) |
Thematic break
Color
Color of a thematic break
name | thematicBreakColor |
type | @ColorInt int |
default | (text color) with 25 (0-255) alpha |
Height
Height of a thematic break
name | thematicBreakHeight |
type | @Px int |
default | Stroke width of context TextPaint |