mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-02 13:45:49 +00:00
Note that they will only be rendered as images if an option `$wgAllowExternalImages` is enabled in the MediaWiki instance. Closes #11494.
74 lines
1.7 KiB
Markdown
74 lines
1.7 KiB
Markdown
External images should not use [[File:...]] syntax.
|
|
|
|
Inline external image:
|
|
```
|
|
% pandoc -f native -t mediawiki
|
|
[Para [Image ("",[],[]) [] ("https://example.org/image.png", "")]]
|
|
^D
|
|
<nowiki></nowiki>https://example.org/image.png<nowiki></nowiki>
|
|
```
|
|
|
|
Inline local image (should still use [[File:]]):
|
|
```
|
|
% pandoc -f native -t mediawiki
|
|
[Para [Image ("",[],[]) [] ("local.png", "")]]
|
|
^D
|
|
[[File:local.png]]
|
|
```
|
|
|
|
Figure with external image (from markdown):
|
|
```
|
|
% pandoc -f markdown -t mediawiki
|
|

|
|
^D
|
|
<nowiki></nowiki>https://example.org/figure.png<nowiki></nowiki>
|
|
```
|
|
|
|
Local image (from markdown, no caption):
|
|
```
|
|
% pandoc -f markdown -t mediawiki
|
|

|
|
^D
|
|
[[File:local.png]]
|
|
```
|
|
|
|
Figure with caption and external image:
|
|
```
|
|
% pandoc -f markdown -t mediawiki
|
|

|
|
^D
|
|
<div class="figure">
|
|
<nowiki></nowiki>https://example.org/figure.png<nowiki></nowiki>
|
|
</div>
|
|
```
|
|
|
|
Figure with caption and local image:
|
|
```
|
|
% pandoc -f markdown -t mediawiki
|
|

|
|
^D
|
|
<div class="figure">
|
|
[[File:local.png|Caption]]
|
|
</div>
|
|
```
|
|
|
|
SimpleFigure with external image (native format with fig: title):
|
|
```
|
|
% pandoc -f native -t mediawiki
|
|
[Figure ("",[],[]) (Caption Nothing []) [Para [Image ("",[],[]) [Str "caption"] ("https://example.org/figure.png", "fig:")]]]
|
|
^D
|
|
<div class="figure">
|
|
<nowiki></nowiki>https://example.org/figure.png<nowiki></nowiki>
|
|
</div>
|
|
```
|
|
|
|
SimpleFigure with local image (native format with fig: title):
|
|
```
|
|
% pandoc -f native -t mediawiki
|
|
[Figure ("",[],[]) (Caption Nothing []) [Para [Image ("",[],[]) [Str "caption"] ("local.png", "fig:")]]]
|
|
^D
|
|
<div class="figure">
|
|
[[File:local.png|thumb|none|alt=caption|caption]]
|
|
</div>
|
|
```
|