From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Export ascii-images using ditaa when targeting HTML? Date: Wed, 12 Nov 2008 07:45:52 +0100 Message-ID: <6412771E-AC32-4F99-BB9E-B54F0A184621@uva.nl> References: <878wrpso07.fsf@gmail.com> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L09UE-0004HH-GT for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 01:45:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L09UD-0004Ga-J0 for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 01:45:58 -0500 Received: from [199.232.76.173] (port=56975 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L09UD-0004GU-Fe for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 01:45:57 -0500 Received: from nf-out-0910.google.com ([64.233.182.185]:4020) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L09UD-0000ey-CA for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 01:45:57 -0500 Received: by nf-out-0910.google.com with SMTP id c7so158721nfi.26 for ; Tue, 11 Nov 2008 22:45:55 -0800 (PST) In-Reply-To: <878wrpso07.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Mac , emacs-orgmode@gnu.org Hi Eric, may I suggest the following change? If you allow the format in the block to be like this: #+begin_ditaa blue.png -r -S : +---------+ : | cBLU | : | | : | +----+ : | |cPNK| : | | | : +----+----+ #+end_ditaa then the ascii images will not be attacked by Org syntax highlighting, you can use C-c ' to edit them. All you would need to do is to strip the initial colon and space when extracting the image for export. Also, we should add a hok so that your add-on can install special handlers for C-c ', in order to edit these new blocks. I like it! - Carsten P.S. yes, I should fix Org-modes font-locking stuff so that it can cover large blocks, but frankly, I do not know how to do that. On Nov 12, 2008, at 2:59 AM, Eric Schulte wrote: > Hi Mac, > > That's an interesting utility. > > I have been working on an org-mode add-on for the specialized > processing > of #+begin_* blocks. Since this is very similar to the need you > expressed below, I implemented ditaa processing as one of the examples > in the initial implementation of this add-on. > > If you want to grab the org-exp-block.el file from > > http://github.com/eschulte/org-contrib/tree/master/org-exp-blocks.el > > you can use it to export ditaa blocks to images when exporting an org > file to html. There are instruction in the top of the elisp file, > mainly you just need to load the file, and set `ditaa-jar-path' to the > path to ditaa.jar on your system. Then if you setup a block like the > following > > #+begin_ditaa blue.png -r -S > +---------+ > | cBLU | > | | > | +----+ > | |cPNK| > | | | > +----+----+ > #+end_ditaa > > The ascii inside the block will be exported to an image in blue.png > passing any following options as command line options to ditaa.jar. > > Hope this is helpful. > > Cheers -- Eric > > Mac writes: > >> I would like to convert my ASCII-images inside my document.org >> before exporting >> the document to HTML. >> >> I've found this converter, ditaa, which is a java program that >> takes an ASCII >> text file and creates a png file (http://ditaa.sourceforge.net/). >> >> I intend to find my ASCII figure, save it as a separate text file, >> and run ditaa >> on it. In my document.org I'll comment the ASCII-art so it won't be >> exported and >> add a link so the image will be included in the html file. >> >> [[file:figure_1.png]] >> #+BEGIN_COMMENT >> V,mA >> | >> +-----+ >> |40140| >> +-----+ >> | >> | +----+ >> +--------|4561|----------> PC >> | +----+ >> +----+ >> |4060| >> +----+ >> | >> Relay Out >> #+END_COMMENT >> >> Before reinventing the wheel, anyone done anything similar, or have >> ideas? >> >> >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Remember: 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 > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode