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 SpannableTheme
. If you wish to control what
is out of this list, you can use SpannableFactory
abstraction which lets you to gather full control of Spans that are used to display markdown.
SpannableTheme#create(Context)
- creates a default instance of `SpannableBuilder (with defaults registered)SpannableTheme#builder
- creates empty builder with no defaults registeredSpannableTheme#builderWithDefaults(Context)
- create a default instance of builder (with default values registered)
WARNING
SpannbleTheme#builder
method has an unfortunate naming. It should've been emptyBuilder
or builderNoDefaults
because #builder
method returns a builder with no default
theme values registered. To create a builder with default values registered
use SpannableBuilder#builderWithDefaults(Context)
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 |
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) |
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) |
Script ratio
Ratio to be applied for sup
(super script) & sub
(sub script)
name | scriptTextSizeRatio |
type | float |
default | 0.75F |
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 |
Table
Cell padding
Padding inside a table cell
name | tableCellPadding |
type | @Px int |
default | 0 |
Border color
The color of table borders
name | tableBorderColor |
type | @ColorInt int |
default | (text color) with 75 (0-255) alpha |
Border width
The width of table borders
name | tableBorderWidth |
type | @Px int |
default | Stroke with of context TextPaint |
Odd row background
Background of an odd table row
name | tableOddRowBackgroundColor |
type | @ColorInt int |
default | (text color) with 22 (0-255) alpha |
1.1.1
Even row backgroundBackground of an even table row
name | tableEventRowBackgroundColor |
type | @ColorInt int |
default | 0 |
1.1.1
Header row backgroundBackground of header table row
name | tableHeaderRowBackgroundColor |
type | @ColorInt int |
default | 0 |
1.0.1
Task list drawableDrawable of task list item
name | taskListDrawable |
type | android.graphics.drawable.Drawable |
default | ru.noties.markwon.spans.TaskListDrawable |