From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Lomov Subject: [HTML][PATCH] use 'class' instead of 'align' for caption Date: Sun, 29 Dec 2013 08:23:15 +0900 Message-ID: <20131228232315.GA905@smoon> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vx3ED-0001V9-9h for emacs-orgmode@gnu.org; Sat, 28 Dec 2013 18:23:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vx3E2-00028R-Uy for emacs-orgmode@gnu.org; Sat, 28 Dec 2013 18:23:33 -0500 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:45279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vx3E2-00028M-MV for emacs-orgmode@gnu.org; Sat, 28 Dec 2013 18:23:22 -0500 Received: by mail-la0-f45.google.com with SMTP id eh20so4841644lab.4 for ; Sat, 28 Dec 2013 15:23:20 -0800 (PST) Received: from smoon ([188.168.195.46]) by mx.google.com with ESMTPSA id qx1sm24283030lbb.15.2013.12.28.15.23.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Dec 2013 15:23:19 -0800 (PST) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: General discussions about Org-mode --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I prepared a small patch to make ox-html use 'class' attribute instead of 'align' in caption element when it is used in tables. The reason is simple, according to xhtml1 Strict specification 'caption' element doesn't have 'align' attribute, this is true for HTML5 too. Instead of 'align' attribute it is more cleanly to use 'class' attribute and to add corresponding entries to CSS. In included patch I didn't add word TINYCHANGE because I don't is it small or not (I don't understand what exactly the phrase > your total contribution (all patches you submit) should change less than > 15 lines means, how lines are counted). --- WBR, Vladimir Lomov -- Never argue with a man who buys ink by the barrel. --y0ulUmNC+osPPQO6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-HTML-export-Use-class-for-caption-instead-of-align.patch" >From 449cfb3cb93a14c58591df15f4a5ff8c7fe1a72a Mon Sep 17 00:00:00 2001 From: Vladimir Lomov Date: Sun, 29 Dec 2013 07:33:59 +0900 Subject: [PATCH 1/2] HTML export: Use class for caption instead of align * ox-html.el: when exporting tables with caption use 'class' attributes instead of 'align', add two new entries into css section to put caption at top or at bottom of table. Signed-off-by: Vladimir Lomov --- lisp/ox-html.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 9fa0a8c..38988ed 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -280,6 +280,8 @@ for the JavaScript code in this tag. pre.src-sql:before { content: 'SQL'; } table { border-collapse:collapse; } + caption.t-above { caption-side: top; } + caption.t-bottom { caption-side: bottom; } td, th { vertical-align:top; } th.right { text-align: center; } th.left { text-align: center; } @@ -3268,8 +3270,8 @@ contextual information." (if (equal attributes "") "" (concat " " attributes)) (if (not caption) "" (format (if org-html-table-caption-above - "%s" - "%s") + "%s" + "%s") (concat "" (format (org-html--translate "Table %d:" info) number) -- 1.8.5.2 --y0ulUmNC+osPPQO6--