emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: sand@blarg.net
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: PIC embedding to XHTML
Date: Mon, 22 Jun 2009 19:00:14 -0700	[thread overview]
Message-ID: <19008.14126.229480.924010@priss.frightenedpiglet.com> (raw)
In-Reply-To: <8FA50A43-511E-4A4E-BFBD-B919440BE70E@gmail.com>

Carsten Dominik writes:
> > When Firefox knows that your exported HTML file is really XHTML
> > (thanks to you changing `org-export-html-extension' to "xhtml"), you
> > can embed SVG into it.  For example, here are PIC diagrams:
> >
> > http://home.avvanta.com/~sand/org-mode/embedded-pic.xhtml
> >
> > Those are the first two diagrams in "Making Pictures With GNU PIC"
> > (http://www.kohala.com/start/troff/gpic.raymond.ps).
> >
> > It should be possible to do something similar for the "dot" exporter.
> 
> So ...  are you going to implement this, asking for an implementation,  
> or what...?

Still experimenting.  I got Dot working last night.  The problem is
we're missing some layers of abstraction:

  * If I submit code that lets "pic" blocks generate SVG for HTML,
    then things won't work properly for people without SVG-capable
    browsers.  We need some way for a user to say "When exporting
    HTML, render PIC using SVG".

  * The current "dot" and "ditaa" control mechanisms work by exposing
    command-line arguments, which get sent to the underlying program.
    Bernt Hansen's document example uses

        #+begin_dot gv01.png -Kdot -Tpng

    The "-Tpng" directive and the ".png" suffix should be implied by
    an "I want PNG" configuration, and the "-Kdot" should be implicit
    in the directive name.  There's definitely a need to allow
    command-line args on a block-by-block basis, but they need to be
    qualified by the rendering mechanism at least.

  * There are other arguments that you want to send to Emacs to do
    post-processing on the external program's output.  I use those to
    shrink the PIC SVG output down to something more manageable.
    In my examples, they are the "7in 1in" arguments; they are only
    meaningful for PIC-in-SVG, as the "pic2graph" tool always uses an
    8in x 8in canvas.

Taking all of this into account, we might come up with something like
the following:

#+begin_export pic html:svg latex:eps docbook:svg ascii:nroff
#+render_args eps :filename "figure_3_1.ps"
#+render_args svg :width "7in" :height "1in" :command "-F Times"
ellipse "document";
arrow;
box "\fIgpic\fP(1)";
arrow;
box width 1.2 "\fIgtbl\fP(1) or \fIgeqn\fP(1)" "(optional)" dashed;
arrow;
box "\fIgtroff\fP(1)";
arrow;
ellipse "PostScript"
#+end_export

The new directive is "#+begin_export".  First argument "pic" defines
how to interpret the contents.  The remaining arguments are supported
publishing types and what renderer to use.  Those are all optional;
users can set up their own defaults.

The "#+render_args" directive indicates a renderer, with a
property-list following.  My inclination is to have something that
Emacs can suck into a plist.  By convention, the ":command" tag
contains the arguments to pass down to the child process.

Comments?

Derek

      reply	other threads:[~2009-06-23  2:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-20  8:00 PIC embedding to XHTML sand
2009-06-22  8:40 ` Carsten Dominik
2009-06-23  2:00   ` sand [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=19008.14126.229480.924010@priss.frightenedpiglet.com \
    --to=sand@blarg.net \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).