From: Vladimir Lomov <lomov.vl@gmail.com>
To: General discussions about Org-mode <emacs-orgmode@gnu.org>
Subject: [HTML][PATCH] use 'class' instead of 'align' for caption
Date: Sun, 29 Dec 2013 08:23:15 +0900 [thread overview]
Message-ID: <20131228232315.GA905@smoon> (raw)
[-- 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
next reply other threads:[~2013-12-28 23:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-28 23:23 Vladimir Lomov [this message]
2014-01-03 10:32 ` [HTML][PATCH] use 'class' instead of 'align' for caption Bastien
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131228232315.GA905@smoon \
--to=lomov.vl@gmail.com \
--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 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).