From: Mike Newman <mike@newmanfamily.me.uk>
To: emacs-orgmode@gnu.org
Subject: Re: Html export suggestion (use of <div>)
Date: Mon, 15 Oct 2007 23:08:38 +0100 [thread overview]
Message-ID: <20071015230838.61f67e0a@newmanfamily.me.uk> (raw)
In-Reply-To: <20071005215715.21604ade@newmanfamily.me.uk>
Here is a more refined suggestion, with links to examples
Mike
<Div> in HTML Export
====================
Table of Contents
=================
1 Proposal
2 Implementation
3 Motivation
3.1 Applying styles via CSS
3.2 Applying transformations via XSLT
4 Drawbacks
5 Additional suggestion
6 Options
7 Examples
8 Acknowledgements
1 Proposal
~~~~~~~~~~
I propose that on html export, sections of the document should be
wrapped in <div> </div> markers, to reflect the outline structure
given by org mode.
2 Implementation
~~~~~~~~~~~~~~~~
I think this should be quite simple to implement. Prior to each
heading, open </div> elements would be closed (if the heading level
was higher than the previous heading level), and a new <div> element
would be opened.
3 Motivation
~~~~~~~~~~~~
There are at least two reasons why this might be useful:
3.1 Applying styles via CSS
===========================
This allows, for example:
- Styles to be applied in a way that makes it clear how the sections
are nested, e.g. by indentation, drawing a border or setting a
background
- Styles could be used to display content in a way that is not
possible without them. Links to examples are given below.
I imagine that in time, a variety of style sheets for displaying the
resulting html could be shared, saving users the trouble of developing
their own.
3.2 Applying transformations via XSLT
=====================================
Selecting sections or subsections of a file should be much easier if
they correspond to a single XML element.
4 Drawbacks
~~~~~~~~~~~
- Increased file size (but only very slightly)
- Possibly increased time for browser to render page? I am not aware
of a problem
5 Additional suggestion
~~~~~~~~~~~~~~~~~~~~~~~
It would also be useful to wrap the Table of Contents and the final
part of the HTML file (Author's name and date) in their own <div>.
6 Options
~~~~~~~~~
Attributes can be added to a <div>, most importantly "class" and
"id". Adding the class attribute (as suggested by Cezar) would allow
different sections of the file to be formatted in different ways.
As a first step, I would suggest adding the <div> without a class or
id.
It was suggested that adding <div> to exported HTML should be
controlled by an option. I would see it as fairly harmless, even to
those who would not use the feature, so in my opinion the option would
be an unnecessary complication.
7 Examples
~~~~~~~~~~
I have added <div> elements as proposed here to an HTML file. This
can be viewed, rendered with different style sheets at:
- [http://www.newmanfamily.me.uk/orgmode/Example-defaultstyle.html]
- [http://www.newmanfamily.me.uk/orgmode/Example-sectioned.html]
- [http://www.newmanfamily.me.uk/orgmode/Example-floated.html]
It should be interesting to see how they behave as the width of the
browser window changes - particularly with the last example. (Only
tested in Firefox).
8 Acknowledgements
~~~~~~~~~~~~~~~~~~
I would like to thank Cezar and William Henney for their suggestions.
(And Carsten, of course).
next prev parent reply other threads:[~2007-10-15 22:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-05 20:57 Html export suggestion (use of <div>) Mike Newman
2007-10-06 8:25 ` cezar
2007-10-08 20:00 ` Mike Newman
2007-10-09 7:56 ` cezar
2007-10-08 21:04 ` William Henney
2007-10-09 8:03 ` cezar
2007-10-08 13:05 ` Dmitri Minaev
2007-10-15 22:08 ` Mike Newman [this message]
2007-10-17 9:13 ` Carsten Dominik
2007-10-17 10:40 ` Bastien
2007-10-18 13:00 ` cezar
-- strict thread matches above, loose matches on Subject: below --
2007-10-10 13:31 cezar
2007-10-10 14:36 ` cezar
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071015230838.61f67e0a@newmanfamily.me.uk \
--to=mike@newmanfamily.me.uk \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.