emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Chao Lu <loochao@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Photo Gallery
Date: Sat, 13 Feb 2010 19:20:35 -0500	[thread overview]
Message-ID: <87aavcsm5o.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <87fx54wuur.fsf@gmail.com> (Eric Schulte's message of "Sat, 13 Feb 2010 16:59:08 -0700")

Hi Chao,

Here's a second org-babel method, and a third method using org-fstree by
Andreas Burtzlaff.

http://orgmode.org/worg/org-contrib/babel/
http://burtzlaff.de/org-fstree/

Dan

--8<---------------cut here---------------start------------->8---

* babel
#+begin_src sh :results output org :var dir="/home/dan/Pictures/2010/02"
  ls $dir/*.JPG | while read pic ; do
      echo "[[$pic]]"
  done
#+end_src
#+results:
[[/home/dan/Pictures/2010/02/IMG_6097.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6098.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6099.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6100.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6101.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6102.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6103.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6104.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6105.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6106.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6107.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6108.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6109.JPG]]
[[/home/dan/Pictures/2010/02/IMG_6110.JPG]]


* fstree
http://burtzlaff.de/org-fstree/

#+BEGIN_FSTREE: ~/Pictures/2010/02/

* | | [[file:/home/dan/Pictures/2010/02/IMG_6097.JPG][IMG_6097.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6098.JPG][IMG_6098.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6099.JPG][IMG_6099.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6100.JPG][IMG_6100.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6101.JPG][IMG_6101.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6102.JPG][IMG_6102.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6103.JPG][IMG_6103.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6104.JPG][IMG_6104.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6105.JPG][IMG_6105.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6106.JPG][IMG_6106.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6107.JPG][IMG_6107.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6108.JPG][IMG_6108.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6109.JPG][IMG_6109.JPG]]                               
* | | [[file:/home/dan/Pictures/2010/02/IMG_6110.JPG][IMG_6110.JPG]]                               
* |D| [[file:/home/dan/Pictures/2010/02/snow][snow]]                                               
** | | [[file:/home/dan/Pictures/2010/02/snow/IMG_6097.jpg][IMG_6097.jpg]]                         
** | | [[file:/home/dan/Pictures/2010/02/snow/IMG_6098.jpg][IMG_6098.jpg]]                         
** | | [[file:/home/dan/Pictures/2010/02/snow/IMG_6099.jpg][IMG_6099.jpg]]                         
** | | [[file:/home/dan/Pictures/2010/02/snow/IMG_6100.jpg][IMG_6100.jpg]]                         
** | | [[file:/home/dan/Pictures/2010/02/snow/IMG_6101.jpg][IMG_6101.jpg]]                         
** | | [[file:/home/dan/Pictures/2010/02/snow/IMG_6102.jpg][IMG_6102.jpg]]                         
** | | [[file:/home/dan/Pictures/2010/02/snow/IMG_6103.jpg][IMG_6103.jpg]]                         


#+END_FSTREE
--8<---------------cut here---------------end--------------->8---


"Eric Schulte" <schulte.eric@gmail.com> writes:

> This would require some work on your part,
>
> but it shouldn't be hard to use Org-babel and your favorite scripting
> language to automatically generate the html required to display an
> image, for each file in a directory of photographs, and then use
> the :results html setting to drop the resulting html directly into your
> org-mode buffer.  For example the following is a minimal working
> example.
>
> * example generating html of pictures w/Org-babel
>
> #+source: picture_list
> #+begin_src sh
>   ls ~/Pictures/Photo\ Booth
> #+end_src
>
> #+begin_src ruby :var pics=picture_list :results html
>   list = pics.map{ |p| path = p.join(" ")}.
>     map{ |p|"\t<li><a href=\"#{p}\">#{p}</a></li>" }.join("\n")
>   "<ul>\n#{list}\n</ul>"
> #+end_src
>
> #+results:
> #+BEGIN_HTML
> <ul>
> 	<li><a href="Photo 1.jpg">Photo 1.jpg</a></li>
> 	<li><a href="Photo 2.jpg">Photo 2.jpg</a></li>
> 	<li><a href="Photo 3.jpg">Photo 3.jpg</a></li>
> 	<li><a href="Photo 4.jpg">Photo 4.jpg</a></li>
> </ul>
> #+END_HTML
>
> for information on Org-babel see http://orgmode.org/worg/org-contrib/babel/
>
> Best -- Eric
>
> Chao Lu <loochao@gmail.com> writes:
>
>> Dear all,
>>
>> Is it possible to use org to create a photo gallery? Which mean I need to insert a batch of image file, but do the links by hand could be so heavy work, any quick ways?
>>
>> Thanks,
>>
>> Chao
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2010-02-14  0:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13 23:36 Photo Gallery Chao Lu
2010-02-13 23:59 ` Eric Schulte
2010-02-14  0:20   ` Dan Davison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aavcsm5o.fsf@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=loochao@gmail.com \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).