From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Newman Subject: Re: Html export suggestion (use of
) Date: Mon, 15 Oct 2007 23:08:38 +0100 Message-ID: <20071015230838.61f67e0a@newmanfamily.me.uk> References: <20071005215715.21604ade@newmanfamily.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IhY7B-0006Hl-Sa for emacs-orgmode@gnu.org; Mon, 15 Oct 2007 18:08:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IhY7B-0006GN-6x for emacs-orgmode@gnu.org; Mon, 15 Oct 2007 18:08:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhY7B-0006GF-3f for emacs-orgmode@gnu.org; Mon, 15 Oct 2007 18:08:45 -0400 Received: from smtp2.enta.net ([62.249.192.218]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IhY7A-0008Bb-IT for emacs-orgmode@gnu.org; Mon, 15 Oct 2007 18:08:44 -0400 Received: from newmanfamily.me.uk (84-45-232-14.no-dns-yet.enta.net [84.45.232.14]) by smtp2.enta.net (Postfix) with ESMTP id 697AD14D9E3 for ; Mon, 15 Oct 2007 23:14:05 +0100 (BST) Received: from newmanfamily.me.uk (localhost.localdomain [127.0.0.1]) by newmanfamily.me.uk (8.14.1/8.14.1) with ESMTP id l9FM8c4S012846 for ; Mon, 15 Oct 2007 23:08:39 +0100 In-Reply-To: <20071005215715.21604ade@newmanfamily.me.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Here is a more refined suggestion, with links to examples Mike
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
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
elements would be closed (if the heading level was higher than the previous heading level), and a new
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
. 6 Options ~~~~~~~~~ Attributes can be added to a
, 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
without a class or id. It was suggested that adding
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
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).