Karl Voit <devn...@karl-voit.at> writes:

> ,----[ ~/.snippets/tls ]
> | name : Insert a table with files of a folder including links
> | # --
> | #+BEGIN_SRC sh
> | PATTERN='${1:*.jpg}'
> | MYFOLDER='${2:$HOME/}'
> | cd \${MYFOLDER}; MYPWD=\`pwd\`; for file in \`ls -1 \${PATTERN}\`; do
> | echo '-[['\$MYPWD'/'\$file']]'; done
> | #+END_SRC
> `----

Yes, I use something similar to create the thumbnails and the initial
org code (I use 3rd level headlines instead of table, because I want to
attache tags to every single image):

#+BEGIN_SRC sh
  reuse_thumb="${1:yes}"
  org=2012-07-14-stubai-hohe-huetten
  img_dirs=${2:2012-07-*}
  : >$org.tmp
  for d in $img_dirs ; do
    {
      [ -f $d ] && continue
      echo "** $d"
      pushd $d >/dev/null
      mkdir -p thumb
      for f in *.JPG *.jpg; do
        [ -f $f ] || continue
        thumb=thumb/${f:0:-3}png
        [ $reuse_thumb = yes ] && [ -f $thumb ] \
          || convert $f -thumbnail 144^ $thumb
        echo "*** [[file:$d/$thumb]]"
        echo [[file:$d/$f][$d/$f]]
      done
      popd >/dev/null
    } >>$org.tmp
  done
#+END_SRC

> Related to this topic: C-c C-x C-v (org-toggle-inline-images) is of
> interest for you. On a per-file-basis this is: #+STARTUP inlineimages

I was already aware of the toggle key sequence.  Thanks for the STARTUP
parameter!  A colon is missing, though ;)  --better use:

    #+STARTUP: inlineimages

-- 
Karl Eichwalder

Reply via email to