UNPKG

11.9 kBYAMLView Raw
1cases:
2 - title: Invalid figure reference without value
3 mdast:
4 type: root
5 children:
6 - type: paragraph
7 children:
8 - type: mystRole
9 name: numref
10 value: my-figure
11 children:
12 - type: crossReference
13 kind: numref
14 identifier: my-figure
15 label: my-figure
16 myst: |-
17 {numref}`my-figure`
18 html: |-
19 <p><span class="reference role unhandled"><code class="kind">{numref}</code><code>my-figure</code></span></p>
20 - title: Invalid figure reference
21 mdast:
22 type: root
23 children:
24 - type: paragraph
25 children:
26 - type: mystRole
27 name: numref
28 value: Figure %s <my-figure>
29 children:
30 - type: crossReference
31 kind: numref
32 identifier: my-figure
33 label: my-figure
34 children:
35 - type: text
36 value: Figure %s
37 myst: |-
38 {numref}`Figure %s <my-figure>`
39 html: |-
40 <p><span class="reference role unhandled"><code class="kind">{numref}</code><code>my-figure</code></span></p>
41 - title: Invalid figure reference with messy label
42 mdast:
43 type: root
44 children:
45 - type: paragraph
46 children:
47 - type: mystRole
48 name: numref
49 value: Figure %s < My - Figure >
50 children:
51 - type: crossReference
52 kind: numref
53 identifier: my - figure
54 label: ' My - Figure '
55 children:
56 - type: text
57 value: Figure %s
58 myst: |-
59 {numref}`Figure %s < My - Figure >`
60 html: |-
61 <p><span class="reference role unhandled"><code class="kind">{numref}</code><code>my - figure</code></span></p>
62 - title: Figure reference with default numref
63 mdast:
64 type: root
65 children:
66 - type: paragraph
67 children:
68 - type: text
69 value: 'see '
70 - type: mystRole
71 name: numref
72 value: my-figure
73 children:
74 - type: crossReference
75 kind: numref
76 identifier: my-figure
77 label: my-figure
78 - type: mystDirective
79 name: figure
80 args: fig.jpg
81 options:
82 name: my-figure
83 value: Cool caption!
84 children:
85 - type: container
86 kind: figure
87 identifier: my-figure
88 label: my-figure
89 children:
90 - type: image
91 url: fig.jpg
92 - type: caption
93 children:
94 - type: paragraph
95 children:
96 - type: text
97 value: Cool caption!
98 myst: |-
99 see {numref}`my-figure`
100
101 ```{figure} fig.jpg
102 :name: my-figure
103
104 Cool caption!
105 ```
106 html: |-
107 <p>see <a href="#my-figure">Figure 1</a></p>
108 <figure id="my-figure" class="numbered">
109 <img src="fig.jpg">
110 <figcaption>
111 <p><span class="caption-number">Figure 1</span>Cool caption!</p>
112 </figcaption>
113 </figure>
114 - title: Figure reference with custom numref
115 mdast:
116 type: root
117 children:
118 - type: paragraph
119 children:
120 - type: text
121 value: 'see '
122 - type: mystRole
123 name: numref
124 value: Figure %s%s%s, I said {number}<my-figure>
125 children:
126 - type: crossReference
127 kind: numref
128 identifier: my-figure
129 label: my-figure
130 children:
131 - type: text
132 value: Figure %s%s%s, I said {number}
133 - type: mystDirective
134 name: figure
135 args: fig.jpg
136 options:
137 name: my-figure
138 value: Cool caption!
139 children:
140 - type: container
141 kind: figure
142 identifier: my-figure
143 label: my-figure
144 children:
145 - type: image
146 url: fig.jpg
147 - type: caption
148 children:
149 - type: paragraph
150 children:
151 - type: text
152 value: Cool caption!
153 myst: |-
154 see {numref}`Figure %s%s%s, I said {number}<my-figure>`
155
156 ```{figure} fig.jpg
157 :name: my-figure
158
159 Cool caption!
160 ```
161 html: |-
162 <p>see <a href="#my-figure">Figure 111, I said 1</a></p>
163 <figure id="my-figure" class="numbered">
164 <img src="fig.jpg">
165 <figcaption>
166 <p><span class="caption-number">Figure 1</span>Cool caption!</p>
167 </figcaption>
168 </figure>
169 - title: Figure reference with default ref
170 mdast:
171 type: root
172 children:
173 - type: paragraph
174 children:
175 - type: text
176 value: 'see '
177 - type: mystRole
178 name: ref
179 value: my-figure
180 children:
181 - type: crossReference
182 kind: ref
183 identifier: my-figure
184 label: my-figure
185 - type: mystDirective
186 name: figure
187 args: fig.jpg
188 options:
189 name: my-figure
190 value: Cool *caption*!
191 children:
192 - type: container
193 kind: figure
194 identifier: my-figure
195 label: my-figure
196 children:
197 - type: image
198 url: fig.jpg
199 - type: caption
200 children:
201 - type: paragraph
202 children:
203 - type: text
204 value: 'Cool '
205 - type: emphasis
206 children:
207 - type: text
208 value: caption
209 - type: text
210 value: '!'
211 myst: |-
212 see {ref}`my-figure`
213
214 ```{figure} fig.jpg
215 :name: my-figure
216
217 Cool *caption*!
218 ```
219 html: |-
220 <p>see <a href="#my-figure">Cool <em>caption</em>!</a></p>
221 <figure id="my-figure" class="numbered">
222 <img src="fig.jpg">
223 <figcaption>
224 <p><span class="caption-number">Figure 1</span>Cool <em>caption</em>!</p>
225 </figcaption>
226 </figure>
227 - title: Figure reference with custom ref
228 mdast:
229 type: root
230 children:
231 - type: paragraph
232 children:
233 - type: text
234 value: 'see '
235 - type: mystRole
236 name: ref
237 value: Custom *caption* <my-figure>
238 children:
239 - type: crossReference
240 kind: ref
241 identifier: my-figure
242 label: my-figure
243 children:
244 - type: text
245 value: Custom *caption*
246 - type: mystDirective
247 name: figure
248 args: fig.jpg
249 options:
250 name: my-figure
251 value: Cool *caption*!
252 children:
253 - type: container
254 kind: figure
255 identifier: my-figure
256 label: my-figure
257 children:
258 - type: image
259 url: fig.jpg
260 - type: caption
261 children:
262 - type: paragraph
263 children:
264 - type: text
265 value: 'Cool '
266 - type: emphasis
267 children:
268 - type: text
269 value: caption
270 - type: text
271 value: '!'
272 myst: |-
273 see {ref}`Custom *caption* <my-figure>`
274
275 ```{figure} fig.jpg
276 :name: my-figure
277
278 Cool *caption*!
279 ```
280 html: |-
281 <p>see <a href="#my-figure">Custom *caption*</a></p>
282 <figure id="my-figure" class="numbered">
283 <img src="fig.jpg">
284 <figcaption>
285 <p><span class="caption-number">Figure 1</span>Cool <em>caption</em>!</p>
286 </figcaption>
287 </figure>
288 - title: Link-style figure reference with default ref
289 mdast:
290 type: root
291 children:
292 - type: paragraph
293 children:
294 - type: text
295 value: 'see '
296 - type: link
297 url: my-figure
298 title: Figure title
299 children: []
300 - type: mystDirective
301 name: figure
302 args: fig.jpg
303 options:
304 name: my-figure
305 value: Cool *caption*!
306 children:
307 - type: container
308 kind: figure
309 identifier: my-figure
310 label: my-figure
311 children:
312 - type: image
313 url: fig.jpg
314 - type: caption
315 children:
316 - type: paragraph
317 children:
318 - type: text
319 value: 'Cool '
320 - type: emphasis
321 children:
322 - type: text
323 value: caption
324 - type: text
325 value: '!'
326 myst: |-
327 see [](my-figure "Figure title")
328
329 ```{figure} fig.jpg
330 :name: my-figure
331
332 Cool *caption*!
333 ```
334 html: |-
335 <p>see <a href="#my-figure" title="Figure title">Cool <em>caption</em>!</a></p>
336 <figure id="my-figure" class="numbered">
337 <img src="fig.jpg">
338 <figcaption>
339 <p><span class="caption-number">Figure 1</span>Cool <em>caption</em>!</p>
340 </figcaption>
341 </figure>
342 - title: Link-style figure reference with custom ref
343 mdast:
344 type: root
345 children:
346 - type: paragraph
347 children:
348 - type: text
349 value: 'see '
350 - type: link
351 url: my-figure
352 children:
353 - type: text
354 value: 'Custom '
355 - type: emphasis
356 children:
357 - type: text
358 value: caption
359 - type: mystDirective
360 name: figure
361 args: fig.jpg
362 options:
363 name: my-figure
364 value: Cool *caption*!
365 children:
366 - type: container
367 kind: figure
368 identifier: my-figure
369 label: my-figure
370 children:
371 - type: image
372 url: fig.jpg
373 - type: caption
374 children:
375 - type: paragraph
376 children:
377 - type: text
378 value: 'Cool '
379 - type: emphasis
380 children:
381 - type: text
382 value: caption
383 - type: text
384 value: '!'
385 myst: |-
386 see [Custom *caption*](my-figure)
387
388 ```{figure} fig.jpg
389 :name: my-figure
390
391 Cool *caption*!
392 ```
393 html: |-
394 <p>see <a href="#my-figure">Custom <em>caption</em></a></p>
395 <figure id="my-figure" class="numbered">
396 <img src="fig.jpg">
397 <figcaption>
398 <p><span class="caption-number">Figure 1</span>Cool <em>caption</em>!</p>
399 </figcaption>
400 </figure>