From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kodi Arfer Subject: [PATCH] ox-html: Allow "Figure %d:", etc. to be styled Date: Wed, 03 Jul 2013 18:19:33 -0400 Message-ID: <51D4A375.9050904@arfer.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020700050106040807090302" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuVOl-0006Ku-DV for emacs-orgmode@gnu.org; Wed, 03 Jul 2013 18:19:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuVOi-0005lh-9l for emacs-orgmode@gnu.org; Wed, 03 Jul 2013 18:19:39 -0400 Received: from mxout-07.mxes.net ([216.86.168.182]:62217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuVOi-0005lP-30 for emacs-orgmode@gnu.org; Wed, 03 Jul 2013 18:19:36 -0400 Received: from [192.168.1.4] (unknown [24.46.191.0]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id CF03622E200 for ; Wed, 3 Jul 2013 18:19:34 -0400 (EDT) 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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------020700050106040807090302 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit --------------020700050106040807090302 Content-Type: text/x-patch; name="0001-ox-html-Allow-Figure-d-etc.-to-be-styled.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-ox-html-Allow-Figure-d-etc.-to-be-styled.patch" >From a873d204b2c4f3facf2d8658f69764acbd063246 Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Wed, 3 Jul 2013 17:51:56 -0400 Subject: [PATCH] ox-html: Allow "Figure %d:", etc. to be styled * lisp/ox-html.el (org-html-paragraph): Wrap "Figure %d:" in . (org-html-list-of-tables, org-html-table): Wrap "Table %d:" in . (org-html-list-of-listings): Wrap "Listing %d:" in . * doc/org.text (CSS support): Mention .figure-number, .listing-number, and .table-number. I didn't change org-html-style-default, so these labels won't appear special by default. TINYCHANGE --- doc/org.texi | 3 +++ lisp/ox-html.el | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 4eb9a45..ce4f715 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -11337,6 +11337,9 @@ p.creator @r{creator info, about org mode version} div.outline-N @r{div for outline level N (headline plus text))} div.outline-text-N @r{extra div for text at outline level N} .section-number-N @r{section number in headlines, different for each level} +.figure-number @r{label like "Figure 1:"} +.table-number @r{label like "Table 1:"} +.listing-number @r{label like "Listing 1:"} div.figure @r{how to format an inlined image} pre.src @r{formatted source code} pre.example @r{normal example} diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 9ce73c4..b0417e8 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2009,7 +2009,8 @@ of listings as a string, or nil if it is empty." org-html-toplevel-hlevel) "
\n
    \n" (let ((count 0) - (initial-fmt (org-html--translate "Listing %d:" info))) + (initial-fmt (format "%s" + (org-html--translate "Listing %d:" info)))) (mapconcat (lambda (entry) (let ((label (org-element-property :name entry)) @@ -2043,7 +2044,8 @@ of tables as a string, or nil if it is empty." org-html-toplevel-hlevel) "
    \n
      \n" (let ((count 0) - (initial-fmt (org-html--translate "Table %d:" info))) + (initial-fmt (format "%s" + (org-html--translate "Table %d:" info)))) (mapconcat (lambda (entry) (let ((label (org-element-property :name entry)) @@ -2790,12 +2792,13 @@ the plist used as a communication channel." 'org-html--has-caption-p)) (if (not (org-string-nw-p raw)) raw (concat + "" (format (org-html--translate "Figure %d:" info) (org-export-get-ordinal (org-element-map paragraph 'link 'identity info t) info nil 'org-html-standalone-image-p)) - " " raw)))) + " " raw)))) (label (org-element-property :name paragraph))) (org-html--wrap-image contents info caption label))) ;; Regular paragraph. @@ -3204,8 +3207,9 @@ contextual information." "%s" "%s") (concat - (format (org-html--translate "Table %d:" info) number) - " " (org-export-data caption info)))) + "" + (format (org-html--translate "Table %d:" info) number) + " " (org-export-data caption info)))) (funcall table-column-specs table info) contents))))) -- 1.8.1.2 --------------020700050106040807090302--