emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Re: [Patch] HTML export -- Allow to change the name of the global DI


From: Matt Lundin
Subject: [O] Re: [Patch] HTML export -- Allow to change the name of the global DIV
Date: Mon, 14 Mar 2011 09:11:06 -0400
User-agent: Gnus/5.110014 (No Gnus v0.14) Emacs/23.3 (gnu/linux)

Bastien <address@hidden> writes:

> Are there other hardcoded HTML classes/ids that the user might want to
> customize?  If so, can we think about a simple way to define all of them
> at once?

The id/class values are hardcoded in several different places and
generated in different ways in org-html.el, so I think the only
practical solution, for now, would be to create variables for each one
(or perhaps an alist that encompasses all of them).

[Slightly OT dreaming]

Over the long-term, it would be nice to give the user a simple way to
control not only classes and ids, but also the placement of structural
divs and other tags. Perhaps we could develop some sort of templating
system, allowing the user to create an custom html skeleton which is
then fleshed out with data from the org file. The user might then
customize which tags, if any, should enclose, say, a level one outline
tree. Properties and tags in an org file might be used to specify the
use of alternate templates within particular sections of the document.

This would have several benefits:

1. It would allow users to export html to an arbitrary tag structure.
   One might, for instance, create static pages that conform to the
   structure/styling of an existing web site. Or one might have
   different types of pages within a single, org-generated website.

2. It would allow simple, clean html when exporting small snippets.
   Currently, when calling C-u M-x org-export-region-as-html, the output
   contains a number of hard-coded divs, classes, and ids. This makes it
   difficult to integrate such snippets into another html file.

          <div id="outline-container-1" class="outline-2">
          <h2 id="sec-1">A section </h2>
          <div class="outline-text-2" id="text-1">

          <p>
          Some text.
          </p></div>
          </div>

3. It would allow users to try out the new html5 tags (<section>,
   <article>, <nav>, etc.).

4. It would offer more consistent customization. At the moment, certain
   tags can be customized (e.g., table tags) but other elements (e.g.,
   lists) cannot be.

5. It would make it easier to create html that works with existing
   scripts (such as the s5 presentation system [1]). 

My guess is that such configuration would depend on your rewrite of the
exporting parser. It would indeed be wonderful if at some point the
export engine returned a generic data structure that could then be
plugged into a modular templating system.

That said, an org file is a *complex* thing, and the exporter already
produces very nice html. :)

Best,
Matt

Footnotes:

[1] http://meyerweb.com/eric/tools/s5/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]