* Export ascii-images using ditaa when targeting HTML? @ 2008-11-06 16:12 Mac 2008-11-12 1:57 ` Eric Schulte 2008-11-12 1:59 ` Eric Schulte 0 siblings, 2 replies; 28+ messages in thread From: Mac @ 2008-11-06 16:12 UTC (permalink / raw) To: emacs-orgmode 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? ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-06 16:12 Export ascii-images using ditaa when targeting HTML? Mac @ 2008-11-12 1:57 ` Eric Schulte 2008-11-12 8:14 ` Mac 2008-11-14 14:54 ` Bernt Hansen 2008-11-12 1:59 ` Eric Schulte 1 sibling, 2 replies; 28+ messages in thread From: Eric Schulte @ 2008-11-12 1:57 UTC (permalink / raw) To: Mac; +Cc: emacs-orgmode 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 <xmfrw8002@sneakemail.com> 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 ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 1:57 ` Eric Schulte @ 2008-11-12 8:14 ` Mac 2008-11-12 9:44 ` Mac 2008-11-12 10:00 ` Carsten Dominik 2008-11-14 14:54 ` Bernt Hansen 1 sibling, 2 replies; 28+ messages in thread From: Mac @ 2008-11-12 8:14 UTC (permalink / raw) To: emacs-orgmode Eric Schulte <schulte.eric <at> gmail.com> writes: > 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. Thanks, that was almost exactly what I wanted, I'm trying to make three changes though: * First I want to keep the ASCII-image in the original file for easy updating * Second, and as a result of the above, I don't automatically include a link to the file. I know what's being called so that's no big deal to manually add * Third (and here I've not yet succeded) I want to inhibit org-mode from exporting the now still lingering ASCII-image. I've tried using comment blocks, but it does not work. I've just realized that I don't have the latest org-mode installed, so I'll try again. My current (non-working) block now looks like this: [[file:blue.png]] #+BEGIN_COMMENT #+begin_ditaa blue.png -r -S +---------+ | cBLU | | | | +----+ | |cPNK| | | | +----+----+ #+end_ditaa #+END_COMMENT > Hope this is helpful. It sure is! Thanks! /Mac ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 8:14 ` Mac @ 2008-11-12 9:44 ` Mac 2008-11-12 10:00 ` Carsten Dominik 1 sibling, 0 replies; 28+ messages in thread From: Mac @ 2008-11-12 9:44 UTC (permalink / raw) To: emacs-orgmode Mac <xmfrw8002 <at> sneakemail.com> writes: > > * First I want to keep the ASCII-image in the original file for easy updating > > * Second, and as a result of the above, I don't automatically include a link > to the file. I know what's being called so that's no big deal to manually > add > > * Third (and here I've not yet succeded) I want to inhibit org-mode from > exporting the now still lingering ASCII-image. I've just found a workaround for the third item, placing it in a subtree and tag the subtree for export exclusion. [[file:blue.png]] ** image :noexport: #+begin_ditaa blue.png -r -S +---------+ | cBLU | | | | +----+ | |cPNK| | | | +----+----+ #+end_ditaa /mac ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 8:14 ` Mac 2008-11-12 9:44 ` Mac @ 2008-11-12 10:00 ` Carsten Dominik 2008-11-12 10:17 ` Mac 1 sibling, 1 reply; 28+ messages in thread From: Carsten Dominik @ 2008-11-12 10:00 UTC (permalink / raw) To: Mac; +Cc: emacs-orgmode On Nov 12, 2008, at 9:14 AM, Mac wrote: > Eric Schulte <schulte.eric <at> gmail.com> writes: > >> 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. > > Thanks, that was almost exactly what I wanted, I'm trying to make > three > changes though: > > * First I want to keep the ASCII-image in the original file for easy > updating > > * Second, and as a result of the above, I don't automatically > include a link > to the file. I know what's being called so that's no big deal to > manually add > > * Third (and here I've not yet succeded) I want to inhibit org-mode > from > exporting the now still lingering ASCII-image. Hi Mac, I don't think I understand. When I load Eric's code, the ASCII image is not exported. The png file is created on the fly and then *replaces* the ASCII drawing in HTML document - works beautifully for me. In fact so beautifully that I am asking the author of ditaa if we can keep a copy in the contrib directory, so that all of this will work out of the box...... - Carsten > > > I've tried using comment blocks, but it does not work. I've just > realized that > I don't have the latest org-mode installed, so I'll try again. > > My current (non-working) block now looks like this: > > > [[file:blue.png]] > > #+BEGIN_COMMENT > #+begin_ditaa blue.png -r -S > +---------+ > | cBLU | > | | > | +----+ > | |cPNK| > | | | > +----+----+ > #+end_ditaa > #+END_COMMENT > > >> Hope this is helpful. > > It sure is! Thanks! > > /Mac > > > > > _______________________________________________ > 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 ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 10:00 ` Carsten Dominik @ 2008-11-12 10:17 ` Mac 0 siblings, 0 replies; 28+ messages in thread From: Mac @ 2008-11-12 10:17 UTC (permalink / raw) To: emacs-orgmode Carsten Dominik <dominik <at> science.uva.nl> writes: > Hi Mac, I don't think I understand. > > When I load Eric's code, the ASCII image is not exported. The png > file is created on the fly and then *replaces* the ASCII drawing in > HTML document - works beautifully for me. Hmmmm, I just installed the latest org-mode and restarted emacs and now it works for me as well... So, I don't know what i did to it before, but it works now! I'm happy! Thanks. /mac ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 1:57 ` Eric Schulte 2008-11-12 8:14 ` Mac @ 2008-11-14 14:54 ` Bernt Hansen 2008-11-14 15:51 ` Carsten Dominik 1 sibling, 1 reply; 28+ messages in thread From: Bernt Hansen @ 2008-11-14 14:54 UTC (permalink / raw) To: Eric Schulte; +Cc: emacs-orgmode "Eric Schulte" <schulte.eric@gmail.com> writes: > 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. <snip> > > #+begin_ditaa blue.png -r -S > +---------+ > | cBLU | > | | > | +----+ > | |cPNK| > | | | > +----+----+ > #+end_ditaa > Hi Eric, Just out of curiosity is there a reason you chose to use lowercase for #+begin_ and #+end_ tags? I think the org-mode tags are all uppercase only and it feels a little strange having to remember which ones are supposed to be upper/lower case when playing with this utility. Great job by the way - I think this ditaa export is really cool! Regards, Bernt ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Re: Export ascii-images using ditaa when targeting HTML? 2008-11-14 14:54 ` Bernt Hansen @ 2008-11-14 15:51 ` Carsten Dominik 2008-11-14 16:02 ` Bernt Hansen 0 siblings, 1 reply; 28+ messages in thread From: Carsten Dominik @ 2008-11-14 15:51 UTC (permalink / raw) To: Bernt Hansen; +Cc: emacs-orgmode On Nov 14, 2008, at 3:54 PM, Bernt Hansen wrote: > "Eric Schulte" <schulte.eric@gmail.com> writes: > >> 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. > > <snip> > >> >> #+begin_ditaa blue.png -r -S >> +---------+ >> | cBLU | >> | | >> | +----+ >> | |cPNK| >> | | | >> +----+----+ >> #+end_ditaa >> > > Hi Eric, > > Just out of curiosity is there a reason you chose to use lowercase for > #+begin_ and #+end_ tags? I think the org-mode tags are all uppercase > only and it feels a little strange having to remember which ones are > supposed to be upper/lower case when playing with this utility. I would like blocks to be defined so that you can use both upper and lower case, and I hope that most of Org works like this (please report this as a bug if is case dependent under some circumstances). - Carsten ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Re: Export ascii-images using ditaa when targeting HTML? 2008-11-14 15:51 ` Carsten Dominik @ 2008-11-14 16:02 ` Bernt Hansen 0 siblings, 0 replies; 28+ messages in thread From: Bernt Hansen @ 2008-11-14 16:02 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode Carsten Dominik <dominik@science.uva.nl> writes: > I would like blocks to be defined so that you can use both upper > and lower case, and I hope that most of Org works like this (please > report this as a bug if is case dependent under some circumstances). :) I've only every used all uppercase for org blocks since that is all I have ever seen in the examples. I never actually tried lowercase org blocks until now -- and the one I tried (BEGIN_EXAMPLE) didn't care about case so that works fine. Thanks! Bernt ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-06 16:12 Export ascii-images using ditaa when targeting HTML? Mac 2008-11-12 1:57 ` Eric Schulte @ 2008-11-12 1:59 ` Eric Schulte 2008-11-12 6:45 ` Carsten Dominik ` (2 more replies) 1 sibling, 3 replies; 28+ messages in thread From: Eric Schulte @ 2008-11-12 1:59 UTC (permalink / raw) To: Mac; +Cc: emacs-orgmode 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 <xmfrw8002@sneakemail.com> 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 ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 1:59 ` Eric Schulte @ 2008-11-12 6:45 ` Carsten Dominik 2008-11-12 9:53 ` Mac 2008-11-12 13:54 ` Sebastian Rose 2008-11-12 22:42 ` Eric Schulte 2 siblings, 1 reply; 28+ messages in thread From: Carsten Dominik @ 2008-11-12 6:45 UTC (permalink / raw) To: Eric Schulte; +Cc: Mac, emacs-orgmode 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 <xmfrw8002@sneakemail.com> 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 ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 6:45 ` Carsten Dominik @ 2008-11-12 9:53 ` Mac 0 siblings, 0 replies; 28+ messages in thread From: Mac @ 2008-11-12 9:53 UTC (permalink / raw) To: emacs-orgmode Carsten Dominik <dominik <at> science.uva.nl> writes: > 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. I like that suggestion! (I'm already using the colon in my files even though I currently get a dotted line at the left hand side ;-) /mac ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 1:59 ` Eric Schulte 2008-11-12 6:45 ` Carsten Dominik @ 2008-11-12 13:54 ` Sebastian Rose 2008-11-12 15:59 ` Carsten Dominik 2008-11-12 22:42 ` Eric Schulte 2 siblings, 1 reply; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 13:54 UTC (permalink / raw) To: emacs-orgmode Hi Eric, this is - hey - WOWEEEEEE, GREAT! But I ran into to problems: * Background color The background of the resulting images is black, and I don't know how to change that. Black lines on black background... I tried with leading colons and without. ditaa has no option to adjust the background color, but if I use ditaa from the commandline, the background color is white. * Existing images If the image already exists in the target directory of the export, org refuses to overwrite it. Is there an option somewhere I should adjust? I don't think it's a general problem in org-export, since I never ecnountered this error. Thanks for org-exp-blocks.el!! Best, Sebastian "Eric Schulte" <schulte.eric@gmail.com> writes: > 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 <xmfrw8002@sneakemail.com> 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 > -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose emma-stil de, sebastian_rose gmx de Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 13:54 ` Sebastian Rose @ 2008-11-12 15:59 ` Carsten Dominik 2008-11-12 18:33 ` Sebastian Rose 0 siblings, 1 reply; 28+ messages in thread From: Carsten Dominik @ 2008-11-12 15:59 UTC (permalink / raw) To: Sebastian Rose; +Cc: emacs-orgmode On Nov 12, 2008, at 2:54 PM, Sebastian Rose wrote: > Hi Eric, > > > this is - hey - WOWEEEEEE, GREAT! > > > But I ran into to problems: > > * Background color > > The background of the resulting images is black, and I don't know how > to change that. Black lines on black background... I tried with > leading colons and without. > > ditaa has no option to adjust the background color, but if I use > ditaa > from the commandline, the background color is white. For what it is worth, I have no problems with the background, it is white all right. Maybe it is transparent? - Carsten > > > > * Existing images > > If the image already exists in the target directory of the export, > org > refuses to overwrite it. Is there an option somewhere I should > adjust? > I don't think it's a general problem in org-export, since I never > ecnountered this error. > > > > > Thanks for org-exp-blocks.el!! > > > Best, > > Sebastian > > > > "Eric Schulte" <schulte.eric@gmail.com> writes: > >> 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 <xmfrw8002@sneakemail.com> 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 >> > > -- > Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 > Hannover > > Tel.: +49 (0)511 - 36 58 472 > Fax: +49 (0)1805 - 233633 - 11044 > mobil: +49 (0)173 - 83 93 417 > Email: s.rose emma-stil de, sebastian_rose gmx de > Http: www.emma-stil.de > > > _______________________________________________ > 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 ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 15:59 ` Carsten Dominik @ 2008-11-12 18:33 ` Sebastian Rose 2008-11-12 18:42 ` Sebastian Rose 2008-11-12 18:53 ` Eric Schulte 0 siblings, 2 replies; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 18:33 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode Carsten Dominik <dominik@science.uva.nl> writes: >> ditaa has no option to adjust the background color, but if I use ditaa >> from the commandline, the background color is white. > > For what it is worth, I have no problems with the background, it is white all > right. Maybe it is transparent? No, it is black indeed. But I found out, what it is. This line (shell-command (concat "java -jar " ditaa-jar-path " " args " " data-file " " out-file)) calls another java than this command line: java -jar ~/bin/ditaar.jar /tmp/org-ditaa5607fgk Yes, that seems to be the reason: /usr/bin/java is that free GNU java stuff that comes with Debian (some packages depend on it). It's deadslow and makes the black background. The commandline calls: sh$ which java /usr/lib/jvm/java-6-sun/bin/java It's fast and makes the background white :-) `shell-command' seems to call /usr/bin/java instead of regarding my $PATH $sh echo $PATH /home/sebastian/bin/ext/maven/bin:/usr/lib/jvm/java-6-sun/bin:/home/sebastian/bin:/usr/local/bin:/usr/bin:/bin Funny enough, the problem remains, if I start emacs from the bash prompt. Seems that `shell-command' searches the standard directories without regarding the environment? Don't know yet, if this is related to the problem: Debian/Java - it's a stupid combination really. I installed the SUN java stuff using apt-get - it's odd: sh$ ls -l /etc/alternatives/java lrwxrwxrwx 1 root root 34 28. Okt 20:35 /etc/alternatives/java -> /usr/lib/jvm/java-gcj/jre/bin/java Don't believe adjusting this helps, but I'd have to adjust all the other /etc/alternatives/java* stuff by hand anyway. Maybe I should file a bug report to Debian. Adjusting the java path in org-exp-blocks directly fixes it. Thanks, -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 18:33 ` Sebastian Rose @ 2008-11-12 18:42 ` Sebastian Rose 2008-11-12 19:18 ` Bernt Hansen 2008-11-12 18:53 ` Eric Schulte 1 sibling, 1 reply; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 18:42 UTC (permalink / raw) To: emacs-orgmode OK, fixed. I did NOT have to adjust all the /etc/alternatives/java* stuff. Just java and javac have been changed on some updating or installation of packages depending on the free java stuff. sh$ cd /etc/alternatives/ sh$ rm java sh$ ln -s /usr/lib/jvm/java-6-sun/bin/java java sh$ rm javac sh$ ln -s /usr/lib/jvm/java-6-sun/bin/javac javac Done. :-) -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose emma-stil de, sebastian_rose gmx de Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 18:42 ` Sebastian Rose @ 2008-11-12 19:18 ` Bernt Hansen 2008-11-12 19:41 ` Sebastian Rose 0 siblings, 1 reply; 28+ messages in thread From: Bernt Hansen @ 2008-11-12 19:18 UTC (permalink / raw) To: Sebastian Rose; +Cc: emacs-orgmode Sebastian Rose <sebastian_rose@gmx.de> writes: > OK, fixed. > > > I did NOT have to adjust all the /etc/alternatives/java* stuff. > > Just java and javac have been changed on some updating or installation > of packages depending on the free java stuff. > > > sh$ cd /etc/alternatives/ > sh$ rm java > sh$ ln -s /usr/lib/jvm/java-6-sun/bin/java java > sh$ rm javac > sh$ ln -s /usr/lib/jvm/java-6-sun/bin/javac javac This is a better way to update the alternatives # update-alternatives --config java and you pick from the provided alternatives. It updates multiple links as required. -Bernt ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 19:18 ` Bernt Hansen @ 2008-11-12 19:41 ` Sebastian Rose 2008-11-12 19:47 ` Bernt Hansen 0 siblings, 1 reply; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 19:41 UTC (permalink / raw) To: Bernt Hansen; +Cc: emacs-orgmode Hi Bernt, will # update-alternatives --config java adjust all those links? sh$ ls -1 /etc/alternatives/java* /etc/alternatives/java /etc/alternatives/javac /etc/alternatives/javac.1.gz /etc/alternatives/javadoc /etc/alternatives/javadoc.1.gz /etc/alternatives/javah /etc/alternatives/javah.1.gz /etc/alternatives/javap /etc/alternatives/javap.1.gz /etc/alternatives/java-rmi.cgi /etc/alternatives/java_vm /etc/alternatives/javaws /etc/alternatives/javaws.1.gz Anyway, thanks for the tip. It easier than editing those links by hand and shows all the alternatives present on the system. Sebastian Bernt Hansen <bernt@norang.ca> writes: > Sebastian Rose <sebastian_rose@gmx.de> writes: > >> OK, fixed. >> >> >> I did NOT have to adjust all the /etc/alternatives/java* stuff. >> >> Just java and javac have been changed on some updating or installation >> of packages depending on the free java stuff. >> >> >> sh$ cd /etc/alternatives/ >> sh$ rm java >> sh$ ln -s /usr/lib/jvm/java-6-sun/bin/java java >> sh$ rm javac >> sh$ ln -s /usr/lib/jvm/java-6-sun/bin/javac javac > > This is a better way to update the alternatives > > # update-alternatives --config java > > and you pick from the provided alternatives. It updates multiple links > as required. > > -Bernt > -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose emma-stil de, sebastian_rose gmx de Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 19:41 ` Sebastian Rose @ 2008-11-12 19:47 ` Bernt Hansen 2008-11-12 20:33 ` Sebastian Rose 0 siblings, 1 reply; 28+ messages in thread From: Bernt Hansen @ 2008-11-12 19:47 UTC (permalink / raw) To: Sebastian Rose; +Cc: emacs-orgmode Not all of them but it will (or should) adjust whatever belongs to the package you are switching. Some of those links (for me) are from a different java package. On my system I can configure java javac javadoc javah separately but some of those only have one alternative (so you can't change it) It's still better than manipulating the links by hand (I think) since you're less likely to point at incorrect packages. -Bernt Sebastian Rose <sebastian_rose@gmx.de> writes: > Hi Bernt, > > > will > # update-alternatives --config java > adjust all those links? > > > sh$ ls -1 /etc/alternatives/java* > /etc/alternatives/java > /etc/alternatives/javac > /etc/alternatives/javac.1.gz > /etc/alternatives/javadoc > /etc/alternatives/javadoc.1.gz > /etc/alternatives/javah > /etc/alternatives/javah.1.gz > /etc/alternatives/javap > /etc/alternatives/javap.1.gz > /etc/alternatives/java-rmi.cgi > /etc/alternatives/java_vm > /etc/alternatives/javaws > /etc/alternatives/javaws.1.gz > > > > Anyway, thanks for the tip. It easier than editing those links by hand > and shows all the alternatives present on the system. > > > Sebastian > > > > Bernt Hansen <bernt@norang.ca> writes: >> Sebastian Rose <sebastian_rose@gmx.de> writes: >> >>> OK, fixed. >>> >>> >>> I did NOT have to adjust all the /etc/alternatives/java* stuff. >>> >>> Just java and javac have been changed on some updating or installation >>> of packages depending on the free java stuff. >>> >>> >>> sh$ cd /etc/alternatives/ >>> sh$ rm java >>> sh$ ln -s /usr/lib/jvm/java-6-sun/bin/java java >>> sh$ rm javac >>> sh$ ln -s /usr/lib/jvm/java-6-sun/bin/javac javac >> >> This is a better way to update the alternatives >> >> # update-alternatives --config java >> >> and you pick from the provided alternatives. It updates multiple links >> as required. >> >> -Bernt >> > > -- > Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover > > Tel.: +49 (0)511 - 36 58 472 > Fax: +49 (0)1805 - 233633 - 11044 > mobil: +49 (0)173 - 83 93 417 > Email: s.rose emma-stil de, sebastian_rose gmx de > Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 19:47 ` Bernt Hansen @ 2008-11-12 20:33 ` Sebastian Rose 0 siblings, 0 replies; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 20:33 UTC (permalink / raw) To: Bernt Hansen; +Cc: emacs-orgmode Hi Bernt, I'll follow your advice for all future changes to my alternative system here. `C-c r' did it's job already :-) Thanks, Sebastian Bernt Hansen <bernt@norang.ca> writes: > Not all of them but it will (or should) adjust whatever belongs to the > package you are switching. Some of those links (for me) are from a > different java package. > > On my system I can configure > > java > javac > javadoc > javah > > separately but some of those only have one alternative (so you can't > change it) > > It's still better than manipulating the links by hand (I think) since > you're less likely to point at incorrect packages. > > -Bernt > > > Sebastian Rose <sebastian_rose@gmx.de> writes: > >> Hi Bernt, >> >> >> will >> # update-alternatives --config java >> adjust all those links? >> >> >> sh$ ls -1 /etc/alternatives/java* >> /etc/alternatives/java >> /etc/alternatives/javac >> /etc/alternatives/javac.1.gz >> /etc/alternatives/javadoc >> /etc/alternatives/javadoc.1.gz >> /etc/alternatives/javah >> /etc/alternatives/javah.1.gz >> /etc/alternatives/javap >> /etc/alternatives/javap.1.gz >> /etc/alternatives/java-rmi.cgi >> /etc/alternatives/java_vm >> /etc/alternatives/javaws >> /etc/alternatives/javaws.1.gz >> >> >> >> Anyway, thanks for the tip. It easier than editing those links by hand >> and shows all the alternatives present on the system. >> >> >> Sebastian >> >> >> >> Bernt Hansen <bernt@norang.ca> writes: >>> Sebastian Rose <sebastian_rose@gmx.de> writes: >>> >>>> OK, fixed. >>>> >>>> >>>> I did NOT have to adjust all the /etc/alternatives/java* stuff. >>>> >>>> Just java and javac have been changed on some updating or installation >>>> of packages depending on the free java stuff. >>>> >>>> >>>> sh$ cd /etc/alternatives/ >>>> sh$ rm java >>>> sh$ ln -s /usr/lib/jvm/java-6-sun/bin/java java >>>> sh$ rm javac >>>> sh$ ln -s /usr/lib/jvm/java-6-sun/bin/javac javac >>> >>> This is a better way to update the alternatives >>> >>> # update-alternatives --config java >>> >>> and you pick from the provided alternatives. It updates multiple links >>> as required. >>> >>> -Bernt >>> >> >> -- >> Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover >> >> Tel.: +49 (0)511 - 36 58 472 >> Fax: +49 (0)1805 - 233633 - 11044 >> mobil: +49 (0)173 - 83 93 417 >> Email: s.rose emma-stil de, sebastian_rose gmx de >> Http: www.emma-stil.de > -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose emma-stil de, sebastian_rose gmx de Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 18:33 ` Sebastian Rose 2008-11-12 18:42 ` Sebastian Rose @ 2008-11-12 18:53 ` Eric Schulte 2008-11-12 19:13 ` Sebastian Rose 1 sibling, 1 reply; 28+ messages in thread From: Eric Schulte @ 2008-11-12 18:53 UTC (permalink / raw) To: Sebastian Rose; +Cc: emacs-orgmode Sebastian Rose <sebastian_rose@gmx.de> writes: > Carsten Dominik <dominik@science.uva.nl> writes: >>> ditaa has no option to adjust the background color, but if I use ditaa >>> from the commandline, the background color is white. >> >> For what it is worth, I have no problems with the background, it is white all >> right. Maybe it is transparent? > > > No, it is black indeed. But I found out, what it is. > > > This line > > (shell-command (concat "java -jar " ditaa-jar-path " " args " " data-file " " out-file)) > > calls another java than this command line: > > java -jar ~/bin/ditaar.jar /tmp/org-ditaa5607fgk > > Just to make sure, did you notice the command line option -S which controls the background color? ,----[java -jar ditaa0_6b.jar -h] | | DiTAA version 0.6b, Copyright (C) 2004 Efstathios Sideris | | Using options: | html: true | Error: Please provide the input file filename | Usage: | java -jar text2image.jar | | [{-o,--overwrite}] | [{-d,--debug}] | [{-t,--tabs}] | | [{-S,--no-shadows}] | [{-A,--no-antialias}] | [{-s,--scale} scale] | [{-r,--round-corners}] | [{-E,--no-separation}] | | [{-h,--html}] | | <inpfile> [outfile] | | Note: do not group options like -rES. This is going to be fixed. `---- -- Eric > > > Yes, that seems to be the reason: > > /usr/bin/java is that free GNU java stuff that comes with Debian > (some packages depend on it). It's deadslow and makes the black > background. > > > The commandline calls: > > sh$ which java > /usr/lib/jvm/java-6-sun/bin/java > > It's fast and makes the background white :-) > > > > `shell-command' seems to call /usr/bin/java instead of regarding my $PATH > > $sh echo $PATH > /home/sebastian/bin/ext/maven/bin:/usr/lib/jvm/java-6-sun/bin:/home/sebastian/bin:/usr/local/bin:/usr/bin:/bin > > > Funny enough, the problem remains, if I start emacs from the bash > prompt. Seems that `shell-command' searches the standard directories > without regarding the environment? > > > > Don't know yet, if this is related to the problem: > > Debian/Java - it's a stupid combination really. I installed the SUN java > stuff using apt-get - it's odd: > > sh$ ls -l /etc/alternatives/java > lrwxrwxrwx 1 root root 34 28. Okt 20:35 /etc/alternatives/java -> /usr/lib/jvm/java-gcj/jre/bin/java > > Don't believe adjusting this helps, but I'd have to adjust all the > other /etc/alternatives/java* stuff by hand anyway. Maybe I should > file a bug report to Debian. > > > > > Adjusting the java path in org-exp-blocks directly fixes it. > > > > Thanks, ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 18:53 ` Eric Schulte @ 2008-11-12 19:13 ` Sebastian Rose 2008-11-12 19:30 ` Eric Schulte 0 siblings, 1 reply; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 19:13 UTC (permalink / raw) To: Eric Schulte; +Cc: emacs-orgmode Hi Eric, I used no options at all for testing. Now it works here (see my previous mail). The only problem left is now the copy problem if I change something. Seems that this happens somewhere else. I.e., not in org-exp-blocks.el, but rather in one of those: sh$ grep -Fr copy-file emacs/lisp/ext/org-mode/lisp/ emacs/lisp/ext/org-mode/lisp/org.el: (copy-file pngfile tofile 'replace) emacs/lisp/ext/org-mode/lisp/org-attach.el: ((eq method 'cp) (copy-file file fname)) emacs/lisp/ext/org-mode/lisp/org-publish.el: (copy-file filename pub-dir)) Debugger entered--Lisp error: (file-already-exists "File already exists" "/home/sebastian/develop/htdocs/org-notes/ditaa-all-examples.png") copy-file("/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/ditaa-all-examples.png" nil nil nil) apply(copy-file ("/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/ditaa-all-examples.png" nil nil nil)) image-file-call-underlying(copy-file copy-file "/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/ditaa-all-examples.png" nil nil nil) apply(image-file-call-underlying copy-file copy-file ("/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/ditaa-all-examples.png" nil nil nil)) image-file-handler(copy-file "/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/ditaa-all-examples.png" nil nil nil) copy-file("/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/") org-publish-attachment((:base-directory "~/emacs/org/notes/" :recursive t :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|txt\\|htm\\|html\\|dtd\\|php" :publishing-directory "~/develop/htdocs/org-notes/" :publishing-function org-publish-attachment) "/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/") funcall(org-publish-attachment (:base-directory "~/emacs/org/notes/" :recursive t :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|txt\\|htm\\|html\\|dtd\\|php" :publishing-directory "~/develop/htdocs/org-notes/" :publishing-function org-publish-attachment) "/home/sebastian/emacs/org/notes/ditaa-all-examples.png" "/home/sebastian/develop/htdocs/org-notes/") (if (listp publishing-function) (mapc (lambda ... ...) publishing-function) (funcall publishing-function project-plist filename tmp-pub-dir)) (let* ((project ...) (project-plist ...) (ftname ...) (publishing-function ...) (base-dir ...) (pub-dir ...) tmp-pub-dir) (setq tmp-pub-dir (file-name-directory ...)) (if (listp publishing-function) (mapc ... publishing-function) (funcall publishing-function project-plist filename tmp-pub-dir))) (progn (let* (... ... ... ... ... ... tmp-pub-dir) (setq tmp-pub-dir ...) (if ... ... ...)) (org-publish-update-timestamp filename)) (if (org-publish-needed-p filename) (progn (let* ... ... ...) (org-publish-update-timestamp filename))) (when (org-publish-needed-p filename) (let* (... ... ... ... ... ... tmp-pub-dir) (setq tmp-pub-dir ...) (if ... ... ...)) (org-publish-update-timestamp filename)) org-publish-file("/home/sebastian/emacs/org/notes/ditaa-all-examples.png" ("org-notes-static" :base-directory "~/emacs/org/notes/" :recursive t :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|txt\\|htm\\|html\\|dtd\\|php" :publishing-directory "~/develop/htdocs/org-notes/" :publishing-function org-publish-attachment)) (while (setq file (pop files)) (org-publish-file file project)) (let* ((project-plist ...) (exclude-regexp ...) (index-p ...) (index-filename ...) (index-function ...) (preparation-function ...) (completion-function ...) (files ...) file) (when preparation-function (funcall preparation-function)) (if index-p (funcall index-function project index-filename)) (while (setq file ...) (org-publish-file file project)) (when completion-function (funcall completion-function))) (lambda (project) (let* (... ... ... ... ... ... ... ... file) (when preparation-function ...) (if index-p ...) (while ... ...) (when completion-function ...)))(("org-notes-static" :base-directory "~/emacs/org/notes/" :recursive t :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|txt\\|htm\\|html\\|dtd\\|php" :publishing-directory "~/develop/htdocs/org-notes/" :publishing-function org-publish-attachment)) mapc((lambda (project) (let* (... ... ... ... ... ... ... ... file) (when preparation-function ...) (if index-p ...) (while ... ...) (when completion-function ...))) (("org-notes" :base-directory "~/emacs/org/notes/" :auto-index t :index-filename "sitemap.org" :index-title "Sitemap" :recursive t :base-extension "org" :publishing-directory "~/develop/htdocs/org-notes/" :publishing-function org-publish-org-to-html :headline-levels 4 :auto-preamble t :style "<link rel=\"stylesheet\" href=\"stylesheet.css\" type=\"text/css\" />\n <script type=\"text/javascript\" src=\"org-info.js\"></script>") ("org-notes-static" :base-directory "~/emacs/org/notes/" :recursive t :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|txt\\|htm\\|html\\|dtd\\|php" :publishing-directory "~/dev elop/htdocs/org-notes/" :publishing-function org-publish-attachment))) org-publish-projects((("org" :components ("org-notes" "org-notes-static")))) (let* ((force current-prefix-arg) (org-publish-use-timestamps-flag ...)) (org-publish-projects (list ...))) (save-window-excursion (let* (... ...) (org-publish-projects ...))) org-publish(nil) call-interactively(org-publish t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil) Don't know if this is new - I never ever changed an image file so far. Regards, Sebastian "Eric Schulte" <schulte.eric@gmail.com> writes: > Sebastian Rose <sebastian_rose@gmx.de> writes: > >> Carsten Dominik <dominik@science.uva.nl> writes: >>>> ditaa has no option to adjust the background color, but if I use ditaa >>>> from the commandline, the background color is white. >>> >>> For what it is worth, I have no problems with the background, it is white all >>> right. Maybe it is transparent? >> >> >> No, it is black indeed. But I found out, what it is. >> >> >> This line >> >> (shell-command (concat "java -jar " ditaa-jar-path " " args " " data-file " " out-file)) >> >> calls another java than this command line: >> >> java -jar ~/bin/ditaar.jar /tmp/org-ditaa5607fgk >> >> > > Just to make sure, did you notice the command line option -S which > controls the background color? > > ,----[java -jar ditaa0_6b.jar -h] > | > | DiTAA version 0.6b, Copyright (C) 2004 Efstathios Sideris > | > | Using options: > | html: true > | Error: Please provide the input file filename > | Usage: > | java -jar text2image.jar > | > | [{-o,--overwrite}] > | [{-d,--debug}] > | [{-t,--tabs}] > | > | [{-S,--no-shadows}] > | [{-A,--no-antialias}] > | [{-s,--scale} scale] > | [{-r,--round-corners}] > | [{-E,--no-separation}] > | > | [{-h,--html}] > | > | <inpfile> [outfile] > | > | Note: do not group options like -rES. This is going to be fixed. > `---- > > -- Eric > >> > >> Yes, that seems to be the reason: >> >> /usr/bin/java is that free GNU java stuff that comes with Debian >> (some packages depend on it). It's deadslow and makes the black >> background. >> >> >> The commandline calls: >> >> sh$ which java >> /usr/lib/jvm/java-6-sun/bin/java >> >> It's fast and makes the background white :-) >> >> >> >> `shell-command' seems to call /usr/bin/java instead of regarding my $PATH >> >> $sh echo $PATH >> /home/sebastian/bin/ext/maven/bin:/usr/lib/jvm/java-6-sun/bin:/home/sebastian/bin:/usr/local/bin:/usr/bin:/bin >> >> >> Funny enough, the problem remains, if I start emacs from the bash >> prompt. Seems that `shell-command' searches the standard directories >> without regarding the environment? >> >> >> >> Don't know yet, if this is related to the problem: >> >> Debian/Java - it's a stupid combination really. I installed the SUN java >> stuff using apt-get - it's odd: >> >> sh$ ls -l /etc/alternatives/java >> lrwxrwxrwx 1 root root 34 28. Okt 20:35 /etc/alternatives/java -> /usr/lib/jvm/java-gcj/jre/bin/java >> >> Don't believe adjusting this helps, but I'd have to adjust all the >> other /etc/alternatives/java* stuff by hand anyway. Maybe I should >> file a bug report to Debian. >> >> >> >> >> Adjusting the java path in org-exp-blocks directly fixes it. >> >> >> >> Thanks, > -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose emma-stil de, sebastian_rose gmx de Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 19:13 ` Sebastian Rose @ 2008-11-12 19:30 ` Eric Schulte 2008-11-12 20:31 ` Sebastian Rose 0 siblings, 1 reply; 28+ messages in thread From: Eric Schulte @ 2008-11-12 19:30 UTC (permalink / raw) To: Sebastian Rose; +Cc: emacs-orgmode Sebastian Rose <sebastian_rose@gmx.de> writes: > Hi Eric, > > > I used no options at all for testing. Now it works here (see my previous > mail). > > > The only problem left is now the copy problem if I change > something. Hi Sebastian, I think this is related to the -o option of the ditaa utility. Try adding -o to the header of the ditaa block, resulting in a block like #+begin_ditaa blue.png -r -S -o +---------+ | cPNK | | | | +----+ | |cBLU| | | | +----+----+ #+end_ditaa Then ditaa should willingly overwrite the previous image. Tally Ho -- Eric ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 19:30 ` Eric Schulte @ 2008-11-12 20:31 ` Sebastian Rose 2008-11-12 20:47 ` Eric Schulte 0 siblings, 1 reply; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 20:31 UTC (permalink / raw) To: Eric Schulte; +Cc: emacs-orgmode Hi Eric, sorry for being unclear. I use the -o option. The image is always created correctly. But it seems that the exporter (org-publish-attachment) refuses to overwrite existing files. Regards, Sebastian "Eric Schulte" <schulte.eric@gmail.com> writes: > Sebastian Rose <sebastian_rose@gmx.de> writes: > >> Hi Eric, >> >> >> I used no options at all for testing. Now it works here (see my previous >> mail). >> >> >> The only problem left is now the copy problem if I change >> something. > > Hi Sebastian, > > I think this is related to the -o option of the ditaa utility. Try > adding -o to the header of the ditaa block, resulting in a block like > > #+begin_ditaa blue.png -r -S -o > +---------+ > | cPNK | > | | > | +----+ > | |cBLU| > | | | > +----+----+ > #+end_ditaa > > Then ditaa should willingly overwrite the previous image. > > Tally Ho -- Eric > -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose emma-stil de, sebastian_rose gmx de Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 20:31 ` Sebastian Rose @ 2008-11-12 20:47 ` Eric Schulte 2008-11-12 21:54 ` Sebastian Rose 2008-11-12 23:01 ` Carsten Dominik 0 siblings, 2 replies; 28+ messages in thread From: Eric Schulte @ 2008-11-12 20:47 UTC (permalink / raw) To: Sebastian Rose; +Cc: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 1157 bytes --] Sebastian Rose <sebastian_rose@gmx.de> writes: > Hi Eric, > > > sorry for being unclear. I use the -o option. The image is always > created correctly. But it seems that the exporter > (org-publish-attachment) refuses to overwrite existing files. > Hi Sebastian, I see now. It looks like org-publish-attachment uses the `copy-file' function to copy files to the publish directory. We just need to set an option argument to copy-file to tell it how to deal with overwriting. ,----[from copy-file documentation] | The optional third argument OK-IF-ALREADY-EXISTS specifies what to do | if file NEWNAME already exists. If OK-IF-ALREADY-EXISTS is nil, we | signal a `file-already-exists' error without overwriting. If | OK-IF-ALREADY-EXISTS is a number, we request confirmation from the user | about overwriting; this is what happens in interactive use with M-x. | Any other value for OK-IF-ALREADY-EXISTS means to overwrite the | existing file. `---- This file is currently set to nil, we should probably set it to t so it always overwrites files. Does that sound like the best option? The attached minimal patch set this option to t. Best -- Eric [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: org-publish.patch --] [-- Type: text/x-diff, Size: 515 bytes --] diff --git a/lisp/org-publish.el b/lisp/org-publish.el index aa8c495..bbd9180 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -537,7 +537,7 @@ See `org-publish-org-to' to the list of arguments." ;; make sure eshell/cp code is loaded (unless (file-directory-p pub-dir) (make-directory pub-dir t)) - (copy-file filename pub-dir)) + (copy-file filename pub-dir t)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Publishing files, sets of files, and indices [-- Attachment #3: Type: text/plain, Size: 204 bytes --] _______________________________________________ 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 ^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 20:47 ` Eric Schulte @ 2008-11-12 21:54 ` Sebastian Rose 2008-11-12 23:01 ` Carsten Dominik 1 sibling, 0 replies; 28+ messages in thread From: Sebastian Rose @ 2008-11-12 21:54 UTC (permalink / raw) To: emacs-orgmode Hi Eric, yes, this looks fine to me and works :-) What do the others think? I believe overwriting is the desired behaviour on export. I use org-publish-attachment for images, stylesheets, scripts and so on. And they shurely should be updated in the publishing-directory. I just wonder, why I never ran into that problem. All the other files where always overwritten. One more: If I refile an entry containing such an ditaa image, the old image remains in both, the base-directory, and the publishing-directory. An option to set the image directory relative to base-directory (and adjust the link accordingly) would be very nice. That way, we could refer to the image in other files too and the links would work after refiling such an entry. Thanks again, Sebastian "Eric Schulte" <schulte.eric@gmail.com> writes: > Sebastian Rose <sebastian_rose@gmx.de> writes: > >> Hi Eric, >> >> >> sorry for being unclear. I use the -o option. The image is always >> created correctly. But it seems that the exporter >> (org-publish-attachment) refuses to overwrite existing files. >> > > Hi Sebastian, > > I see now. It looks like org-publish-attachment uses the `copy-file' > function to copy files to the publish directory. We just need to set an > option argument to copy-file to tell it how to deal with overwriting. > > ,----[from copy-file documentation] > | The optional third argument OK-IF-ALREADY-EXISTS specifies what to do > | if file NEWNAME already exists. If OK-IF-ALREADY-EXISTS is nil, we > | signal a `file-already-exists' error without overwriting. If > | OK-IF-ALREADY-EXISTS is a number, we request confirmation from the user > | about overwriting; this is what happens in interactive use with M-x. > | Any other value for OK-IF-ALREADY-EXISTS means to overwrite the > | existing file. > `---- > > This file is currently set to nil, we should probably set it to t so it > always overwrites files. Does that sound like the best option? > > The attached minimal patch set this option to t. > > Best -- Eric > > > diff --git a/lisp/org-publish.el b/lisp/org-publish.el > index aa8c495..bbd9180 100644 > --- a/lisp/org-publish.el > +++ b/lisp/org-publish.el > @@ -537,7 +537,7 @@ See `org-publish-org-to' to the list of arguments." > ;; make sure eshell/cp code is loaded > (unless (file-directory-p pub-dir) > (make-directory pub-dir t)) > - (copy-file filename pub-dir)) > + (copy-file filename pub-dir t)) > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;;; Publishing files, sets of files, and indices > -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Email: s.rose emma-stil de, sebastian_rose gmx de Http: www.emma-stil.de ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 20:47 ` Eric Schulte 2008-11-12 21:54 ` Sebastian Rose @ 2008-11-12 23:01 ` Carsten Dominik 1 sibling, 0 replies; 28+ messages in thread From: Carsten Dominik @ 2008-11-12 23:01 UTC (permalink / raw) To: Eric Schulte; +Cc: emacs-orgmode Wow, this patch is important enough for an "emergency release", 6.12b. Up on the git repo now. Thanks - Carsten On Nov 12, 2008, at 9:47 PM, Eric Schulte wrote: > Sebastian Rose <sebastian_rose@gmx.de> writes: > >> Hi Eric, >> >> >> sorry for being unclear. I use the -o option. The image is always >> created correctly. But it seems that the exporter >> (org-publish-attachment) refuses to overwrite existing files. >> > > Hi Sebastian, > > I see now. It looks like org-publish-attachment uses the `copy-file' > function to copy files to the publish directory. We just need to > set an > option argument to copy-file to tell it how to deal with overwriting. > > ,----[from copy-file documentation] > | The optional third argument OK-IF-ALREADY-EXISTS specifies what to > do > | if file NEWNAME already exists. If OK-IF-ALREADY-EXISTS is nil, we > | signal a `file-already-exists' error without overwriting. If > | OK-IF-ALREADY-EXISTS is a number, we request confirmation from the > user > | about overwriting; this is what happens in interactive use with M-x. > | Any other value for OK-IF-ALREADY-EXISTS means to overwrite the > | existing file. > `---- > > This file is currently set to nil, we should probably set it to t so > it > always overwrites files. Does that sound like the best option? > > The attached minimal patch set this option to t. > > Best -- Eric > > diff --git a/lisp/org-publish.el b/lisp/org-publish.el > index aa8c495..bbd9180 100644 > --- a/lisp/org-publish.el > +++ b/lisp/org-publish.el > @@ -537,7 +537,7 @@ See `org-publish-org-to' to the list of > arguments." > ;; make sure eshell/cp code is loaded > (unless (file-directory-p pub-dir) > (make-directory pub-dir t)) > - (copy-file filename pub-dir)) > + (copy-file filename pub-dir t)) > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;;; Publishing files, sets of files, and indices ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: Export ascii-images using ditaa when targeting HTML? 2008-11-12 1:59 ` Eric Schulte 2008-11-12 6:45 ` Carsten Dominik 2008-11-12 13:54 ` Sebastian Rose @ 2008-11-12 22:42 ` Eric Schulte 2 siblings, 0 replies; 28+ messages in thread From: Eric Schulte @ 2008-11-12 22:42 UTC (permalink / raw) To: Eric Schulte; +Cc: emacs-orgmode I added support for the dot graphing utility (see http://www.graphviz.org/). The updated code with examples is in the github repo. "Eric Schulte" <schulte.eric@gmail.com> writes: > 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 <xmfrw8002@sneakemail.com> 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 ^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2008-11-14 16:02 UTC | newest] Thread overview: 28+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-11-06 16:12 Export ascii-images using ditaa when targeting HTML? Mac 2008-11-12 1:57 ` Eric Schulte 2008-11-12 8:14 ` Mac 2008-11-12 9:44 ` Mac 2008-11-12 10:00 ` Carsten Dominik 2008-11-12 10:17 ` Mac 2008-11-14 14:54 ` Bernt Hansen 2008-11-14 15:51 ` Carsten Dominik 2008-11-14 16:02 ` Bernt Hansen 2008-11-12 1:59 ` Eric Schulte 2008-11-12 6:45 ` Carsten Dominik 2008-11-12 9:53 ` Mac 2008-11-12 13:54 ` Sebastian Rose 2008-11-12 15:59 ` Carsten Dominik 2008-11-12 18:33 ` Sebastian Rose 2008-11-12 18:42 ` Sebastian Rose 2008-11-12 19:18 ` Bernt Hansen 2008-11-12 19:41 ` Sebastian Rose 2008-11-12 19:47 ` Bernt Hansen 2008-11-12 20:33 ` Sebastian Rose 2008-11-12 18:53 ` Eric Schulte 2008-11-12 19:13 ` Sebastian Rose 2008-11-12 19:30 ` Eric Schulte 2008-11-12 20:31 ` Sebastian Rose 2008-11-12 20:47 ` Eric Schulte 2008-11-12 21:54 ` Sebastian Rose 2008-11-12 23:01 ` Carsten Dominik 2008-11-12 22:42 ` Eric Schulte
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).