File: caption.adoc

package info (click to toggle)
ruby-asciidoctor-pdf 2.3.19-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,972 kB
  • sloc: ruby: 44,316; sh: 133; java: 45; makefile: 4
file content (152 lines) | stat: -rw-r--r-- 3,136 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
= Caption Category Keys
:description: Reference list of the available global caption category keys and their value types.
:navtitle: Caption
:source-language: yaml

The keys in the `caption` category control the arrangement and style of block captions globally.
Many of these keys can be customized <<per-block,per block>>.

[#caption]
== caption

TIP: The `caption-align` and `caption-text-align` keys on the `image` and `table` categories also accept the value `inherit`.
See xref:block-images.adoc[] and xref:tables.adoc[] for more information about setting `inherit` on their captions.

[cols="3,4,5a"]
|===
|Key |Value Type |Example

|align
|xref:blocks.adoc#align[Block alignment] +
(default: `left`)
|[source]
caption:
  align: right

|background-color
|xref:color.adoc[Color] +
(default: _not set_)
|[source]
caption:
  background-color: #DDDDDD

|end
|top {vbar} bottom +
(default: _varies by block_)
|[source]
caption:
  end: bottom

|font-color
|xref:color.adoc[Color] +
(default: _inherit_)
|[source]
caption:
  font-color: #333333

|font-family
|xref:font-support.adoc[Font family name] +
(default: _inherit_)
|[source]
caption:
  font-family: M+ 1mn

|font-kerning
|`none` {vbar} `normal` +
(default: _inherit_)
|[source]
caption:
  font-kerning: none

|font-size
|xref:text.adoc#font-size[Font size] +
(default: _inherit_)
|[source]
caption:
  font-size: 11

|font-style
|xref:text.adoc#font-style[Font style] +
(default: `italic`)
|[source]
caption:
  font-style: italic

|margin-inside
|xref:measurement-units.adoc[Measurement] +
(default: `4`)
|[source]
caption:
  margin-inside: 3

|margin-outside
|xref:measurement-units.adoc[Measurement] +
(default: `0`)
|[source]
caption:
  margin-outside: 0

|text-align
|xref:text.adoc#text-align[Text alignment] +
(default: `$<category>-caption-align` or `$caption-align`)
|[source]
caption:
  text-align: right

|text-decoration
|xref:text.adoc#decoration[Text decoration] +
(default: `none`)
|[source]
caption:
  text-decoration: line-through

|text-decoration-color
|xref:color.adoc[Color] +
(default: `$caption-font-color`)
|[source]
caption:
  text-decoration-color: #FF0000

|text-decoration-width
|xref:language.adoc#values[Number] +
(default: `$base-text-decoration-width`)
|[source]
caption:
  text-decoration-width: 0.5

|text-transform
|xref:text.adoc#transform[Text transform] +
(default: _inherit_)
|[source]
caption:
  text-transform: uppercase
|===

[#per-block]
== Caption per block

In addition to the global `caption` category, each of the keys listed in <<caption>>, except for the `text-decoration` keys, can be set on the caption key nested inside the following block categories:

* `code`
* `description-list`
* `example`
* `footnotes`
* `image`
* `list` (applies to ulist and olist)
* `quote`
* `table`
* `verse`

For example, to configure the caption just for code blocks, use the following declaration:

[,yaml]
----
code:
  caption:
    background-color: #FF0000
    font-color: #FFFFFF
    font-size: 1em
    font-style: bold
----

If a key is not specified on a block category, the key from the global `caption` category will be used as a fallback.