* [HTML][PATCH] use 'class' instead of 'align' for caption
@ 2013-12-28 23:23 Vladimir Lomov
2014-01-03 10:32 ` Bastien
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Lomov @ 2013-12-28 23:23 UTC (permalink / raw)
To: General discussions about Org-mode
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
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.
[-- Attachment #2: 0001-HTML-export-Use-class-for-caption-instead-of-align.patch --]
[-- Type: text/x-diff, Size: 1537 bytes --]
From 449cfb3cb93a14c58591df15f4a5ff8c7fe1a72a Mon Sep 17 00:00:00 2001
From: Vladimir Lomov <lomov.vl@gmail.com>
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 <lomov.vl@gmail.com>
---
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
- "<caption align=\"above\">%s</caption>"
- "<caption align=\"bottom\">%s</caption>")
+ "<caption class=\"t-above\">%s</caption>"
+ "<caption class=\"t-bottom\">%s</caption>")
(concat
"<span class=\"table-number\">"
(format (org-html--translate "Table %d:" info) number)
--
1.8.5.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-03 10:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28 23:23 [HTML][PATCH] use 'class' instead of 'align' for caption Vladimir Lomov
2014-01-03 10:32 ` Bastien
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).