[cl-typesetting-devel] HTML rendering

Klaus Weidner klaus at atsec.com
Sun Apr 18 16:30:14 UTC 2004


On Sun, Apr 18, 2004 at 03:16:59PM +0200, Marc Battyani wrote:
> "Klaus Weidner" <klaus at atsec.com> wrote:
> > I think this is an important step towards having cl-typesetting behave
> > more like a normal program with input and output files rather than
> > exclusively as a library.
> 
> Yes, I even think it will be a good thing to deliver cl-typesetting stand
> alone applications in the future.

The major pain regarding this is (you guessed it) zlib, but other than
that it should be fairly easy to build a standalone image that can do
this. I'll have a shot with clisp, since that has by far the smallest
core sizes.

> > - This would also be a good opportunity to document the style parameters
> >   supported by the public interface, since grepping through the source is
> >   suboptimal.
> 
> Sure, of course the doc should be written with cl-typesetting :)

I disagree there :-) 

I think that it should be written in some kind of standard format that
can be rendered by cl-typesetting, which isn't the same thing. I'd
suggest using XHTML, and personally I'd even prefer POD (Perl "Plain Old
Documentation"), which has the advantage of having minimally intrusive
markup and therefore is unpainful to type.

Compare:

	(with-style (:font "Times-Italic") "italic")
	" and "
	(with-style (:font "Times-Bold") "bold")
	"text.

        \texit{italic} and \texbb{bold} text.

        <i>italic</i> and <b>bold</b> text.

        I<italic> and B<bold> text.

Of course the Lisp version could be abbreviated, but even the minimal

	(I "italic") " and " (B "bold") " text."

is still way too long, and I'd hate having to put all the text I'm
writing into double quotes, and having to worry about escaping
backslashes and such things.

I even have a POD emacs mode that displays the font changes inline while
editing and can hide the tags from view...

> > - The W3 FO specification is a surprisingly good fit to the
> >   cl-typesetting internals, and since XML is isomorphic to s-exprs, I
> >   think it would make sense to stay close to that model where
> >   appropriate. That would make it much easier to reuse existing work,
> >   i.e. for DocBook or OpenOffice rendering.
> 
> Is the W3 FO something considered a good thing and used in a lot of
> applications ?

There's two parts of this. XSL style sheet transformations are a
descendant of CSS (cascading style sheets), and can be used to do
transformations on XML document. The FO (formatting objects) XML
specification is basically a low-level way to describe page layout.

I think it would be doable to read XSL transform descriptions and run
them as Lisp code, which would instantly make the fairly large existing
number of transformations that were worked out (with huge effort) by the
XML-heads available for Lisp code.

But that only makes sense if the target typesetting engine can handle FO,
in the sense of being able to render FO objects in the expected way with
isomorphic transformations. I'm of course not talking about rewriting
parts of cl-typesetting in XML, what I mean is that it would be useful to
add support for FO features that cl-typesetting doesn't have yet, and try
to make the existing ones have the same semantics.

Another potential advantage is that FO has well-documented style and
layout keywords and parameters that could be adapted directly, instead of
inventing our own incompatible set.

The XSL-FO route is being used by DocBook documentation, and this is
currently hindered substantially by the rather clunky toolchain that's
being used for this. I'm sure that an easily installed and useful tool
would be greatly appreciated by many people.

In general, I think there's a huge opportunity for Lisp here - XML is for
the most part extremely easy to read and write with Lisp (except for
character encoding issues), and since apparently many people love XML
syntax (and are alarmed by Lisp parentheses), I think that's a great way
to interface with the rest of the world.

-Klaus




More information about the cl-typesetting-devel mailing list