User Tools

Site Tools


dokuwiki_img2fig

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dokuwiki_img2fig [2021/06/16 00:59] – [An image with a caption, float to left] sasabedokuwiki_img2fig [2021/06/16 10:59] (current) sasabe
Line 3: Line 3:
 This Javascript code enables the addition of captions to images in pages created on DokuWiki's default template. This Javascript code enables the addition of captions to images in pages created on DokuWiki's default template.
  
-The standard syntax for images is used. Al least you need:+The standard syntax for images is used. At least you need:
  
   {{filename?width|caption}}   {{filename?width|caption}}
Line 12: Line 12:
  
 <code javascript img2fig.js> <code javascript img2fig.js>
-jQuery('.page p>a>img').each(function (index) {+jQuery('.page p>a>img').each(function () {
   const captionSelector = 'title';   const captionSelector = 'title';
   let $img = jQuery(this);   let $img = jQuery(this);
Line 114: Line 114:
 ==== An image with a caption, centered ==== ==== An image with a caption, centered ====
  
-  {{ https://dummyimage.com/400x300/530/fff.png?400 |Fig.5 Caption text is here}}+  {{ :img:dummy_image.png?400 |Fig.5 Caption text is here}}
  
-{{ https://dummyimage.com/400x300/530/fff.png?400 |Fig.5 Caption text is here}}+{{ :img:dummy_image.png?400 |Fig.5 Caption text is here}}
  
 Body text is here. Body text is here.
dokuwiki_img2fig.1623772748.txt.gz · Last modified: 2021/06/16 00:59 by sasabe