2013-01-27 17:11:34 -05:00
|
|
|
|
;;; ox-html.el --- HTML Back-End for Org Export Engine
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-01 10:04:24 -05:00
|
|
|
|
;; Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;; Author: Jambunathan K <kjambunathan at gmail dot com>
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Keywords: outlines, hypermedia, calendar, wp
|
|
|
|
|
|
2013-02-23 03:56:24 -05:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
2013-02-23 03:56:24 -05:00
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2013-02-23 03:56:24 -05:00
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; This library implements a HTML back-end for Org generic exporter.
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;; To test it, run:
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;; M-x org-export-as-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;; in an Org mode buffer. See ox.el for more details on how this
|
|
|
|
|
;; exporter works.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;; Dependencies
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(require 'ox)
|
|
|
|
|
(require 'ox-publish)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(require 'format-spec)
|
|
|
|
|
(eval-when-compile (require 'cl) (require 'table))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Function Declarations
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(declare-function org-id-find-id-file "org-id" (id))
|
|
|
|
|
(declare-function htmlize-region "ext:htmlize" (beg end))
|
|
|
|
|
(declare-function org-pop-to-buffer-same-window
|
|
|
|
|
"org-compat" (&optional buffer-or-name norecord label))
|
|
|
|
|
|
|
|
|
|
|
2012-05-18 04:18:42 -04:00
|
|
|
|
;;; Define Back-End
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-export-define-backend html
|
|
|
|
|
((bold . org-html-bold)
|
|
|
|
|
(center-block . org-html-center-block)
|
|
|
|
|
(clock . org-html-clock)
|
|
|
|
|
(code . org-html-code)
|
|
|
|
|
(drawer . org-html-drawer)
|
|
|
|
|
(dynamic-block . org-html-dynamic-block)
|
|
|
|
|
(entity . org-html-entity)
|
|
|
|
|
(example-block . org-html-example-block)
|
|
|
|
|
(export-block . org-html-export-block)
|
|
|
|
|
(export-snippet . org-html-export-snippet)
|
|
|
|
|
(fixed-width . org-html-fixed-width)
|
|
|
|
|
(footnote-definition . org-html-footnote-definition)
|
|
|
|
|
(footnote-reference . org-html-footnote-reference)
|
|
|
|
|
(headline . org-html-headline)
|
|
|
|
|
(horizontal-rule . org-html-horizontal-rule)
|
|
|
|
|
(inline-src-block . org-html-inline-src-block)
|
|
|
|
|
(inlinetask . org-html-inlinetask)
|
2013-02-11 16:19:23 -05:00
|
|
|
|
(inner-template . org-html-inner-template)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(italic . org-html-italic)
|
|
|
|
|
(item . org-html-item)
|
|
|
|
|
(keyword . org-html-keyword)
|
|
|
|
|
(latex-environment . org-html-latex-environment)
|
|
|
|
|
(latex-fragment . org-html-latex-fragment)
|
|
|
|
|
(line-break . org-html-line-break)
|
|
|
|
|
(link . org-html-link)
|
|
|
|
|
(paragraph . org-html-paragraph)
|
|
|
|
|
(plain-list . org-html-plain-list)
|
|
|
|
|
(plain-text . org-html-plain-text)
|
|
|
|
|
(planning . org-html-planning)
|
|
|
|
|
(property-drawer . org-html-property-drawer)
|
|
|
|
|
(quote-block . org-html-quote-block)
|
|
|
|
|
(quote-section . org-html-quote-section)
|
|
|
|
|
(radio-target . org-html-radio-target)
|
|
|
|
|
(section . org-html-section)
|
|
|
|
|
(special-block . org-html-special-block)
|
|
|
|
|
(src-block . org-html-src-block)
|
|
|
|
|
(statistics-cookie . org-html-statistics-cookie)
|
|
|
|
|
(strike-through . org-html-strike-through)
|
|
|
|
|
(subscript . org-html-subscript)
|
|
|
|
|
(superscript . org-html-superscript)
|
|
|
|
|
(table . org-html-table)
|
|
|
|
|
(table-cell . org-html-table-cell)
|
|
|
|
|
(table-row . org-html-table-row)
|
|
|
|
|
(target . org-html-target)
|
|
|
|
|
(template . org-html-template)
|
|
|
|
|
(timestamp . org-html-timestamp)
|
|
|
|
|
(underline . org-html-underline)
|
|
|
|
|
(verbatim . org-html-verbatim)
|
|
|
|
|
(verse-block . org-html-verse-block))
|
2012-07-23 08:06:13 -04:00
|
|
|
|
:export-block "HTML"
|
2013-03-01 17:14:30 -05:00
|
|
|
|
:filters-alist ((:filter-options . org-html-infojs-install-script)
|
|
|
|
|
(:filter-final-output . org-html-final-function))
|
2012-09-09 07:08:52 -04:00
|
|
|
|
:menu-entry
|
|
|
|
|
(?h "Export to HTML"
|
2013-02-08 16:19:37 -05:00
|
|
|
|
((?H "As HTML buffer" org-html-export-as-html)
|
|
|
|
|
(?h "As HTML file" org-html-export-to-html)
|
|
|
|
|
(?o "As HTML file and open"
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(lambda (a s v b)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(if a (org-html-export-to-html t s v b)
|
|
|
|
|
(org-open-file (org-html-export-to-html nil s v b)))))))
|
2012-07-23 08:06:13 -04:00
|
|
|
|
:options-alist
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((:html-extension nil nil org-html-extension)
|
|
|
|
|
(:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
|
|
|
|
|
(:html-link-up "HTML_LINK_UP" nil org-html-link-up)
|
|
|
|
|
(:html-mathjax "HTML_MATHJAX" nil "" space)
|
|
|
|
|
(:html-postamble nil "html-postamble" org-html-postamble)
|
|
|
|
|
(:html-preamble nil "html-preamble" org-html-preamble)
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(:html-head "HTML_HEAD" nil org-html-head newline)
|
2013-03-03 00:34:35 -05:00
|
|
|
|
(:html-head-include-default-style nil nil org-html-head-include-default-style)
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(:html-head-include-scripts nil nil org-html-head-include-scripts)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(:html-table-tag nil nil org-html-table-tag)
|
|
|
|
|
;; Redefine regular options.
|
|
|
|
|
(:creator "CREATOR" nil org-html-creator-string)
|
|
|
|
|
(:with-latex nil "tex" org-html-with-latex)
|
|
|
|
|
;; Leave room for "ox-infojs.el" extension.
|
|
|
|
|
(:infojs-opt "INFOJS_OPT" nil nil)))
|
2012-05-18 04:18:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Internal Variables
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defvar org-html-format-table-no-css)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(defvar htmlize-buffer-places) ; from htmlize.el
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defconst org-html-special-string-regexps
|
2013-03-02 00:30:46 -05:00
|
|
|
|
'(("\\\\-" . "­") ; shy
|
|
|
|
|
("---\\([^-]\\)" . "—\\1") ; mdash
|
|
|
|
|
("--\\([^-]\\)" . "–\\1") ; ndash
|
|
|
|
|
("\\.\\.\\." . "…")) ; hellip
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Regular expressions for special string conversion.")
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defconst org-html-scripts
|
2012-09-25 16:17:54 -04:00
|
|
|
|
"<script type=\"text/javascript\">
|
|
|
|
|
/*
|
|
|
|
|
@licstart The following is the entire license notice for the
|
|
|
|
|
JavaScript code in this tag.
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
The JavaScript code in this tag is free software: you can
|
|
|
|
|
redistribute it and/or modify it under the terms of the GNU
|
|
|
|
|
General Public License (GNU GPL) as published by the Free Software
|
|
|
|
|
Foundation, either version 3 of the License, or (at your option)
|
|
|
|
|
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
|
|
|
|
|
|
As additional permission under GNU GPL version 3 section 7, you
|
|
|
|
|
may distribute non-source (e.g., minimized or compacted) forms of
|
|
|
|
|
that code without the copy of the GNU GPL normally required by
|
|
|
|
|
section 4, provided you include this license notice and a URL
|
|
|
|
|
through which recipients can access the Corresponding Source.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@licend The above is the entire license notice
|
|
|
|
|
for the JavaScript code in this tag.
|
|
|
|
|
*/
|
2012-07-24 14:48:41 -04:00
|
|
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
|
|
|
function CodeHighlightOn(elem, id)
|
|
|
|
|
{
|
|
|
|
|
var target = document.getElementById(id);
|
|
|
|
|
if(null != target) {
|
|
|
|
|
elem.cacheClassElem = elem.className;
|
|
|
|
|
elem.cacheClassTarget = target.className;
|
|
|
|
|
target.className = \"code-highlighted\";
|
|
|
|
|
elem.className = \"code-highlighted\";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function CodeHighlightOff(elem, id)
|
|
|
|
|
{
|
|
|
|
|
var target = document.getElementById(id);
|
|
|
|
|
if(elem.cacheClassElem)
|
|
|
|
|
elem.className = elem.cacheClassElem;
|
|
|
|
|
if(elem.cacheClassTarget)
|
|
|
|
|
target.className = elem.cacheClassTarget;
|
|
|
|
|
}
|
|
|
|
|
/*]]>*///-->
|
|
|
|
|
</script>"
|
2012-09-25 16:17:54 -04:00
|
|
|
|
"Basic JavaScript that is needed by HTML files produced by Org mode.")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defconst org-html-style-default
|
2012-09-25 16:17:54 -04:00
|
|
|
|
"<style type=\"text/css\">
|
2012-02-18 01:52:31 -05:00
|
|
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
|
|
|
html { font-family: Times, serif; font-size: 12pt; }
|
|
|
|
|
.title { text-align: center; }
|
|
|
|
|
.todo { color: red; }
|
|
|
|
|
.done { color: green; }
|
|
|
|
|
.tag { background-color: #add8e6; font-weight:normal }
|
|
|
|
|
.target { }
|
|
|
|
|
.timestamp { color: #bebebe; }
|
|
|
|
|
.timestamp-kwd { color: #5f9ea0; }
|
|
|
|
|
.right {margin-left:auto; margin-right:0px; text-align:right;}
|
|
|
|
|
.left {margin-left:0px; margin-right:auto; text-align:left;}
|
|
|
|
|
.center {margin-left:auto; margin-right:auto; text-align:center;}
|
|
|
|
|
p.verse { margin-left: 3% }
|
|
|
|
|
pre {
|
|
|
|
|
border: 1pt solid #AEBDCC;
|
|
|
|
|
background-color: #F3F5F7;
|
|
|
|
|
padding: 5pt;
|
|
|
|
|
font-family: courier, monospace;
|
|
|
|
|
font-size: 90%;
|
|
|
|
|
overflow:auto;
|
|
|
|
|
}
|
|
|
|
|
table { border-collapse: collapse; }
|
|
|
|
|
td, th { vertical-align: top; }
|
|
|
|
|
th.right { text-align:center; }
|
|
|
|
|
th.left { text-align:center; }
|
|
|
|
|
th.center { text-align:center; }
|
|
|
|
|
td.right { text-align:right; }
|
|
|
|
|
td.left { text-align:left; }
|
|
|
|
|
td.center { text-align:center; }
|
|
|
|
|
dt { font-weight: bold; }
|
|
|
|
|
div.figure { padding: 0.5em; }
|
|
|
|
|
div.figure p { text-align: center; }
|
|
|
|
|
div.inlinetask {
|
|
|
|
|
padding:10px;
|
|
|
|
|
border:2px solid gray;
|
|
|
|
|
margin:10px;
|
|
|
|
|
background: #ffffcc;
|
|
|
|
|
}
|
|
|
|
|
textarea { overflow-x: auto; }
|
|
|
|
|
.linenr { font-size:smaller }
|
|
|
|
|
.code-highlighted {background-color:#ffff00;}
|
|
|
|
|
.org-info-js_info-navigation { border-style:none; }
|
|
|
|
|
#org-info-js_console-label { font-size:10px; font-weight:bold;
|
|
|
|
|
white-space:nowrap; }
|
|
|
|
|
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
|
|
|
|
|
font-weight:bold; }
|
|
|
|
|
/*]]>*/-->
|
|
|
|
|
</style>"
|
|
|
|
|
"The default style specification for exported HTML files.
|
2013-03-02 12:05:16 -05:00
|
|
|
|
You can use `org-html-head' and `org-html-head-extra' to add to
|
|
|
|
|
this style. If you don't want to include this default style,
|
|
|
|
|
customize `org-html-head-include-default-style'.")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
|
|
|
|
;;; User Configuration Variables
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defgroup org-export-html nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Options for exporting Org mode files to HTML."
|
|
|
|
|
:tag "Org Export HTML"
|
|
|
|
|
:group 'org-export)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2013-03-01 08:26:55 -05:00
|
|
|
|
;;;; Handle infojs
|
|
|
|
|
|
|
|
|
|
(defvar org-html-infojs-opts-table
|
|
|
|
|
'((path PATH "http://orgmode.org/org-info.js")
|
|
|
|
|
(view VIEW "info")
|
|
|
|
|
(toc TOC :with-toc)
|
|
|
|
|
(ftoc FIXED_TOC "0")
|
|
|
|
|
(tdepth TOC_DEPTH "max")
|
|
|
|
|
(sdepth SECTION_DEPTH "max")
|
|
|
|
|
(mouse MOUSE_HINT "underline")
|
|
|
|
|
(buttons VIEW_BUTTONS "0")
|
|
|
|
|
(ltoc LOCAL_TOC "1")
|
|
|
|
|
(up LINK_UP :html-link-up)
|
|
|
|
|
(home LINK_HOME :html-link-home))
|
|
|
|
|
"JavaScript options, long form for script, default values.")
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-use-infojs 'when-configured
|
|
|
|
|
"Non-nil when Sebastian Rose's Java Script org-info.js should be active.
|
|
|
|
|
This option can be nil or t to never or always use the script.
|
|
|
|
|
It can also be the symbol `when-configured', meaning that the
|
|
|
|
|
script will be linked into the export file if and only if there
|
|
|
|
|
is a \"#+INFOJS_OPT:\" line in the buffer. See also the variable
|
|
|
|
|
`org-html-infojs-options'."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Never" nil)
|
|
|
|
|
(const :tag "When configured in buffer" when-configured)
|
|
|
|
|
(const :tag "Always" t)))
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-infojs-options
|
|
|
|
|
(mapcar (lambda (x) (cons (car x) (nth 2 x))) org-html-infojs-opts-table)
|
|
|
|
|
"Options settings for the INFOJS JavaScript.
|
|
|
|
|
Each of the options must have an entry in `org-html-infojs-opts-table'.
|
|
|
|
|
The value can either be a string that will be passed to the script, or
|
|
|
|
|
a property. This property is then assumed to be a property that is defined
|
|
|
|
|
by the Export/Publishing setup of Org.
|
|
|
|
|
The `sdepth' and `tdepth' parameters can also be set to \"max\", which
|
|
|
|
|
means to use the maximum value consistent with other options."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type
|
|
|
|
|
`(set :greedy t :inline t
|
|
|
|
|
,@(mapcar
|
|
|
|
|
(lambda (x)
|
|
|
|
|
(list 'cons (list 'const (car x))
|
|
|
|
|
'(choice
|
|
|
|
|
(symbol :tag "Publishing/Export property")
|
|
|
|
|
(string :tag "Value"))))
|
|
|
|
|
org-html-infojs-opts-table)))
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-infojs-template
|
|
|
|
|
"<script type=\"text/javascript\" src=\"%SCRIPT_PATH\">
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @source: %SCRIPT_PATH
|
|
|
|
|
*
|
|
|
|
|
* @licstart The following is the entire license notice for the
|
|
|
|
|
* JavaScript code in %SCRIPT_PATH.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2012-2013 Sebastian Rose
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* The JavaScript code in this tag is free software: you can
|
|
|
|
|
* redistribute it and/or modify it under the terms of the GNU
|
|
|
|
|
* General Public License (GNU GPL) as published by the Free Software
|
|
|
|
|
* Foundation, either version 3 of the License, or (at your option)
|
|
|
|
|
* any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
|
*
|
|
|
|
|
* As additional permission under GNU GPL version 3 section 7, you
|
|
|
|
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
|
|
|
|
* that code without the copy of the GNU GPL normally required by
|
|
|
|
|
* section 4, provided you include this license notice and a URL
|
|
|
|
|
* through which recipients can access the Corresponding Source.
|
|
|
|
|
*
|
|
|
|
|
* @licend The above is the entire license notice
|
|
|
|
|
* for the JavaScript code in %SCRIPT_PATH.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type=\"text/javascript\">
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@licstart The following is the entire license notice for the
|
|
|
|
|
JavaScript code in this tag.
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
The JavaScript code in this tag is free software: you can
|
|
|
|
|
redistribute it and/or modify it under the terms of the GNU
|
|
|
|
|
General Public License (GNU GPL) as published by the Free Software
|
|
|
|
|
Foundation, either version 3 of the License, or (at your option)
|
|
|
|
|
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
|
|
|
|
|
|
As additional permission under GNU GPL version 3 section 7, you
|
|
|
|
|
may distribute non-source (e.g., minimized or compacted) forms of
|
|
|
|
|
that code without the copy of the GNU GPL normally required by
|
|
|
|
|
section 4, provided you include this license notice and a URL
|
|
|
|
|
through which recipients can access the Corresponding Source.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@licend The above is the entire license notice
|
|
|
|
|
for the JavaScript code in this tag.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
|
|
|
%MANAGER_OPTIONS
|
|
|
|
|
org_html_manager.setup(); // activate after the parameters are set
|
|
|
|
|
/*]]>*///-->
|
|
|
|
|
</script>"
|
|
|
|
|
"The template for the export style additions when org-info.js is used.
|
|
|
|
|
Option settings will replace the %MANAGER-OPTIONS cookie."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
(defun org-html-infojs-install-script (exp-plist backend)
|
|
|
|
|
"Install script in export options when appropriate.
|
|
|
|
|
EXP-PLIST is a plist containing export options. BACKEND is the
|
|
|
|
|
export back-end currently used."
|
2013-03-01 17:14:30 -05:00
|
|
|
|
(unless (or (not org-html-use-infojs)
|
2013-03-01 08:26:55 -05:00
|
|
|
|
(and (eq org-html-use-infojs 'when-configured)
|
|
|
|
|
(or (not (plist-get exp-plist :infojs-opt))
|
|
|
|
|
(string-match "\\<view:nil\\>"
|
|
|
|
|
(plist-get exp-plist :infojs-opt)))))
|
|
|
|
|
(let* ((template org-html-infojs-template)
|
|
|
|
|
(ptoc (plist-get exp-plist :with-toc))
|
|
|
|
|
(hlevels (plist-get exp-plist :headline-levels))
|
|
|
|
|
(sdepth hlevels)
|
|
|
|
|
(tdepth (if (integerp ptoc) (min ptoc hlevels) hlevels))
|
|
|
|
|
(options (plist-get exp-plist :infojs-opt))
|
|
|
|
|
(table org-html-infojs-opts-table)
|
|
|
|
|
style)
|
|
|
|
|
(dolist (entry table)
|
|
|
|
|
(let* ((opt (car entry))
|
|
|
|
|
(var (nth 1 entry))
|
|
|
|
|
;; Compute default values for script option OPT from
|
|
|
|
|
;; `org-html-infojs-options' variable.
|
|
|
|
|
(default
|
|
|
|
|
(let ((default (cdr (assq opt org-html-infojs-options))))
|
|
|
|
|
(if (and (symbolp default) (not (memq default '(t nil))))
|
|
|
|
|
(plist-get exp-plist default)
|
|
|
|
|
default)))
|
|
|
|
|
;; Value set through INFOJS_OPT keyword has precedence
|
|
|
|
|
;; over the default one.
|
|
|
|
|
(val (if (and options
|
|
|
|
|
(string-match (format "\\<%s:\\(\\S-+\\)" opt)
|
|
|
|
|
options))
|
|
|
|
|
(match-string 1 options)
|
|
|
|
|
default)))
|
|
|
|
|
(case opt
|
|
|
|
|
(path (setq template
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"%SCRIPT_PATH" val template t t)))
|
|
|
|
|
(sdepth (when (integerp (read val))
|
|
|
|
|
(setq sdepth (min (read val) sdepth))))
|
|
|
|
|
(tdepth (when (integerp (read val))
|
|
|
|
|
(setq tdepth (min (read val) tdepth))))
|
|
|
|
|
(otherwise (setq val
|
|
|
|
|
(cond
|
|
|
|
|
((or (eq val t) (equal val "t")) "1")
|
|
|
|
|
((or (eq val nil) (equal val "nil")) "0")
|
|
|
|
|
((stringp val) val)
|
|
|
|
|
(t (format "%s" val))))
|
|
|
|
|
(push (cons var val) style)))))
|
|
|
|
|
;; Now we set the depth of the *generated* TOC to SDEPTH,
|
|
|
|
|
;; because the toc will actually determine the splitting. How
|
|
|
|
|
;; much of the toc will actually be displayed is governed by the
|
|
|
|
|
;; TDEPTH option.
|
|
|
|
|
(setq exp-plist (plist-put exp-plist :with-toc sdepth))
|
|
|
|
|
;; The table of contents should not show more sections than we
|
|
|
|
|
;; generate.
|
|
|
|
|
(setq tdepth (min tdepth sdepth))
|
|
|
|
|
(push (cons "TOC_DEPTH" tdepth) style)
|
|
|
|
|
;; Build style string.
|
|
|
|
|
(setq style (mapconcat
|
|
|
|
|
(lambda (x) (format "org_html_manager.set(\"%s\", \"%s\");"
|
|
|
|
|
(car x)
|
|
|
|
|
(cdr x)))
|
|
|
|
|
style "\n"))
|
|
|
|
|
(when (and style (> (length style) 0))
|
|
|
|
|
(and (string-match "%MANAGER_OPTIONS" template)
|
|
|
|
|
(setq style (replace-match style t t template))
|
|
|
|
|
(setq exp-plist
|
|
|
|
|
(plist-put
|
2013-03-02 12:05:16 -05:00
|
|
|
|
exp-plist :html-head-extra
|
|
|
|
|
(concat (or (plist-get exp-plist :html-head-extra) "")
|
2013-03-01 08:26:55 -05:00
|
|
|
|
"\n"
|
|
|
|
|
style)))))
|
|
|
|
|
;; This script absolutely needs the table of contents, so we
|
|
|
|
|
;; change that setting.
|
|
|
|
|
(unless (plist-get exp-plist :with-toc)
|
|
|
|
|
(setq exp-plist (plist-put exp-plist :with-toc t)))
|
|
|
|
|
;; Return the modified property list.
|
|
|
|
|
exp-plist)))
|
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Bold etc
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-text-markup-alist
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'((bold . "<b>%s</b>")
|
|
|
|
|
(code . "<code>%s</code>")
|
|
|
|
|
(italic . "<i>%s</i>")
|
|
|
|
|
(strike-through . "<del>%s</del>")
|
|
|
|
|
(underline . "<span style=\"text-decoration:underline;\">%s</span>")
|
|
|
|
|
(verbatim . "<code>%s</code>"))
|
|
|
|
|
"Alist of HTML expressions to convert text markup
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
The key must be a symbol among `bold', `code', `italic',
|
|
|
|
|
`strike-through', `underline' and `verbatim'. The value is
|
|
|
|
|
a formatting string to wrap fontified text with.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
If no association can be found for a given markup, text will be
|
|
|
|
|
returned as-is."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(alist :key-type (symbol :tag "Markup type")
|
|
|
|
|
:value-type (string :tag "Format string"))
|
|
|
|
|
:options '(bold code italic strike-through underline verbatim))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Debugging
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-pretty-output nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Enable this to generate pretty HTML."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Drawers
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-format-drawer-function nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Function called to format a drawer in HTML code.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
The function must accept two parameters:
|
|
|
|
|
NAME the drawer name, like \"LOGBOOK\"
|
|
|
|
|
CONTENTS the contents of the drawer.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
The function should return the string to be exported.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
For example, the variable could be set to the following function
|
|
|
|
|
in order to mimic default behaviour:
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
\(defun org-html-format-drawer-default \(name contents\)
|
2012-07-24 14:48:41 -04:00
|
|
|
|
\"Format a drawer element for HTML export.\"
|
|
|
|
|
contents\)"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'function)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Footnotes
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-footnotes-section "<div id=\"footnotes\">
|
2012-07-24 14:48:41 -04:00
|
|
|
|
<h2 class=\"footnotes\">%s: </h2>
|
|
|
|
|
<div id=\"text-footnotes\">
|
|
|
|
|
%s
|
|
|
|
|
</div>
|
|
|
|
|
</div>"
|
|
|
|
|
"Format for the footnotes section.
|
|
|
|
|
Should contain a two instances of %s. The first will be replaced with the
|
|
|
|
|
language-specific word for \"Footnotes\", the second one will be replaced
|
|
|
|
|
by the footnotes themselves."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-footnote-format "<sup>%s</sup>"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"The format for the footnote reference.
|
|
|
|
|
%s will be replaced by the footnote reference itself."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-05-27 07:23:58 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-footnote-separator "<sup>, </sup>"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Text used to separate footnotes."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-05-27 07:23:58 -04:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
|
|
|
|
;;;; Headline
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-toplevel-hlevel 2
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"The <H> level for level 1 headings in HTML export.
|
|
|
|
|
This is also important for the classes that will be wrapped around headlines
|
|
|
|
|
and outline structure. If this variable is 1, the top-level headlines will
|
|
|
|
|
be <h1>, and the corresponding classes will be outline-1, section-number-1,
|
|
|
|
|
and outline-text-1. If this is 2, all of these will get a 2 instead.
|
|
|
|
|
The default for this variable is 2, because we use <h1> for formatting the
|
|
|
|
|
document title."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-09-25 16:17:54 -04:00
|
|
|
|
:type 'integer)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-format-headline-function nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Function to format headline text.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
This function will be called with 5 arguments:
|
|
|
|
|
TODO the todo keyword (string or nil).
|
|
|
|
|
TODO-TYPE the type of todo (symbol: `todo', `done', nil)
|
|
|
|
|
PRIORITY the priority of the headline (integer or nil)
|
|
|
|
|
TEXT the main headline text (string).
|
|
|
|
|
TAGS the tags (string or nil).
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-24 04:01:39 -05:00
|
|
|
|
The function result will be used in the section format string."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'function)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; HTML-specific
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-allow-name-attribute-in-anchors t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"When nil, do not set \"name\" attribute in anchors.
|
|
|
|
|
By default, anchors are formatted with both \"id\" and \"name\"
|
|
|
|
|
attributes, when appropriate."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Inlinetasks
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-format-inlinetask-function nil
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Function called to format an inlinetask in HTML code.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
The function must accept six parameters:
|
|
|
|
|
TODO the todo keyword, as a string
|
|
|
|
|
TODO-TYPE the todo type, a symbol among `todo', `done' and nil.
|
|
|
|
|
PRIORITY the inlinetask priority, as a string
|
|
|
|
|
NAME the inlinetask name, as a string.
|
|
|
|
|
TAGS the inlinetask tags, as a list of strings.
|
|
|
|
|
CONTENTS the contents of the inlinetask, as a string.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-03-01 07:57:54 -05:00
|
|
|
|
The function should return the string to be exported."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'function)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;;;; LaTeX
|
|
|
|
|
|
|
|
|
|
(defcustom org-html-with-latex org-export-with-latex
|
|
|
|
|
"Non-nil means process LaTeX math snippets.
|
|
|
|
|
|
|
|
|
|
When set, the exporter will process LaTeX environments and
|
|
|
|
|
fragments.
|
|
|
|
|
|
|
|
|
|
This option can also be set with the +OPTIONS line,
|
|
|
|
|
e.g. \"tex:mathjax\". Allowed values are:
|
|
|
|
|
|
|
|
|
|
nil Ignore math snippets.
|
|
|
|
|
`verbatim' Keep everything in verbatim
|
|
|
|
|
`dvipng' Process the LaTeX fragments to images. This will also
|
|
|
|
|
include processing of non-math environments.
|
|
|
|
|
`imagemagick' Convert the LaTeX fragments to pdf files and use
|
|
|
|
|
imagemagick to convert pdf files to png files.
|
|
|
|
|
`mathjax' Do MathJax preprocessing and arrange for MathJax.js to
|
|
|
|
|
be loaded.
|
|
|
|
|
t Synonym for `mathjax'."
|
|
|
|
|
:group 'org-export-html
|
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Do not process math in any way" nil)
|
|
|
|
|
(const :tag "Use dvipng to make images" dvipng)
|
|
|
|
|
(const :tag "Use imagemagick to make images" imagemagick)
|
|
|
|
|
(const :tag "Use MathJax to display math" mathjax)
|
|
|
|
|
(const :tag "Leave math verbatim" verbatim)))
|
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Links :: Generic
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-link-org-files-as-html t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means make file links to `file.org' point to `file.html'.
|
|
|
|
|
When org-mode is exporting an org-mode file to HTML, links to
|
|
|
|
|
non-html files are directly put into a href tag in HTML.
|
|
|
|
|
However, links to other Org-mode files (recognized by the
|
|
|
|
|
extension `.org.) should become links to the corresponding html
|
|
|
|
|
file, assuming that the linked org-mode file will also be
|
|
|
|
|
converted to HTML.
|
|
|
|
|
When nil, the links still point to the plain `.org' file."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Links :: Inline images
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-inline-images 'maybe
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Non-nil means inline images into exported HTML pages.
|
|
|
|
|
This is done using an <img> tag. When nil, an anchor with href is used to
|
|
|
|
|
link to the image. If this option is `maybe', then images in links with
|
|
|
|
|
an empty description will be inlined, while images with a description will
|
|
|
|
|
be linked only."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type '(choice (const :tag "Never" nil)
|
|
|
|
|
(const :tag "Always" t)
|
|
|
|
|
(const :tag "When there is no description" maybe)))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-inline-image-rules
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'(("file" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'")
|
|
|
|
|
("http" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'")
|
|
|
|
|
("https" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'"))
|
|
|
|
|
"Rules characterizing image files that can be inlined into HTML.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
A rule consists in an association whose key is the type of link
|
|
|
|
|
to consider, and value is a regexp that will be matched against
|
|
|
|
|
link's path.
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
Note that, by default, the image extension *actually* allowed
|
|
|
|
|
depend on the way the HTML file is processed. When used with
|
|
|
|
|
pdflatex, pdf, jpg and png images are OK. When processing
|
|
|
|
|
through dvi to Postscript, only ps and eps are allowed. The
|
|
|
|
|
default we use here encompasses both."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(alist :key-type (string :tag "Type")
|
|
|
|
|
:value-type (regexp :tag "Path")))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
|
|
|
|
;;;; Plain Text
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-protect-char-alist
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'(("&" . "&")
|
|
|
|
|
("<" . "<")
|
|
|
|
|
(">" . ">"))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
"Alist of characters to be converted by `org-html-protect'."
|
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(repeat (cons (string :tag "Character")
|
|
|
|
|
(string :tag "HTML equivalent"))))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Src Block
|
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defcustom org-html-htmlize-output-type 'inline-css
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Output type to be used by htmlize when formatting code snippets.
|
|
|
|
|
Choices are `css', to export the CSS selectors only, or `inline-css', to
|
|
|
|
|
export the CSS attribute values inline in the HTML. We use as default
|
|
|
|
|
`inline-css', in order to make the resulting HTML self-containing.
|
|
|
|
|
|
|
|
|
|
However, this will fail when using Emacs in batch mode for export, because
|
|
|
|
|
then no rich font definitions are in place. It will also not be good if
|
|
|
|
|
people with different Emacs setup contribute HTML files to a website,
|
|
|
|
|
because the fonts will represent the individual setups. In these cases,
|
|
|
|
|
it is much better to let Org/Htmlize assign classes only, and to use
|
|
|
|
|
a style file to define the look of these classes.
|
|
|
|
|
To get a start for your css file, start Emacs session and make sure that
|
|
|
|
|
all the faces you are interested in are defined, for example by loading files
|
|
|
|
|
in all modes you want. Then, use the command
|
2013-02-19 13:03:59 -05:00
|
|
|
|
\\[org-html-htmlize-generate-css] to extract class definitions."
|
|
|
|
|
:group 'org-export-html
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type '(choice (const css) (const inline-css)))
|
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defcustom org-html-htmlize-font-prefix "org-"
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"The prefix for CSS class names for htmlize font specifications."
|
2013-02-19 13:03:59 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
;;;; Table
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-tag
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">"
|
|
|
|
|
"The HTML tag that is used to start a table.
|
|
|
|
|
This must be a <table> tag, but you may change the options like
|
|
|
|
|
borders and spacing."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-header-tags '("<th scope=\"%s\"%s>" . "</th>")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"The opening tag for table header fields.
|
|
|
|
|
This is customizable so that alignment options can be specified.
|
|
|
|
|
The first %s will be filled with the scope of the field, either row or col.
|
|
|
|
|
The second %s will be replaced by a style entry to align the field.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
See also the variable `org-html-table-use-header-tags-for-first-column'.
|
|
|
|
|
See also the variable `org-html-table-align-individual-fields'."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-data-tags '("<td%s>" . "</td>")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"The opening tag for table data fields.
|
|
|
|
|
This is customizable so that alignment options can be specified.
|
|
|
|
|
The first %s will be filled with the scope of the field, either row or col.
|
|
|
|
|
The second %s will be replaced by a style entry to align the field.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
See also the variable `org-html-table-align-individual-fields'."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-row-tags '("<tr>" . "</tr>")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"The opening tag for table data fields.
|
|
|
|
|
This is customizable so that alignment options can be specified.
|
|
|
|
|
Instead of strings, these can be Lisp forms that will be evaluated
|
|
|
|
|
for each row in order to construct the table row tags. During evaluation,
|
|
|
|
|
the variable `head' will be true when this is a header line, nil when this
|
|
|
|
|
is a body line. And the variable `nline' will contain the line number,
|
|
|
|
|
starting from 1 in the first header line. For example
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(setq org-html-table-row-tags
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cons '(if head
|
|
|
|
|
\"<tr>\"
|
|
|
|
|
(if (= (mod nline 2) 1)
|
|
|
|
|
\"<tr class=\\\"tr-odd\\\">\"
|
|
|
|
|
\"<tr class=\\\"tr-even\\\">\"))
|
|
|
|
|
\"</tr>\"))
|
|
|
|
|
|
|
|
|
|
will give even lines the class \"tr-even\" and odd lines the class \"tr-odd\"."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type '(cons
|
|
|
|
|
(choice :tag "Opening tag"
|
|
|
|
|
(string :tag "Specify")
|
|
|
|
|
(sexp))
|
|
|
|
|
(choice :tag "Closing tag"
|
|
|
|
|
(string :tag "Specify")
|
|
|
|
|
(sexp))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-align-individual-fields t
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Non-nil means attach style attributes for alignment to each table field.
|
|
|
|
|
When nil, alignment will only be specified in the column tags, but this
|
|
|
|
|
is ignored by some browsers (like Firefox, Safari). Opera does it right
|
|
|
|
|
though."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-use-header-tags-for-first-column nil
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Non-nil means format column one in tables with header tags.
|
|
|
|
|
When nil, also column one will use data tags."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-table-caption-above t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"When non-nil, place caption string at the beginning of the table.
|
|
|
|
|
Otherwise, place it near the end."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Tags
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-tag-class-prefix ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Prefix to class names for TODO keywords.
|
|
|
|
|
Each tag gets a class given by the tag itself, with this prefix.
|
|
|
|
|
The default prefix is empty because it is nice to just use the keyword
|
|
|
|
|
as a class name. But if you get into conflicts with other, existing
|
|
|
|
|
CSS classes, then this prefix can be very useful."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-18 01:52:31 -05:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Generic
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-extension "html"
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"The extension for exported HTML files."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-xml-declaration
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'(("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>")
|
|
|
|
|
("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>"))
|
|
|
|
|
"The extension for exported HTML files.
|
|
|
|
|
%s will be replaced with the charset of the exported file.
|
|
|
|
|
This may be a string, or an alist with export extensions
|
|
|
|
|
and corresponding declarations."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(choice
|
|
|
|
|
(string :tag "Single declaration")
|
|
|
|
|
(repeat :tag "Dependent on extension"
|
|
|
|
|
(cons (string :tag "Extension")
|
|
|
|
|
(string :tag "Declaration")))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-coding-system 'utf-8
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Coding system for HTML export.
|
2012-08-25 15:20:17 -04:00
|
|
|
|
Use utf-8 as the default value."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'coding-system)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-divs '("preamble" "content" "postamble")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"The name of the main divs for HTML export.
|
|
|
|
|
This is a list of three strings, the first one for the preamble
|
|
|
|
|
DIV, the second one for the content DIV and the third one for the
|
|
|
|
|
postamble DIV."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(list
|
|
|
|
|
(string :tag " Div for the preamble:")
|
|
|
|
|
(string :tag " Div for the content:")
|
|
|
|
|
(string :tag "Div for the postamble:")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Mathjax
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-mathjax-options
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'((path "http://orgmode.org/mathjax/MathJax.js")
|
|
|
|
|
(scale "100")
|
|
|
|
|
(align "center")
|
|
|
|
|
(indent "2em")
|
|
|
|
|
(mathml nil))
|
|
|
|
|
"Options for MathJax setup.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
path The path where to find MathJax
|
|
|
|
|
scale Scaling for the HTML-CSS backend, usually between 100 and 133
|
|
|
|
|
align How to align display math: left, center, or right
|
|
|
|
|
indent If align is not center, how far from the left/right side?
|
|
|
|
|
mathml Should a MathML player be used if available?
|
|
|
|
|
This is faster and reduces bandwidth use, but currently
|
|
|
|
|
sometimes has lower spacing quality. Therefore, the default is
|
|
|
|
|
nil. When browsers get better, this switch can be flipped.
|
|
|
|
|
|
|
|
|
|
You can also customize this for each buffer, using something like
|
|
|
|
|
|
|
|
|
|
#+MATHJAX: scale:\"133\" align:\"right\" mathml:t path:\"/MathJax/\""
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(list :greedy t
|
|
|
|
|
(list :tag "path (the path from where to load MathJax.js)"
|
|
|
|
|
(const :format " " path) (string))
|
|
|
|
|
(list :tag "scale (scaling for the displayed math)"
|
|
|
|
|
(const :format " " scale) (string))
|
|
|
|
|
(list :tag "align (alignment of displayed equations)"
|
|
|
|
|
(const :format " " align) (string))
|
|
|
|
|
(list :tag "indent (indentation with left or right alignment)"
|
|
|
|
|
(const :format " " indent) (string))
|
|
|
|
|
(list :tag "mathml (should MathML display be used is possible)"
|
|
|
|
|
(const :format " " mathml) (boolean))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-mathjax-template
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"<script type=\"text/javascript\" src=\"%PATH\">
|
|
|
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
|
|
|
MathJax.Hub.Config({
|
|
|
|
|
// Only one of the two following lines, depending on user settings
|
|
|
|
|
// First allows browser-native MathML display, second forces HTML/CSS
|
|
|
|
|
:MMLYES: config: [\"MMLorHTML.js\"], jax: [\"input/TeX\"],
|
|
|
|
|
:MMLNO: jax: [\"input/TeX\", \"output/HTML-CSS\"],
|
|
|
|
|
extensions: [\"tex2jax.js\",\"TeX/AMSmath.js\",\"TeX/AMSsymbols.js\",
|
|
|
|
|
\"TeX/noUndefined.js\"],
|
|
|
|
|
tex2jax: {
|
|
|
|
|
inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],
|
|
|
|
|
displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"], [\"\\\\begin{displaymath}\",\"\\\\end{displaymath}\"] ],
|
|
|
|
|
skipTags: [\"script\",\"noscript\",\"style\",\"textarea\",\"pre\",\"code\"],
|
|
|
|
|
ignoreClass: \"tex2jax_ignore\",
|
|
|
|
|
processEscapes: false,
|
|
|
|
|
processEnvironments: true,
|
|
|
|
|
preview: \"TeX\"
|
|
|
|
|
},
|
|
|
|
|
showProcessingMessages: true,
|
|
|
|
|
displayAlign: \"%ALIGN\",
|
|
|
|
|
displayIndent: \"%INDENT\",
|
|
|
|
|
|
|
|
|
|
\"HTML-CSS\": {
|
|
|
|
|
scale: %SCALE,
|
|
|
|
|
availableFonts: [\"STIX\",\"TeX\"],
|
|
|
|
|
preferredFont: \"TeX\",
|
|
|
|
|
webFont: \"TeX\",
|
|
|
|
|
imageFont: \"TeX\",
|
|
|
|
|
showMathMenu: true,
|
|
|
|
|
},
|
|
|
|
|
MMLorHTML: {
|
|
|
|
|
prefer: {
|
|
|
|
|
MSIE: \"MML\",
|
|
|
|
|
Firefox: \"MML\",
|
|
|
|
|
Opera: \"HTML\",
|
|
|
|
|
other: \"HTML\"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
/*]]>*///-->
|
|
|
|
|
</script>"
|
|
|
|
|
"The MathJax setup for XHTML files."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Template :: Postamble
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-postamble 'auto
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means insert a postamble in HTML export.
|
|
|
|
|
|
|
|
|
|
When `t', insert a string as defined by the formatting string in
|
2013-01-27 17:11:34 -05:00
|
|
|
|
`org-html-postamble-format'. When set to a string, this
|
|
|
|
|
string overrides `org-html-postamble-format'. When set to
|
|
|
|
|
'auto, discard `org-html-postamble-format' and honor
|
2012-07-24 14:48:41 -04:00
|
|
|
|
`org-export-author/email/creator-info' variables. When set to a
|
|
|
|
|
function, apply this function and insert the returned string.
|
|
|
|
|
The function takes the property list of export options as its
|
|
|
|
|
only argument.
|
|
|
|
|
|
|
|
|
|
Setting :html-postamble in publishing projects will take
|
|
|
|
|
precedence over this variable."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(choice (const :tag "No postamble" nil)
|
|
|
|
|
(const :tag "Auto preamble" 'auto)
|
|
|
|
|
(const :tag "Default formatting string" t)
|
|
|
|
|
(string :tag "Custom formatting string")
|
|
|
|
|
(function :tag "Function (must return a string)")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-postamble-format
|
2012-07-24 14:48:41 -04:00
|
|
|
|
'(("en" "<p class=\"author\">Author: %a (%e)</p>
|
|
|
|
|
<p class=\"date\">Date: %d</p>
|
|
|
|
|
<p class=\"creator\">Generated by %c</p>
|
2012-09-25 16:17:54 -04:00
|
|
|
|
<p class=\"xhtml-validation\">%v</p>"))
|
|
|
|
|
"Alist of languages and format strings for the HTML postamble.
|
2012-07-24 14:48:41 -04:00
|
|
|
|
|
2012-09-25 16:17:54 -04:00
|
|
|
|
The first element of each list is the language code, as used for
|
|
|
|
|
the #+LANGUAGE keyword.
|
|
|
|
|
|
|
|
|
|
The second element of each list is a format string to format the
|
|
|
|
|
postamble itself. This format string can contain these elements:
|
|
|
|
|
|
|
|
|
|
%a stands for the author's name.
|
|
|
|
|
%e stands for the author's email.
|
|
|
|
|
%d stands for the date.
|
|
|
|
|
%c will be replaced by information about Org/Emacs versions.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
%v will be replaced by `org-html-validation-link'.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
If you need to use a \"%\" character, you need to escape it
|
|
|
|
|
like that: \"%%\"."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-09-25 16:17:54 -04:00
|
|
|
|
:type '(alist :key-type (string :tag "Language")
|
|
|
|
|
:value-type (string :tag "Format string")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-validation-link
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"<a href=\"http://validator.w3.org/check?uri=referer\">Validate XHTML 1.0</a>"
|
|
|
|
|
"Link to HTML validation service."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-creator-string
|
2012-07-06 03:09:31 -04:00
|
|
|
|
(format "Generated by <a href=\"http://orgmode.org\">Org</a> mode %s in <a href=\"http://www.gnu.org/software/emacs/\">Emacs</a> %s."
|
|
|
|
|
(if (fboundp 'org-version) (org-version) "(Unknown)")
|
|
|
|
|
emacs-version)
|
|
|
|
|
"String to insert at the end of the HTML document."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-06 03:09:31 -04:00
|
|
|
|
:type '(string :tag "Creator string"))
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Preamble
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-preamble t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means insert a preamble in HTML export.
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
When `t', insert a string as defined by one of the formatting
|
2013-01-27 17:11:34 -05:00
|
|
|
|
strings in `org-html-preamble-format'. When set to a
|
|
|
|
|
string, this string overrides `org-html-preamble-format'.
|
2012-07-24 14:48:41 -04:00
|
|
|
|
When set to a function, apply this function and insert the
|
|
|
|
|
returned string. The function takes the property list of export
|
|
|
|
|
options as its only argument.
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
Setting :html-preamble in publishing projects will take
|
|
|
|
|
precedence over this variable."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(choice (const :tag "No preamble" nil)
|
|
|
|
|
(const :tag "Default preamble" t)
|
|
|
|
|
(string :tag "Custom formatting string")
|
|
|
|
|
(function :tag "Function (must return a string)")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-preamble-format '(("en" ""))
|
2012-09-25 16:17:54 -04:00
|
|
|
|
"Alist of languages and format strings for the HTML preamble.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-09-25 16:17:54 -04:00
|
|
|
|
The first element of each list is the language code, as used for
|
|
|
|
|
the #+LANGUAGE keyword.
|
|
|
|
|
|
|
|
|
|
The second element of each list is a format string to format the
|
|
|
|
|
preamble itself. This format string can contain these elements:
|
|
|
|
|
|
|
|
|
|
%t stands for the title.
|
|
|
|
|
%a stands for the author's name.
|
|
|
|
|
%e stands for the author's email.
|
|
|
|
|
%d stands for the date.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
If you need to use a \"%\" character, you need to escape it
|
|
|
|
|
like that: \"%%\"."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-09-25 16:17:54 -04:00
|
|
|
|
:type '(alist :key-type (string :tag "Language")
|
|
|
|
|
:value-type (string :tag "Format string")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-link-up ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Where should the \"UP\" link of exported HTML pages lead?"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(string :tag "File or URL"))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-link-home ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Where should the \"HOME\" link of exported HTML pages lead?"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type '(string :tag "File or URL"))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-home/up-format
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"<div id=\"org-div-home-and-up\" style=\"text-align:right;font-size:70%%;white-space:nowrap;\">
|
|
|
|
|
<a accesskey=\"h\" href=\"%s\"> UP </a>
|
|
|
|
|
|
|
|
|
|
|
<a accesskey=\"H\" href=\"%s\"> HOME </a>
|
|
|
|
|
</div>"
|
|
|
|
|
"Snippet used to insert the HOME and UP links.
|
|
|
|
|
This is a format string, the first %s will receive the UP link,
|
2013-01-27 17:11:34 -05:00
|
|
|
|
the second the HOME link. If both `org-html-link-up' and
|
|
|
|
|
`org-html-link-home' are empty, the entire snippet will be
|
2012-07-24 14:48:41 -04:00
|
|
|
|
ignored."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Scripts
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(define-obsolete-variable-alias
|
|
|
|
|
'org-html-style-include-scripts 'org-html-head-include-scripts "24.4")
|
|
|
|
|
(defcustom org-html-head-include-scripts t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means include the JavaScript snippets in exported HTML files.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
The actual script is defined in `org-html-scripts' and should
|
2012-07-24 14:48:41 -04:00
|
|
|
|
not be modified."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-03-02 12:05:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-02-20 11:28:44 -05:00
|
|
|
|
:type 'boolean)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Template :: Styles
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(define-obsolete-variable-alias
|
|
|
|
|
'org-html-style-include-default 'org-html-head-include-default-style "24.4")
|
|
|
|
|
(defcustom org-html-head-include-default-style t
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Non-nil means include the default style in exported HTML files.
|
2013-03-02 12:05:16 -05:00
|
|
|
|
The actual style is defined in `org-html-style-default' and
|
|
|
|
|
should not be modified. Use `org-html-head' to add your own
|
|
|
|
|
style information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-03-02 12:05:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
;;;###autoload
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(put 'org-html-head-include-default-style 'safe-local-variable 'booleanp)
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(define-obsolete-variable-alias 'org-html-style 'org-html-head "24.4")
|
|
|
|
|
(defcustom org-html-head ""
|
|
|
|
|
"Org-wide head definitions for exported HTML files.
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
This variable can contain the full HTML structure to provide a
|
|
|
|
|
style, including the surrounding HTML tags. You can consider
|
|
|
|
|
including definitions for the following classes: title, todo,
|
|
|
|
|
done, timestamp, timestamp-kwd, tag, target.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
For example, a valid value would be:
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
<style type=\"text/css\">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
p { font-weight: normal; color: gray; }
|
|
|
|
|
h1 { color: black; }
|
|
|
|
|
.title { text-align: center; }
|
|
|
|
|
.todo, .timestamp-kwd { color: red; }
|
|
|
|
|
.done { color: green; }
|
|
|
|
|
]]>
|
|
|
|
|
</style>
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
If you want to refer to an external style, use something like
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\" />
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-03-02 12:05:16 -05:00
|
|
|
|
As the value of this option simply gets inserted into the HTML
|
|
|
|
|
<head> header, you can use it to add any arbitrary text to the
|
|
|
|
|
header."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2013-03-02 12:05:16 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
|
|
|
|
;;;###autoload
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(put 'org-html-head 'safe-local-variable 'stringp)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;;; Todos
|
2012-04-22 01:09:19 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defcustom org-html-todo-kwd-class-prefix ""
|
2012-07-24 14:48:41 -04:00
|
|
|
|
"Prefix to class names for TODO keywords.
|
|
|
|
|
Each TODO keyword gets a class given by the keyword itself, with this prefix.
|
|
|
|
|
The default prefix is empty because it is nice to just use the keyword
|
|
|
|
|
as a class name. But if you get into conflicts with other, existing
|
|
|
|
|
CSS classes, then this prefix can be very useful."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
:group 'org-export-html
|
2012-07-24 14:48:41 -04:00
|
|
|
|
:type 'string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-12 16:21:20 -05:00
|
|
|
|
(defcustom org-html-display-buffer-mode 'html-mode
|
|
|
|
|
"Default mode when visiting the HTML output."
|
|
|
|
|
:group 'org-export-html
|
2013-02-26 12:21:28 -05:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2013-02-12 16:21:20 -05:00
|
|
|
|
:type '(choice (function 'html-mode)
|
|
|
|
|
(function 'nxml-mode)
|
|
|
|
|
(function :tag "Other mode")))
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;; Internal Functions
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-inline-image (src &optional
|
2012-03-06 12:57:33 -05:00
|
|
|
|
caption label attr standalone-p)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(let* ((id (if (not label) ""
|
|
|
|
|
(format " id=\"%s\"" (org-export-solidify-link-text label))))
|
|
|
|
|
(attr (concat attr
|
|
|
|
|
(cond
|
|
|
|
|
((string-match "\\<alt=" (or attr "")) "")
|
|
|
|
|
((string-match "^ltxpng/" src)
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(format " alt=\"%s\""
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-encode-plain-text
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(org-find-text-property-in-string
|
|
|
|
|
'org-latex-src src))))
|
|
|
|
|
(t (format " alt=\"%s\""
|
|
|
|
|
(file-name-nondirectory src)))))))
|
|
|
|
|
(cond
|
|
|
|
|
(standalone-p
|
|
|
|
|
(let ((img (format "<img src=\"%s\" %s/>" src attr)))
|
|
|
|
|
(format "\n<div%s class=\"figure\">%s%s\n</div>"
|
|
|
|
|
id (format "\n<p>%s</p>" img)
|
|
|
|
|
(when caption (format "\n<p>%s</p>" caption)))))
|
|
|
|
|
(t (format "<img src=\"%s\" %s/>" src (concat attr id))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--textarea-block (element)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
"Transcode ELEMENT into a textarea block.
|
|
|
|
|
ELEMENT is either a src block or an example block."
|
|
|
|
|
(let ((code (car (org-export-unravel-code element)))
|
|
|
|
|
(attr (org-export-read-attribute :attr_html element)))
|
|
|
|
|
(format "<p>\n<textarea cols=\"%d\" rows=\"%d\">\n%s</textarea>\n</p>"
|
|
|
|
|
(or (plist-get attr :width) 80)
|
|
|
|
|
(or (plist-get attr :height) (org-count-lines code))
|
|
|
|
|
code)))
|
|
|
|
|
|
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;;; Bibliography
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-bibliography ()
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Find bibliography, cut it out and return it."
|
|
|
|
|
(catch 'exit
|
|
|
|
|
(let (beg end (cnt 1) bib)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(when (re-search-forward
|
|
|
|
|
"^[ \t]*<div \\(id\\|class\\)=\"bibliography\"" nil t)
|
|
|
|
|
(setq beg (match-beginning 0))
|
|
|
|
|
(while (re-search-forward "</?div\\>" nil t)
|
|
|
|
|
(setq cnt (+ cnt (if (string= (match-string 0) "<div") +1 -1)))
|
|
|
|
|
(when (= cnt 0)
|
|
|
|
|
(and (looking-at ">") (forward-char 1))
|
|
|
|
|
(setq bib (buffer-substring beg (point)))
|
|
|
|
|
(delete-region beg (point))
|
|
|
|
|
(throw 'exit bib))))
|
|
|
|
|
nil))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;;; Table
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-splice-attributes (tag attributes)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Read attributes in string ATTRIBUTES, add and replace in HTML tag TAG."
|
|
|
|
|
(if (not attributes)
|
|
|
|
|
tag
|
|
|
|
|
(let (oldatt newatt)
|
|
|
|
|
(setq oldatt (org-extract-attributes-from-string tag)
|
|
|
|
|
tag (pop oldatt)
|
|
|
|
|
newatt (cdr (org-extract-attributes-from-string attributes)))
|
|
|
|
|
(while newatt
|
|
|
|
|
(setq oldatt (plist-put oldatt (pop newatt) (pop newatt))))
|
|
|
|
|
(if (string-match ">" tag)
|
|
|
|
|
(setq tag
|
|
|
|
|
(replace-match (concat (org-attributes-to-string oldatt) ">")
|
|
|
|
|
t t tag)))
|
|
|
|
|
tag)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(defun org-export-splice-style (style extra)
|
|
|
|
|
"Splice EXTRA into STYLE, just before \"</style>\"."
|
|
|
|
|
(if (and (stringp extra)
|
|
|
|
|
(string-match "\\S-" extra)
|
|
|
|
|
(string-match "</style>" style))
|
|
|
|
|
(concat (substring style 0 (match-beginning 0))
|
|
|
|
|
"\n" extra "\n"
|
|
|
|
|
(substring style (match-beginning 0)))
|
|
|
|
|
style))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defun org-html-htmlize-region-for-paste (beg end)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Convert the region to HTML, using htmlize.el.
|
|
|
|
|
This is much like `htmlize-region-for-paste', only that it uses
|
|
|
|
|
the settings define in the org-... variables."
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(let* ((htmlize-output-type org-html-htmlize-output-type)
|
|
|
|
|
(htmlize-css-name-prefix org-html-htmlize-font-prefix)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(htmlbuf (htmlize-region beg end)))
|
|
|
|
|
(unwind-protect
|
|
|
|
|
(with-current-buffer htmlbuf
|
|
|
|
|
(buffer-substring (plist-get htmlize-buffer-places 'content-start)
|
|
|
|
|
(plist-get htmlize-buffer-places 'content-end)))
|
|
|
|
|
(kill-buffer htmlbuf))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;;;###autoload
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(defun org-html-htmlize-generate-css ()
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Create the CSS for all font definitions in the current Emacs session.
|
|
|
|
|
Use this to create face definitions in your CSS style file that can then
|
|
|
|
|
be used by code snippets transformed by htmlize.
|
|
|
|
|
This command just produces a buffer that contains class definitions for all
|
|
|
|
|
faces used in the current Emacs session. You can copy and paste the ones you
|
|
|
|
|
need into your CSS file.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-19 13:03:59 -05:00
|
|
|
|
If you then set `org-html-htmlize-output-type' to `css', calls
|
|
|
|
|
to the function `org-html-htmlize-region-for-paste' will
|
2013-01-27 17:11:34 -05:00
|
|
|
|
produce code that uses these same face definitions."
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(interactive)
|
|
|
|
|
(require 'htmlize)
|
|
|
|
|
(and (get-buffer "*html*") (kill-buffer "*html*"))
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(let ((fl (face-list))
|
|
|
|
|
(htmlize-css-name-prefix "org-")
|
|
|
|
|
(htmlize-output-type 'css)
|
|
|
|
|
f i)
|
|
|
|
|
(while (setq f (pop fl)
|
|
|
|
|
i (and f (face-attribute f :inherit)))
|
|
|
|
|
(when (and (symbolp f) (or (not i) (not (listp i))))
|
|
|
|
|
(insert (org-add-props (copy-sequence "1") nil 'face f))))
|
|
|
|
|
(htmlize-region (point-min) (point-max))))
|
|
|
|
|
(org-pop-to-buffer-same-window "*html*")
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(if (re-search-forward "<style" nil t)
|
|
|
|
|
(delete-region (point-min) (match-beginning 0)))
|
|
|
|
|
(if (re-search-forward "</style>" nil t)
|
|
|
|
|
(delete-region (1+ (match-end 0)) (point-max)))
|
|
|
|
|
(beginning-of-line 1)
|
|
|
|
|
(if (looking-at " +") (replace-match ""))
|
|
|
|
|
(goto-char (point-min)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--make-string (n string)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
"Build a string by concatenating N times STRING."
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(let (out) (dotimes (i n out) (setq out (concat string out)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-fix-class-name (kwd) ; audit callers of this function
|
2012-02-20 11:28:44 -05:00
|
|
|
|
"Turn todo keyword into a valid class name.
|
|
|
|
|
Replaces invalid characters with \"_\"."
|
|
|
|
|
(save-match-data
|
|
|
|
|
(while (string-match "[^a-zA-Z0-9_]" kwd)
|
|
|
|
|
(setq kwd (replace-match "_" t t kwd))))
|
|
|
|
|
kwd)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-footnote-reference (n def refcnt)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(let ((extra (if (= refcnt 1) "" (format ".%d" refcnt))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format org-html-footnote-format
|
2012-07-07 15:20:47 -04:00
|
|
|
|
(let* ((id (format "fnr.%s%s" n extra))
|
|
|
|
|
(href (format " href=\"#fn.%s\"" n))
|
|
|
|
|
(attributes (concat " class=\"footref\"" href)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--anchor id n attributes)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-footnotes-section (section-name definitions)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(if (not definitions) ""
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format org-html-footnotes-section section-name definitions)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-footnote-definition (fn)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(let ((n (car fn)) (def (cdr fn)))
|
|
|
|
|
(format
|
|
|
|
|
"<tr>\n<td>%s</td>\n<td>%s</td>\n</tr>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format org-html-footnote-format
|
2012-07-07 15:20:47 -04:00
|
|
|
|
(let* ((id (format "fn.%s" n))
|
|
|
|
|
(href (format " href=\"#fnr.%s\"" n))
|
|
|
|
|
(attributes (concat " class=\"footnum\"" href)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--anchor id n attributes)))
|
2012-07-07 15:20:47 -04:00
|
|
|
|
def)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-footnote-section (info)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(let* ((fn-alist (org-export-collect-footnote-definitions
|
|
|
|
|
(plist-get info :parse-tree) info))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(fn-alist
|
|
|
|
|
(loop for (n type raw) in fn-alist collect
|
org-export: Use `eq' instead of `equal' when possible
* contrib/lisp/org-export.el (org-export-data,
org-export-footnote-first-reference-p,
org-export-get-footnote-number, org-export-get-ordinal,
org-export-get-loc, org-export-table-row-group,
org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-cell-address): Use `eq' instead of `equal' when
possible.
* contrib/lisp/org-e-ascii.el (org-e-ascii-table-row):
* contrib/lisp/org-e-beamer.el (org-e-beamer-select-environment):
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html-latex-environment, org-e-html-paragraph): Use `eq'
instead of `equal' when possible.
* contrib/lisp/org-e-latex.el (org-e-latex--get-footnote-counter):
* contrib/lisp/org-e-odt.el (org-e-odt-do-format-code,
org-e-odt-footnote-def, org-e-odt-item, org-e-odt-latex-environment,
org-e-odt-latex-fragment, org-e-odt-plain-list, org-e-odt-table,
org-e-odt-enumerate-element): Use `eq' instead of `equal' when
possible.
In particular, comparing elements shouldn't be done with `equal' since
they are circular lists. On the other hand, using `eq' is fine if
they belong to the same tree.
2012-07-16 10:19:56 -04:00
|
|
|
|
(cons n (if (eq (org-element-type raw) 'org-data)
|
org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html-footnote-section, org-e-html-template,
org-e-html-dynamic-block, org-e-html-format-headline--wrap,
org-e-html-headline, org-e-html-item, org-e-html-link,
org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-dynamic-block,
org-e-latex-footnote-reference, org-e-latex-headline,
org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-write-manifest-file,
org-e-odt--caption/label-string, org-e-odt-dynamic-block,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.
Back-end can be found in communication channel with (plist-get
info :back-end). Hence back-ends do not have to hard-code their name
in any transcoder. It will allow to derive a back-end from another
one.
2012-04-28 05:33:16 -04:00
|
|
|
|
(org-trim (org-export-data raw info))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(format "<p>%s</p>"
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(org-trim (org-export-data raw info))))))))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(when fn-alist
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-footnotes-section
|
|
|
|
|
(org-html--translate "Footnotes" info)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(format
|
2012-02-29 03:39:14 -05:00
|
|
|
|
"<table>\n%s\n</table>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(mapconcat 'org-html-format-footnote-definition fn-alist "\n"))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Template
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--build-meta-info (info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Return meta tags for exported document.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(let* ((title (org-export-data (plist-get info :title) info))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(author (and (plist-get info :with-author)
|
|
|
|
|
(let ((auth (plist-get info :author)))
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(and auth (org-export-data auth info)))))
|
2012-11-09 05:04:07 -05:00
|
|
|
|
(date (and (plist-get info :with-date)
|
|
|
|
|
(let ((date (plist-get info :date)))
|
|
|
|
|
(and date (org-export-data date info)))))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(description (plist-get info :description))
|
|
|
|
|
(keywords (plist-get info :keywords)))
|
|
|
|
|
(concat
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(format "<title>%s</title>\n" title)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(format
|
2013-02-15 15:50:35 -05:00
|
|
|
|
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(or (and org-html-coding-system
|
2012-04-16 14:00:29 -04:00
|
|
|
|
(fboundp 'coding-system-get)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(coding-system-get org-html-coding-system 'mime-charset))
|
2012-04-16 14:00:29 -04:00
|
|
|
|
"iso-8859-1"))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(format "<meta name=\"title\" content=\"%s\"/>\n" title)
|
|
|
|
|
(format "<meta name=\"generator\" content=\"Org-mode\"/>\n")
|
2012-11-09 05:04:07 -05:00
|
|
|
|
(and date (format "<meta name=\"generated\" content=\"%s\"/>\n" date))
|
|
|
|
|
(and author (format "<meta name=\"author\" content=\"%s\"/>\n" author))
|
|
|
|
|
(and description
|
|
|
|
|
(format "<meta name=\"description\" content=\"%s\"/>\n" description))
|
|
|
|
|
(and keywords
|
|
|
|
|
(format "<meta name=\"keywords\" content=\"%s\"/>\n" keywords)))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--build-style (info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Return style information for exported document.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(org-element-normalize-string
|
|
|
|
|
(concat
|
2013-03-03 00:34:35 -05:00
|
|
|
|
(when (plist-get info :html-head-include-default-style)
|
2013-02-19 19:06:49 -05:00
|
|
|
|
(org-element-normalize-string org-html-style-default))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-element-normalize-string (plist-get info :html-style))
|
2013-02-19 19:06:49 -05:00
|
|
|
|
(when (and (plist-get info :html-htmlized-css-url)
|
|
|
|
|
(eq org-html-htmlize-output-type 'css))
|
|
|
|
|
(format "<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\" />\n"
|
|
|
|
|
(plist-get info :html-htmlized-css-url)))
|
2013-03-02 12:05:16 -05:00
|
|
|
|
(when (plist-get info :html-head-include-scripts) org-html-scripts))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--build-mathjax-config (info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Insert the user setup into the mathjax template.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
2013-02-15 09:50:38 -05:00
|
|
|
|
(when (and (memq (plist-get info :with-latex) '(mathjax t))
|
|
|
|
|
(org-element-map (plist-get info :parse-tree)
|
2013-02-15 10:42:04 -05:00
|
|
|
|
'(latex-fragment latex-environment) 'identity info t))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((template org-html-mathjax-template)
|
|
|
|
|
(options org-html-mathjax-options)
|
|
|
|
|
(in-buffer (or (plist-get info :html-mathjax) ""))
|
2012-03-04 13:49:35 -05:00
|
|
|
|
name val (yes " ") (no "// ") x)
|
2012-03-01 00:00:41 -05:00
|
|
|
|
(mapc
|
|
|
|
|
(lambda (e)
|
|
|
|
|
(setq name (car e) val (nth 1 e))
|
|
|
|
|
(if (string-match (concat "\\<" (symbol-name name) ":") in-buffer)
|
|
|
|
|
(setq val (car (read-from-string
|
|
|
|
|
(substring in-buffer (match-end 0))))))
|
|
|
|
|
(if (not (stringp val)) (setq val (format "%s" val)))
|
|
|
|
|
(if (string-match (concat "%" (upcase (symbol-name name))) template)
|
|
|
|
|
(setq template (replace-match val t t template))))
|
|
|
|
|
options)
|
|
|
|
|
(setq val (nth 1 (assq 'mathml options)))
|
|
|
|
|
(if (string-match (concat "\\<mathml:") in-buffer)
|
|
|
|
|
(setq val (car (read-from-string
|
|
|
|
|
(substring in-buffer (match-end 0))))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Exchange prefixes depending on mathml setting.
|
2012-03-01 00:00:41 -05:00
|
|
|
|
(if (not val) (setq x yes yes no no x))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Replace cookies to turn on or off the config/jax lines.
|
2012-03-01 00:00:41 -05:00
|
|
|
|
(if (string-match ":MMLYES:" template)
|
|
|
|
|
(setq template (replace-match yes t t template)))
|
|
|
|
|
(if (string-match ":MMLNO:" template)
|
|
|
|
|
(setq template (replace-match no t t template)))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Return the modified template.
|
|
|
|
|
(org-element-normalize-string template))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--build-preamble (info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Return document preamble as a string, or nil.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(let ((preamble (plist-get info :html-preamble)))
|
|
|
|
|
(when preamble
|
|
|
|
|
(let ((preamble-contents
|
|
|
|
|
(if (functionp preamble) (funcall preamble info)
|
|
|
|
|
(let ((title (org-export-data (plist-get info :title) info))
|
2012-11-09 05:04:07 -05:00
|
|
|
|
(date (if (not (plist-get info :with-date)) ""
|
|
|
|
|
(org-export-data (plist-get info :date) info)))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(author (if (not (plist-get info :with-author)) ""
|
|
|
|
|
(org-export-data (plist-get info :author) info)))
|
|
|
|
|
(email (if (not (plist-get info :with-email)) ""
|
|
|
|
|
(plist-get info :email))))
|
|
|
|
|
(if (stringp preamble)
|
|
|
|
|
(format-spec preamble
|
|
|
|
|
`((?t . ,title) (?a . ,author)
|
|
|
|
|
(?d . ,date) (?e . ,email)))
|
|
|
|
|
(format-spec
|
|
|
|
|
(or (cadr (assoc (plist-get info :language)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
org-html-preamble-format))
|
|
|
|
|
(cadr (assoc "en" org-html-preamble-format)))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
`((?t . ,title) (?a . ,author)
|
|
|
|
|
(?d . ,date) (?e . ,email))))))))
|
|
|
|
|
(when (org-string-nw-p preamble-contents)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(concat (format "<div id=\"%s\">\n" (nth 0 org-html-divs))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(org-element-normalize-string preamble-contents)
|
|
|
|
|
"</div>\n"))))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--build-postamble (info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Return document postamble as a string, or nil.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(let ((postamble (plist-get info :html-postamble)))
|
|
|
|
|
(when postamble
|
|
|
|
|
(let ((postamble-contents
|
|
|
|
|
(if (functionp postamble) (funcall postamble info)
|
2012-11-09 05:04:07 -05:00
|
|
|
|
(let ((date (if (not (plist-get info :with-date)) ""
|
|
|
|
|
(org-export-data (plist-get info :date) info)))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(author (let ((author (plist-get info :author)))
|
|
|
|
|
(and author (org-export-data author info))))
|
|
|
|
|
(email (mapconcat
|
|
|
|
|
(lambda (e)
|
|
|
|
|
(format "<a href=\"mailto:%s\">%s</a>" e e))
|
|
|
|
|
(split-string (plist-get info :email) ",+ *")
|
|
|
|
|
", "))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(html-validation-link (or org-html-validation-link ""))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(creator-info (plist-get info :creator)))
|
|
|
|
|
(cond ((stringp postamble)
|
|
|
|
|
(format-spec postamble
|
|
|
|
|
`((?a . ,author) (?e . ,email)
|
|
|
|
|
(?d . ,date) (?c . ,creator-info)
|
|
|
|
|
(?v . ,html-validation-link))))
|
|
|
|
|
((eq postamble 'auto)
|
|
|
|
|
(concat
|
|
|
|
|
(when (plist-get info :time-stamp-file)
|
|
|
|
|
(format "<p class=\"date\">%s: %s</p>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--translate "Date" info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
date))
|
|
|
|
|
(when (and (plist-get info :with-author) author)
|
|
|
|
|
(format "<p class=\"author\">%s : %s</p>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--translate "Author" info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
author))
|
|
|
|
|
(when (and (plist-get info :with-email) email)
|
|
|
|
|
(format "<p class=\"email\">%s </p>\n" email))
|
|
|
|
|
(when (plist-get info :with-creator)
|
|
|
|
|
(format "<p class=\"creator\">%s</p>\n"
|
|
|
|
|
creator-info))
|
|
|
|
|
html-validation-link "\n"))
|
|
|
|
|
(t (format-spec
|
|
|
|
|
(or (cadr (assoc (plist-get info :language)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
org-html-postamble-format))
|
|
|
|
|
(cadr (assoc "en" org-html-postamble-format)))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
`((?a . ,author) (?e . ,email)
|
|
|
|
|
(?d . ,date) (?c . ,creator-info)
|
|
|
|
|
(?v . ,html-validation-link)))))))))
|
|
|
|
|
(when (org-string-nw-p postamble-contents)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(concat
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format "<div id=\"%s\">\n" (nth 2 org-html-divs))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(org-element-normalize-string postamble-contents)
|
|
|
|
|
"</div>\n"))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-02-11 16:19:23 -05:00
|
|
|
|
(defun org-html-inner-template (contents info)
|
|
|
|
|
"Return body of document string after HTML conversion.
|
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
|
|
|
|
(concat
|
|
|
|
|
(format "<div id=\"%s\">\n" (nth 1 org-html-divs))
|
2013-03-01 07:57:54 -05:00
|
|
|
|
;; Document title.
|
|
|
|
|
(let ((title (plist-get info :title)))
|
|
|
|
|
(when title
|
|
|
|
|
(format "<h1 class=\"title\">%s</h1>\n" (org-export-data title info))))
|
2013-02-11 16:19:23 -05:00
|
|
|
|
;; Table of contents.
|
|
|
|
|
(let ((depth (plist-get info :with-toc)))
|
|
|
|
|
(when depth (org-html-toc depth info)))
|
|
|
|
|
;; Document contents.
|
|
|
|
|
contents
|
|
|
|
|
;; Footnotes section.
|
|
|
|
|
(org-html-footnote-section info)
|
|
|
|
|
;; Bibliography.
|
|
|
|
|
(org-html-bibliography)
|
|
|
|
|
"\n</div>"))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-template (contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Return complete document string after HTML conversion.
|
2012-09-25 16:20:37 -04:00
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(concat
|
|
|
|
|
(format
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(or (and (stringp org-html-xml-declaration)
|
|
|
|
|
org-html-xml-declaration)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cdr (assoc (plist-get info :html-extension)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
org-html-xml-declaration))
|
|
|
|
|
(cdr (assoc "html" org-html-xml-declaration))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
"")
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(or (and org-html-coding-system
|
2012-09-25 16:20:37 -04:00
|
|
|
|
(fboundp 'coding-system-get)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(coding-system-get org-html-coding-system 'mime-charset))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"iso-8859-1"))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"\n"
|
|
|
|
|
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
|
|
|
|
|
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
|
|
|
|
|
(format "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\">\n"
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(plist-get info :language) (plist-get info :language))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"<head>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--build-meta-info info)
|
|
|
|
|
(org-html--build-style info)
|
|
|
|
|
(org-html--build-mathjax-config info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"</head>\n"
|
|
|
|
|
"<body>\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((link-up (org-trim (plist-get info :html-link-up)))
|
|
|
|
|
(link-home (org-trim (plist-get info :html-link-home))))
|
2012-05-27 07:23:58 -04:00
|
|
|
|
(unless (and (string= link-up "") (string= link-up ""))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format org-html-home/up-format
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(or link-up link-home)
|
|
|
|
|
(or link-home link-up))))
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Preamble.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--build-preamble info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Document contents.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
contents
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Postamble.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--build-postamble info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
;; Closing document.
|
|
|
|
|
"</body>\n</html>"))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--translate (s info)
|
2012-09-25 16:20:37 -04:00
|
|
|
|
"Translate string S according to specified language.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(org-export-translate s :html info))
|
2012-07-12 17:53:57 -04:00
|
|
|
|
|
2012-07-07 15:20:47 -04:00
|
|
|
|
;;;; Anchor
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--anchor (&optional id desc attributes)
|
|
|
|
|
(let* ((name (and org-html-allow-name-attribute-in-anchors id))
|
2012-07-07 15:20:47 -04:00
|
|
|
|
(attributes (concat (and id (format " id=\"%s\"" id))
|
|
|
|
|
(and name (format " name=\"%s\"" name))
|
|
|
|
|
attributes)))
|
|
|
|
|
(format "<a%s>%s</a>" attributes (or desc ""))))
|
|
|
|
|
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;;;; Todo
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--todo (todo)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(when todo
|
|
|
|
|
(format "<span class=\"%s %s%s\">%s</span>"
|
|
|
|
|
(if (member todo org-done-keywords) "done" "todo")
|
2013-01-27 17:11:34 -05:00
|
|
|
|
org-html-todo-kwd-class-prefix (org-html-fix-class-name todo)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
todo)))
|
|
|
|
|
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;;;; Tags
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html--tags (tags)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(when tags
|
|
|
|
|
(format "<span class=\"tag\">%s</span>"
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (tag)
|
|
|
|
|
(format "<span class=\"%s\">%s</span>"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(concat org-html-tag-class-prefix
|
|
|
|
|
(org-html-fix-class-name tag))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
tag))
|
2013-03-02 00:30:46 -05:00
|
|
|
|
tags " "))))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;;;; Headline
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun* org-html-format-headline
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(todo todo-type priority text tags
|
|
|
|
|
&key level section-number headline-label &allow-other-keys)
|
|
|
|
|
(let ((section-number
|
|
|
|
|
(when section-number
|
|
|
|
|
(format "<span class=\"section-number-%d\">%s</span> "
|
|
|
|
|
level section-number)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(todo (org-html--todo todo))
|
|
|
|
|
(tags (org-html--tags tags)))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(concat section-number todo (and todo " ") text
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(and tags "   ") tags)))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;;;; Src Code
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-fontify-code (code lang)
|
2012-12-09 06:18:22 -05:00
|
|
|
|
"Color CODE with htmlize library.
|
|
|
|
|
CODE is a string representing the source code to colorize. LANG
|
|
|
|
|
is the language used for CODE, as a string, or nil."
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(when code
|
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: No lang. Possibly an example block.
|
|
|
|
|
((not lang)
|
|
|
|
|
;; Simple transcoding.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-encode-plain-text code))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
;; Case 2: No htmlize or an inferior version of htmlize
|
|
|
|
|
((not (and (require 'htmlize nil t) (fboundp 'htmlize-region-for-paste)))
|
|
|
|
|
;; Emit a warning.
|
|
|
|
|
(message "Cannot fontify src block (htmlize.el >= 1.34 required)")
|
|
|
|
|
;; Simple transcoding.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-encode-plain-text code))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(t
|
|
|
|
|
;; Map language
|
|
|
|
|
(setq lang (or (assoc-default lang org-src-lang-modes) lang))
|
|
|
|
|
(let* ((lang-mode (and lang (intern (format "%s-mode" lang)))))
|
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: Language is not associated with any Emacs mode
|
|
|
|
|
((not (functionp lang-mode))
|
|
|
|
|
;; Simple transcoding.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-encode-plain-text code))
|
2012-07-12 17:53:57 -04:00
|
|
|
|
;; Case 2: Default. Fontify code.
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(t
|
|
|
|
|
;; htmlize
|
|
|
|
|
(setq code (with-temp-buffer
|
2012-07-12 17:53:57 -04:00
|
|
|
|
;; Switch to language-specific mode.
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(funcall lang-mode)
|
2012-12-12 17:16:51 -05:00
|
|
|
|
(insert code)
|
2012-07-12 17:53:57 -04:00
|
|
|
|
;; Fontify buffer.
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(font-lock-fontify-buffer)
|
2012-07-12 17:53:57 -04:00
|
|
|
|
;; Remove formatting on newline characters.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((beg (point-min))
|
|
|
|
|
(end (point-max)))
|
|
|
|
|
(goto-char beg)
|
|
|
|
|
(while (progn (end-of-line) (< (point) end))
|
|
|
|
|
(put-text-property (point) (1+ (point)) 'face nil)
|
|
|
|
|
(forward-char 1))))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(org-src-mode)
|
|
|
|
|
(set-buffer-modified-p nil)
|
2012-07-12 17:53:57 -04:00
|
|
|
|
;; Htmlize region.
|
2013-02-19 13:03:59 -05:00
|
|
|
|
(org-html-htmlize-region-for-paste
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(point-min) (point-max))))
|
2013-02-25 18:29:04 -05:00
|
|
|
|
;; Strip any enclosing <pre></pre> tags.
|
|
|
|
|
(let* ((beg (and (string-match "\\`<pre[^>]*>\n*" code) (match-end 0)))
|
|
|
|
|
(end (and beg (string-match "</pre>\\'" code))))
|
|
|
|
|
(if (and beg end) (substring code beg end) code)))))))))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-do-format-code
|
2012-12-09 06:16:37 -05:00
|
|
|
|
(code &optional lang refs retain-labels num-start)
|
|
|
|
|
"Format CODE string as source code.
|
|
|
|
|
Optional arguments LANG, REFS, RETAIN-LABELS and NUM-START are,
|
|
|
|
|
respectively, the language of the source code, as a string, an
|
|
|
|
|
alist between line numbers and references (as returned by
|
|
|
|
|
`org-export-unravel-code'), a boolean specifying if labels should
|
|
|
|
|
appear in the source code, and the number associated to the first
|
|
|
|
|
line of code."
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(let* ((code-lines (org-split-string code "\n"))
|
|
|
|
|
(code-length (length code-lines))
|
|
|
|
|
(num-fmt
|
|
|
|
|
(and num-start
|
|
|
|
|
(format "%%%ds: "
|
|
|
|
|
(length (number-to-string (+ code-length num-start))))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(code (org-html-fontify-code code lang)))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(org-export-format-code
|
|
|
|
|
code
|
|
|
|
|
(lambda (loc line-num ref)
|
|
|
|
|
(setq loc
|
|
|
|
|
(concat
|
|
|
|
|
;; Add line number, if needed.
|
|
|
|
|
(when num-start
|
|
|
|
|
(format "<span class=\"linenr\">%s</span>"
|
|
|
|
|
(format num-fmt line-num)))
|
|
|
|
|
;; Transcoded src line.
|
|
|
|
|
loc
|
|
|
|
|
;; Add label, if needed.
|
|
|
|
|
(when (and ref retain-labels) (format " (%s)" ref))))
|
|
|
|
|
;; Mark transcoded line as an anchor, if needed.
|
|
|
|
|
(if (not ref) loc
|
|
|
|
|
(format "<span id=\"coderef-%s\" class=\"coderef-off\">%s</span>"
|
|
|
|
|
ref loc)))
|
|
|
|
|
num-start refs)))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-code (element info)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
"Format contents of ELEMENT as source code.
|
|
|
|
|
ELEMENT is either an example block or a src block. INFO is
|
|
|
|
|
a plist used as a communication channel."
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(let* ((lang (org-element-property :language element))
|
|
|
|
|
;; Extract code and references.
|
|
|
|
|
(code-info (org-export-unravel-code element))
|
|
|
|
|
(code (car code-info))
|
|
|
|
|
(refs (cdr code-info))
|
|
|
|
|
;; Does the src block contain labels?
|
|
|
|
|
(retain-labels (org-element-property :retain-labels element))
|
|
|
|
|
;; Does it have line numbers?
|
|
|
|
|
(num-start (case (org-element-property :number-lines element)
|
|
|
|
|
(continued (org-export-get-loc element info))
|
|
|
|
|
(new 0))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-do-format-code code lang refs retain-labels num-start)))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
|
2012-03-08 02:55:58 -05:00
|
|
|
|
|
2013-02-24 09:57:46 -05:00
|
|
|
|
|
|
|
|
|
;;; Tables of Contents
|
|
|
|
|
|
|
|
|
|
(defun org-html-toc (depth info)
|
|
|
|
|
"Build a table of contents.
|
|
|
|
|
DEPTH is an integer specifying the depth of the table. INFO is
|
|
|
|
|
a plist used as a communication channel. Return the table of
|
|
|
|
|
contents as a string, or nil if it is empty."
|
|
|
|
|
(let ((toc-entries
|
|
|
|
|
(mapcar (lambda (headline)
|
|
|
|
|
(cons (org-html--format-toc-headline headline info)
|
|
|
|
|
(org-export-get-relative-level headline info)))
|
|
|
|
|
(org-export-collect-headlines info depth))))
|
|
|
|
|
(when toc-entries
|
|
|
|
|
(concat "<div id=\"table-of-contents\">\n"
|
|
|
|
|
(format "<h%d>%s</h%d>\n"
|
|
|
|
|
org-html-toplevel-hlevel
|
|
|
|
|
(org-html--translate "Table of Contents" info)
|
|
|
|
|
org-html-toplevel-hlevel)
|
|
|
|
|
"<div id=\"text-table-of-contents\">"
|
|
|
|
|
(org-html--toc-text toc-entries)
|
|
|
|
|
"</div>\n"
|
|
|
|
|
"</div>\n"))))
|
|
|
|
|
|
|
|
|
|
(defun org-html--toc-text (toc-entries)
|
|
|
|
|
"Return innards of a table of contents, as a string.
|
|
|
|
|
TOC-ENTRIES is an alist where key is an entry title, as a string,
|
|
|
|
|
and value is its relative level, as an integer."
|
|
|
|
|
(let* ((prev-level (1- (cdar toc-entries)))
|
|
|
|
|
(start-level prev-level))
|
|
|
|
|
(concat
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (entry)
|
|
|
|
|
(let ((headline (car entry))
|
|
|
|
|
(level (cdr entry)))
|
|
|
|
|
(concat
|
|
|
|
|
(let* ((cnt (- level prev-level))
|
|
|
|
|
(times (if (> cnt 0) (1- cnt) (- cnt)))
|
|
|
|
|
rtn)
|
|
|
|
|
(setq prev-level level)
|
|
|
|
|
(concat
|
|
|
|
|
(org-html--make-string
|
|
|
|
|
times (cond ((> cnt 0) "\n<ul>\n<li>")
|
|
|
|
|
((< cnt 0) "</li>\n</ul>\n")))
|
|
|
|
|
(if (> cnt 0) "\n<ul>\n<li>" "</li>\n<li>")))
|
|
|
|
|
headline)))
|
|
|
|
|
toc-entries "")
|
|
|
|
|
(org-html--make-string (- prev-level start-level) "</li>\n</ul>\n"))))
|
|
|
|
|
|
2013-02-24 10:03:58 -05:00
|
|
|
|
(defun org-html--format-toc-headline (headline info)
|
2013-02-24 09:57:46 -05:00
|
|
|
|
"Return an appropriate table of contents entry for HEADLINE.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(let* ((headline-number (org-export-get-headline-number headline info))
|
|
|
|
|
(section-number
|
|
|
|
|
(and (not (org-export-low-level-p headline info))
|
|
|
|
|
(org-export-numbered-headline-p headline info)
|
|
|
|
|
(concat (mapconcat 'number-to-string headline-number ".") ". ")))
|
|
|
|
|
(tags (and (eq (plist-get info :with-tags) t)
|
|
|
|
|
(org-export-get-tags headline info))))
|
|
|
|
|
(format "<a href=\"#%s\">%s</a>"
|
|
|
|
|
;; Label.
|
|
|
|
|
(org-export-solidify-link-text
|
|
|
|
|
(or (org-element-property :CUSTOM_ID headline)
|
|
|
|
|
(concat "sec-" (mapconcat 'number-to-string
|
|
|
|
|
headline-number "-"))))
|
|
|
|
|
;; Body.
|
|
|
|
|
(concat section-number
|
2013-03-01 13:06:53 -05:00
|
|
|
|
(org-export-data-with-translations
|
|
|
|
|
(org-export-get-alt-title headline info)
|
|
|
|
|
;; Ignore any footnote-reference, link,
|
|
|
|
|
;; radio-target and target in table of contents.
|
2013-03-02 11:44:43 -05:00
|
|
|
|
(append
|
2013-03-01 13:06:53 -05:00
|
|
|
|
'((footnote-reference . ignore)
|
2013-03-02 11:44:43 -05:00
|
|
|
|
(link . (lambda (link desc i) desc))
|
|
|
|
|
(radio-target . (lambda (radio desc i) desc))
|
2013-03-01 13:06:53 -05:00
|
|
|
|
(target . ignore))
|
|
|
|
|
(org-export-backend-translate-table 'html))
|
|
|
|
|
info)
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(and tags "   ") (org-html--tags tags)))))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
|
|
|
|
|
(defun org-html-list-of-listings (info)
|
|
|
|
|
"Build a list of listings.
|
|
|
|
|
INFO is a plist used as a communication channel. Return the list
|
|
|
|
|
of listings as a string, or nil if it is empty."
|
|
|
|
|
(let ((lol-entries (org-export-collect-listings info)))
|
|
|
|
|
(when lol-entries
|
|
|
|
|
(concat "<div id=\"list-of-listings\">\n"
|
|
|
|
|
(format "<h%d>%s</h%d>\n"
|
|
|
|
|
org-html-toplevel-hlevel
|
|
|
|
|
(org-html--translate "List of Listings" info)
|
|
|
|
|
org-html-toplevel-hlevel)
|
|
|
|
|
"<div id=\"text-list-of-listings\">\n<ul>\n"
|
|
|
|
|
(let ((count 0)
|
|
|
|
|
(initial-fmt (org-html--translate "Listing %d:" info)))
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (entry)
|
|
|
|
|
(let ((label (org-element-property :name entry))
|
|
|
|
|
(title (org-trim
|
|
|
|
|
(org-export-data
|
|
|
|
|
(or (org-export-get-caption entry t)
|
|
|
|
|
(org-export-get-caption entry))
|
|
|
|
|
info))))
|
|
|
|
|
(concat
|
|
|
|
|
"<li>"
|
|
|
|
|
(if (not label)
|
|
|
|
|
(concat (format initial-fmt (incf count)) " " title)
|
|
|
|
|
(format "<a href=\"#%s\">%s %s</a>"
|
|
|
|
|
(org-export-solidify-link-text label)
|
|
|
|
|
(format initial-fmt (incf count))
|
|
|
|
|
title))
|
|
|
|
|
"</li>")))
|
|
|
|
|
lol-entries "\n"))
|
|
|
|
|
"\n</ul>\n</div>\n</div>"))))
|
|
|
|
|
|
|
|
|
|
(defun org-html-list-of-tables (info)
|
|
|
|
|
"Build a list of tables.
|
|
|
|
|
INFO is a plist used as a communication channel. Return the list
|
|
|
|
|
of tables as a string, or nil if it is empty."
|
|
|
|
|
(let ((lol-entries (org-export-collect-tables info)))
|
|
|
|
|
(when lol-entries
|
|
|
|
|
(concat "<div id=\"list-of-tables\">\n"
|
|
|
|
|
(format "<h%d>%s</h%d>\n"
|
|
|
|
|
org-html-toplevel-hlevel
|
|
|
|
|
(org-html--translate "List of Tables" info)
|
|
|
|
|
org-html-toplevel-hlevel)
|
|
|
|
|
"<div id=\"text-list-of-tables\">\n<ul>\n"
|
|
|
|
|
(let ((count 0)
|
|
|
|
|
(initial-fmt (org-html--translate "Table %d:" info)))
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (entry)
|
|
|
|
|
(let ((label (org-element-property :name entry))
|
|
|
|
|
(title (org-trim
|
|
|
|
|
(org-export-data
|
|
|
|
|
(or (org-export-get-caption entry t)
|
|
|
|
|
(org-export-get-caption entry))
|
|
|
|
|
info))))
|
|
|
|
|
(concat
|
|
|
|
|
"<li>"
|
|
|
|
|
(if (not label)
|
|
|
|
|
(concat (format initial-fmt (incf count)) " " title)
|
|
|
|
|
(format "<a href=\"#%s\">%s %s</a>"
|
|
|
|
|
(org-export-solidify-link-text label)
|
|
|
|
|
(format initial-fmt (incf count))
|
|
|
|
|
title))
|
|
|
|
|
"</li>")))
|
|
|
|
|
lol-entries "\n"))
|
|
|
|
|
"\n</ul>\n</div>\n</div>"))))
|
|
|
|
|
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;; Transcode Functions
|
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Bold
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-bold (bold contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode BOLD from Org to HTML.
|
|
|
|
|
CONTENTS is the text with bold markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format (or (cdr (assq 'bold org-html-text-markup-alist)) "%s")
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Center Block
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-center-block (center-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a CENTER-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(format "<div style=\"text-align: center\">\n%s</div>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-04-28 20:11:22 -04:00
|
|
|
|
;;;; Clock
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-clock (clock contents info)
|
2012-04-28 20:11:22 -04:00
|
|
|
|
"Transcode a CLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
|
|
|
|
(format "<p>
|
|
|
|
|
<span class=\"timestamp-wrapper\">
|
|
|
|
|
<span class=\"timestamp-kwd\">%s</span> <span class=\"timestamp\">%s</span>%s
|
|
|
|
|
</span>
|
|
|
|
|
</p>"
|
|
|
|
|
org-clock-string
|
2012-10-30 16:59:50 -04:00
|
|
|
|
(org-translate-time
|
|
|
|
|
(org-element-property :raw-value
|
|
|
|
|
(org-element-property :value clock)))
|
|
|
|
|
(let ((time (org-element-property :duration clock)))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
(and time (format " <span class=\"timestamp\">(%s)</span>" time)))))
|
|
|
|
|
|
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Code
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-code (code contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode CODE from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format (or (cdr (assq 'code org-html-text-markup-alist)) "%s")
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
(org-element-property :value code)))
|
|
|
|
|
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Drawer
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-drawer (drawer contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a DRAWER element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(if (functionp org-html-format-drawer-function)
|
|
|
|
|
(funcall org-html-format-drawer-function
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(org-element-property :drawer-name drawer)
|
|
|
|
|
contents)
|
|
|
|
|
;; If there's no user defined function: simply
|
|
|
|
|
;; display contents of the drawer.
|
|
|
|
|
contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Dynamic Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-dynamic-block (dynamic-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a DYNAMIC-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html-footnote-section, org-e-html-template,
org-e-html-dynamic-block, org-e-html-format-headline--wrap,
org-e-html-headline, org-e-html-item, org-e-html-link,
org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-dynamic-block,
org-e-latex-footnote-reference, org-e-latex-headline,
org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-write-manifest-file,
org-e-odt--caption/label-string, org-e-odt-dynamic-block,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.
Back-end can be found in communication channel with (plist-get
info :back-end). Hence back-ends do not have to hard-code their name
in any transcoder. It will allow to derive a back-end from another
one.
2012-04-28 05:33:16 -04:00
|
|
|
|
holding contextual information. See `org-export-data'."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
contents)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Entity
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-entity (entity contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an ENTITY object from Org to HTML.
|
|
|
|
|
CONTENTS are the definition itself. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(org-element-property :html entity))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Example Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-example-block (example-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a EXAMPLE-BLOCK element from Org to HTML.
|
2012-12-09 06:16:37 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
(if (org-export-read-attribute :attr_html example-block :textarea)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--textarea-block example-block)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
(format "<pre class=\"example\">\n%s</pre>"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-code example-block info))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Export Snippet
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-export-snippet (export-snippet contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a EXPORT-SNIPPET object from Org to HTML.
|
2012-12-09 06:16:37 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(when (eq (org-export-snippet-backend export-snippet) 'html)
|
2012-02-23 12:10:14 -05:00
|
|
|
|
(org-element-property :value export-snippet)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Export Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-export-block (export-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a EXPORT-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-05-05 16:47:00 -04:00
|
|
|
|
(when (string= (org-element-property :type export-block) "HTML")
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(org-remove-indentation (org-element-property :value export-block))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Fixed Width
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-fixed-width (fixed-width contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a FIXED-WIDTH element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(format "<pre class=\"example\">\n%s</pre>"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-do-format-code
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(org-remove-indentation
|
|
|
|
|
(org-element-property :value fixed-width)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Footnote Reference
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-footnote-reference (footnote-reference contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a FOOTNOTE-REFERENCE element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(concat
|
|
|
|
|
;; Insert separator between two footnotes in a row.
|
2012-07-27 10:13:57 -04:00
|
|
|
|
(let ((prev (org-export-get-previous-element footnote-reference info)))
|
2012-03-04 13:49:35 -05:00
|
|
|
|
(when (eq (org-element-type prev) 'footnote-reference)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
org-html-footnote-separator))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
|
|
|
|
((not (org-export-footnote-first-reference-p footnote-reference info))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-footnote-reference
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(org-export-get-footnote-number footnote-reference info)
|
2012-02-18 16:35:35 -05:00
|
|
|
|
"IGNORED" 100))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Inline definitions are secondary strings.
|
2012-02-22 09:36:58 -05:00
|
|
|
|
((eq (org-element-property :type footnote-reference) 'inline)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-footnote-reference
|
2012-02-18 16:35:35 -05:00
|
|
|
|
(org-export-get-footnote-number footnote-reference info)
|
|
|
|
|
"IGNORED" 1))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Non-inline footnotes definitions are full Org data.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(t (org-html-format-footnote-reference
|
2012-02-18 16:35:35 -05:00
|
|
|
|
(org-export-get-footnote-number footnote-reference info)
|
|
|
|
|
"IGNORED" 1)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Headline
|
|
|
|
|
|
2013-02-24 13:25:58 -05:00
|
|
|
|
(defun org-html-format-headline--wrap
|
|
|
|
|
(headline info &optional format-function &rest extra-keys)
|
2013-02-23 07:47:44 -05:00
|
|
|
|
"Transcode a HEADLINE element from Org to HTML.
|
2012-02-19 10:57:05 -05:00
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(let* ((level (+ (org-export-get-relative-level headline info)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(1- org-html-toplevel-hlevel)))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(headline-number (org-export-get-headline-number headline info))
|
2012-09-10 19:21:24 -04:00
|
|
|
|
(section-number (and (not (org-export-low-level-p headline info))
|
|
|
|
|
(org-export-numbered-headline-p headline info)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(mapconcat 'number-to-string
|
|
|
|
|
headline-number ".")))
|
2012-02-19 10:57:05 -05:00
|
|
|
|
(todo (and (plist-get info :with-todo-keywords)
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(let ((todo (org-element-property :todo-keyword headline)))
|
|
|
|
|
(and todo (org-export-data todo info)))))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(todo-type (and todo (org-element-property :todo-type headline)))
|
2012-02-19 10:57:05 -05:00
|
|
|
|
(priority (and (plist-get info :with-priority)
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(org-element-property :priority headline)))
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(text (org-export-data (org-element-property :title headline) info))
|
2012-02-19 10:57:05 -05:00
|
|
|
|
(tags (and (plist-get info :with-tags)
|
2012-05-26 07:44:13 -04:00
|
|
|
|
(org-export-get-tags headline info)))
|
2013-02-22 08:51:58 -05:00
|
|
|
|
(headline-label (or (org-element-property :CUSTOM_ID headline)
|
2012-06-01 19:42:00 -04:00
|
|
|
|
(concat "sec-" (mapconcat 'number-to-string
|
|
|
|
|
headline-number "-"))))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(format-function (cond
|
|
|
|
|
((functionp format-function) format-function)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((functionp org-html-format-headline-function)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(function*
|
|
|
|
|
(lambda (todo todo-type priority text tags
|
|
|
|
|
&allow-other-keys)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(funcall org-html-format-headline-function
|
2012-03-08 02:55:58 -05:00
|
|
|
|
todo todo-type priority text tags))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(t 'org-html-format-headline))))
|
2012-03-14 05:56:28 -04:00
|
|
|
|
(apply format-function
|
2012-03-08 02:55:58 -05:00
|
|
|
|
todo todo-type priority text tags
|
|
|
|
|
:headline-label headline-label :level level
|
|
|
|
|
:section-number section-number extra-keys)))
|
2012-02-19 10:57:05 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-headline (headline contents info)
|
2013-02-23 07:47:44 -05:00
|
|
|
|
"Transcode a HEADLINE element from Org to HTML.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2012-06-01 20:04:20 -04:00
|
|
|
|
;; Empty contents?
|
|
|
|
|
(setq contents (or contents ""))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(let* ((numberedp (org-export-numbered-headline-p headline info))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(level (org-export-get-relative-level headline info))
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(text (org-export-data (org-element-property :title headline) info))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(todo (and (plist-get info :with-todo-keywords)
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(let ((todo (org-element-property :todo-keyword headline)))
|
|
|
|
|
(and todo (org-export-data todo info)))))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(todo-type (and todo (org-element-property :todo-type headline)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(tags (and (plist-get info :with-tags)
|
2012-05-26 07:44:13 -04:00
|
|
|
|
(org-export-get-tags headline info)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(priority (and (plist-get info :with-priority)
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(org-element-property :priority headline)))
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(section-number (and (org-export-numbered-headline-p headline info)
|
|
|
|
|
(mapconcat 'number-to-string
|
|
|
|
|
(org-export-get-headline-number
|
|
|
|
|
headline info) ".")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Create the headline text.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(full-text (org-html-format-headline--wrap headline info)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: This is a footnote section: ignore it.
|
2012-02-22 09:36:58 -05:00
|
|
|
|
((org-element-property :footnote-section-p headline) nil)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Case 2. This is a deep sub-tree: export it as a list item.
|
|
|
|
|
;; Also export as items headlines for which no section
|
|
|
|
|
;; format has been found.
|
2012-09-10 19:21:24 -04:00
|
|
|
|
((org-export-low-level-p headline info)
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;; Build the real contents of the sub-tree.
|
2012-09-10 19:21:24 -04:00
|
|
|
|
(let* ((type (if numberedp 'ordered 'unordered))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(itemized-body (org-html-format-list-item
|
2012-02-20 11:28:44 -05:00
|
|
|
|
contents type nil nil full-text)))
|
|
|
|
|
(concat
|
2012-07-27 10:13:57 -04:00
|
|
|
|
(and (org-export-first-sibling-p headline info)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-begin-plain-list type))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
itemized-body
|
2012-07-27 10:13:57 -04:00
|
|
|
|
(and (org-export-last-sibling-p headline info)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-end-plain-list type)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Case 3. Standard headline. Export it as a section.
|
|
|
|
|
(t
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(let* ((section-number (mapconcat 'number-to-string
|
|
|
|
|
(org-export-get-headline-number
|
|
|
|
|
headline info) "-"))
|
|
|
|
|
(ids (remove 'nil
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 18:01:21 -05:00
|
|
|
|
(list (org-element-property :CUSTOM_ID headline)
|
2012-07-07 09:54:53 -04:00
|
|
|
|
(concat "sec-" section-number)
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 18:01:21 -05:00
|
|
|
|
(org-element-property :ID headline))))
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(preferred-id (car ids))
|
|
|
|
|
(extra-ids (cdr ids))
|
2013-02-24 13:42:12 -05:00
|
|
|
|
(extra-class (org-element-property :HTML_CONTAINER_CLASS headline))
|
2013-03-01 10:16:53 -05:00
|
|
|
|
(level1 (+ level (1- org-html-toplevel-hlevel)))
|
|
|
|
|
(first-content (car (org-element-contents headline))))
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(format "<div id=\"%s\" class=\"%s\">%s%s</div>\n"
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(format "outline-container-%s"
|
2013-02-22 08:51:58 -05:00
|
|
|
|
(or (org-element-property :CUSTOM_ID headline)
|
2012-07-07 09:54:53 -04:00
|
|
|
|
section-number))
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(concat (format "outline-%d" level1) (and extra-class " ")
|
|
|
|
|
extra-class)
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(format "\n<h%d id=\"%s\">%s%s</h%d>\n"
|
|
|
|
|
level1
|
|
|
|
|
preferred-id
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (x)
|
2012-07-12 17:53:57 -04:00
|
|
|
|
(let ((id (org-export-solidify-link-text
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(if (org-uuidgen-p x) (concat "ID-" x)
|
|
|
|
|
x))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--anchor id)))
|
2012-05-30 17:26:59 -04:00
|
|
|
|
extra-ids "")
|
|
|
|
|
full-text
|
|
|
|
|
level1)
|
2013-03-01 13:06:53 -05:00
|
|
|
|
;; When there is no section, pretend there is an empty
|
|
|
|
|
;; one to get the correct <div class="outline- ...>
|
|
|
|
|
;; which is needed by `org-info.js'.
|
2013-03-01 10:16:53 -05:00
|
|
|
|
(if (not (eq (org-element-type first-content) 'section))
|
|
|
|
|
(concat (org-html-section first-content "" info)
|
|
|
|
|
contents)
|
|
|
|
|
contents)))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Horizontal Rule
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-horizontal-rule (horizontal-rule contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an HORIZONTAL-RULE object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
"<hr/>")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Inline Src Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-inline-src-block (inline-src-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an INLINE-SRC-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(let* ((org-lang (org-element-property :language inline-src-block))
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(code (org-element-property :value inline-src-block)))
|
2013-02-22 04:28:25 -05:00
|
|
|
|
(error "Cannot export inline src block")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Inlinetask
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-section (text class &optional id)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(let ((extra (concat (when id (format " id=\"%s\"" id)))))
|
|
|
|
|
(concat (format "<div class=\"%s\"%s>\n" class extra) text "</div>\n")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-inlinetask (inlinetask contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an INLINETASK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(cond
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;; If `org-html-format-inlinetask-function' is provided, call it
|
2012-03-08 02:55:58 -05:00
|
|
|
|
;; with appropriate arguments.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((functionp org-html-format-inlinetask-function)
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(let ((format-function
|
|
|
|
|
(function*
|
|
|
|
|
(lambda (todo todo-type priority text tags
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
&key contents &allow-other-keys)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(funcall org-html-format-inlinetask-function
|
2012-03-08 02:55:58 -05:00
|
|
|
|
todo todo-type priority text tags contents)))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-headline--wrap
|
2012-03-08 02:55:58 -05:00
|
|
|
|
inlinetask info format-function :contents contents)))
|
|
|
|
|
;; Otherwise, use a default template.
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(t (format "<div class=\"inlinetask\">\n<b>%s</b><br/>\n%s</div>"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-headline--wrap inlinetask info)
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
contents))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Italic
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-italic (italic contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode ITALIC from Org to HTML.
|
|
|
|
|
CONTENTS is the text with italic markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format (or (cdr (assq 'italic org-html-text-markup-alist)) "%s") contents))
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Item
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-checkbox (checkbox)
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(case checkbox (on "<code>[X]</code>")
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(off "<code>[ ]</code>")
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(trans "<code>[-]</code>")
|
|
|
|
|
(t "")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-list-item (contents type checkbox
|
2012-02-20 11:28:44 -05:00
|
|
|
|
&optional term-counter-id
|
|
|
|
|
headline)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((checkbox (concat (org-html-checkbox checkbox) (and checkbox " "))))
|
2012-06-09 09:34:27 -04:00
|
|
|
|
(concat
|
|
|
|
|
(case type
|
|
|
|
|
(ordered
|
|
|
|
|
(let* ((counter term-counter-id)
|
|
|
|
|
(extra (if counter (format " value=\"%s\"" counter) "")))
|
2012-09-10 19:21:24 -04:00
|
|
|
|
(concat
|
|
|
|
|
(format "<li%s>" extra)
|
|
|
|
|
(when headline (concat headline "<br/>")))))
|
2012-06-09 09:34:27 -04:00
|
|
|
|
(unordered
|
|
|
|
|
(let* ((id term-counter-id)
|
|
|
|
|
(extra (if id (format " id=\"%s\"" id) "")))
|
|
|
|
|
(concat
|
|
|
|
|
(format "<li%s>" extra)
|
|
|
|
|
(when headline (concat headline "<br/>")))))
|
|
|
|
|
(descriptive
|
|
|
|
|
(let* ((term term-counter-id))
|
|
|
|
|
(setq term (or term "(no term)"))
|
|
|
|
|
;; Check-boxes in descriptive lists are associated to tag.
|
|
|
|
|
(concat (format "<dt> %s </dt>"
|
|
|
|
|
(concat checkbox term))
|
|
|
|
|
"<dd>"))))
|
|
|
|
|
(unless (eq type 'descriptive) checkbox)
|
|
|
|
|
contents
|
|
|
|
|
(case type
|
|
|
|
|
(ordered "</li>")
|
|
|
|
|
(unordered "</li>")
|
|
|
|
|
(descriptive "</dd>")))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-item (item contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode an ITEM element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
org-export: Rewrite topology functions
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent, org-export-get-parent-headline,
org-export-get-parent-table): Rewrite function to use :parent
property. Remove communication channel from signature.
(org-export-get-parent-element): Rename from
`org-export-get-parent-paragraph'.
(org-export-data, org-export-table-row-is-special-p)
org-export-table-row-group, org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p, org-export-table-cell-address,
org-export-first-sibling-p, org-export-last-sibling-p,
org-export-resolve-fuzzy-link, org-export-get-ordinal): Apply
signature change.
(org-export--skip-p, org-export-table-cell-width,
org-export-table-cell-alignment, org-export-table-cell-borders):
Refactor code. Apply signature change.
* contrib/lisp/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii--unique-links, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-paragraph, org-e-ascii-quote-section,
org-e-ascii-section, org-e-ascii--table-cell-width): Apply signature
change.
* contrib/lisp/org-e-html.el (org-e-html-link,
org-e-html-link--inline-image): Use new function and apply signature
change.
(org-e-html-item, org-e-html-standalone-image-p, org-e-html-paragraph,
org-e-html-section, org-e-html-table-cell, org-e-html-table-row,
org-e-html-footnote-reference): Apply signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-link--inline-image): Use
new function and apply signature change.
(org-e-latex-footnote-reference, org-e-latex-item,
org-e-latex-table-cell, org-e-latex-table-row): Apply signature
change.
* contrib/lisp/org-e-odt.el (org-e-odt-format-formula,
org-e-odt-format-label, org-e-odt-link--inline-image): Use new
function and apply signature change.
(org-e-odt-item, org-e-odt-standalone-image-p, org-e-odt-paragraph,
org-e-odt-plain-list, org-e-odt-table-style-spec,
org-e-odt-get-table-cell-styles, org-e-odt-table-cell,
org-e-odt-table-row, org-e-odt-table, org-e-odt-footnote-reference,
org-e-odt-enumerate-element): Apply signature change.
2012-06-08 15:00:47 -04:00
|
|
|
|
(let* ((plain-list (org-export-get-parent item))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(type (org-element-property :type plain-list))
|
|
|
|
|
(counter (org-element-property :counter item))
|
|
|
|
|
(checkbox (org-element-property :checkbox item))
|
|
|
|
|
(tag (let ((tag (org-element-property :tag item)))
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(and tag (org-export-data tag info)))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-list-item
|
2012-02-20 11:28:44 -05:00
|
|
|
|
contents type checkbox (or tag counter))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Keyword
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-keyword (keyword contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a KEYWORD element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(let ((key (org-element-property :key keyword))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(value (org-element-property :value keyword)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
2012-08-23 15:24:38 -04:00
|
|
|
|
((string= key "HTML") value)
|
2012-03-04 13:49:35 -05:00
|
|
|
|
;; Invisible targets.
|
2012-08-23 15:24:38 -04:00
|
|
|
|
((string= key "TARGET") nil)
|
2012-03-28 08:04:26 -04:00
|
|
|
|
((string= key "TOC")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(let ((value (downcase value)))
|
|
|
|
|
(cond
|
|
|
|
|
((string-match "\\<headlines\\>" value)
|
|
|
|
|
(let ((depth (or (and (string-match "[0-9]+" value)
|
|
|
|
|
(string-to-number (match-string 0 value)))
|
|
|
|
|
(plist-get info :with-toc))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-toc depth info)))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
((string= "listings" value) (org-html-list-of-listings info))
|
|
|
|
|
((string= "tables" value) (org-html-list-of-tables info))))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Latex Environment
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-format-latex (latex-frag processing-type)
|
2013-02-11 10:11:05 -05:00
|
|
|
|
"Format LaTeX fragments into HTML."
|
2013-02-12 02:38:31 -05:00
|
|
|
|
(let ((cache-relpath "") (cache-dir "") bfn)
|
2013-02-11 10:11:05 -05:00
|
|
|
|
(unless (eq processing-type 'mathjax)
|
|
|
|
|
(setq bfn (buffer-file-name)
|
|
|
|
|
cache-relpath
|
|
|
|
|
(concat "ltxpng/"
|
|
|
|
|
(file-name-sans-extension
|
|
|
|
|
(file-name-nondirectory bfn)))
|
|
|
|
|
cache-dir (file-name-directory bfn)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(insert latex-frag)
|
2013-02-08 13:49:25 -05:00
|
|
|
|
(org-format-latex cache-relpath cache-dir nil "Creating LaTeX Image..."
|
2012-02-18 01:52:31 -05:00
|
|
|
|
nil nil processing-type)
|
|
|
|
|
(buffer-string))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-latex-environment (latex-environment contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LATEX-ENVIRONMENT element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((processing-type (plist-get info :with-latex))
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(latex-frag (org-remove-indentation
|
|
|
|
|
(org-element-property :value latex-environment)))
|
|
|
|
|
(caption (org-export-data
|
|
|
|
|
(org-export-get-caption latex-environment) info))
|
|
|
|
|
(attr nil) ; FIXME
|
|
|
|
|
(label (org-element-property :name latex-environment)))
|
|
|
|
|
(cond
|
|
|
|
|
((memq processing-type '(t mathjax))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-latex latex-frag 'mathjax))
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
((eq processing-type 'dvipng)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let* ((formula-link (org-html-format-latex
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
latex-frag processing-type)))
|
|
|
|
|
(when (and formula-link
|
|
|
|
|
(string-match "file:\\([^]]*\\)" formula-link))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-inline-image
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(match-string 1 formula-link) caption label attr t))))
|
|
|
|
|
(t latex-frag))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Latex Fragment
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-latex-fragment (latex-fragment contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LATEX-FRAGMENT object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(let ((latex-frag (org-element-property :value latex-fragment))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(processing-type (plist-get info :with-latex)))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(case processing-type
|
|
|
|
|
((t mathjax)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-latex latex-frag 'mathjax))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(dvipng
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let* ((formula-link (org-html-format-latex
|
2012-03-06 12:57:33 -05:00
|
|
|
|
latex-frag processing-type)))
|
|
|
|
|
(when (and formula-link
|
|
|
|
|
(string-match "file:\\([^]]*\\)" formula-link))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-inline-image
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(match-string 1 formula-link)))))
|
|
|
|
|
(t latex-frag))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-12-09 06:18:22 -05:00
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Line Break
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-line-break (line-break contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LINE-BREAK object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-12-12 16:48:06 -05:00
|
|
|
|
"<br/>\n")
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Link
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-link--inline-image (link desc info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Return HTML code for an inline image.
|
|
|
|
|
LINK is the link pointing to the inline image. INFO is a plist
|
|
|
|
|
used as a communication channel."
|
2012-03-08 02:55:58 -05:00
|
|
|
|
(let* ((type (org-element-property :type link))
|
|
|
|
|
(raw-path (org-element-property :path link))
|
|
|
|
|
(path (cond ((member type '("http" "https"))
|
|
|
|
|
(concat type ":" raw-path))
|
|
|
|
|
((file-name-absolute-p raw-path)
|
|
|
|
|
(expand-file-name raw-path))
|
|
|
|
|
(t raw-path)))
|
org-export: Rewrite topology functions
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent, org-export-get-parent-headline,
org-export-get-parent-table): Rewrite function to use :parent
property. Remove communication channel from signature.
(org-export-get-parent-element): Rename from
`org-export-get-parent-paragraph'.
(org-export-data, org-export-table-row-is-special-p)
org-export-table-row-group, org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p, org-export-table-cell-address,
org-export-first-sibling-p, org-export-last-sibling-p,
org-export-resolve-fuzzy-link, org-export-get-ordinal): Apply
signature change.
(org-export--skip-p, org-export-table-cell-width,
org-export-table-cell-alignment, org-export-table-cell-borders):
Refactor code. Apply signature change.
* contrib/lisp/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii--unique-links, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-paragraph, org-e-ascii-quote-section,
org-e-ascii-section, org-e-ascii--table-cell-width): Apply signature
change.
* contrib/lisp/org-e-html.el (org-e-html-link,
org-e-html-link--inline-image): Use new function and apply signature
change.
(org-e-html-item, org-e-html-standalone-image-p, org-e-html-paragraph,
org-e-html-section, org-e-html-table-cell, org-e-html-table-row,
org-e-html-footnote-reference): Apply signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-link--inline-image): Use
new function and apply signature change.
(org-e-latex-footnote-reference, org-e-latex-item,
org-e-latex-table-cell, org-e-latex-table-row): Apply signature
change.
* contrib/lisp/org-e-odt.el (org-e-odt-format-formula,
org-e-odt-format-label, org-e-odt-link--inline-image): Use new
function and apply signature change.
(org-e-odt-item, org-e-odt-standalone-image-p, org-e-odt-paragraph,
org-e-odt-plain-list, org-e-odt-table-style-spec,
org-e-odt-get-table-cell-styles, org-e-odt-table-cell,
org-e-odt-table-row, org-e-odt-table, org-e-odt-footnote-reference,
org-e-odt-enumerate-element): Apply signature change.
2012-06-08 15:00:47 -04:00
|
|
|
|
(parent (org-export-get-parent-element link))
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(caption (org-export-data (org-export-get-caption parent) info))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(label (org-element-property :name parent))
|
2013-03-01 11:08:27 -05:00
|
|
|
|
(attr (mapconcat #'identity (org-element-property :attr_html parent) " ")))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Return proper string, depending on DISPOSITION.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-format-inline-image
|
|
|
|
|
path caption label attr (org-html-standalone-image-p link info))))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defvar org-html-standalone-image-predicate)
|
|
|
|
|
(defun org-html-standalone-image-p (element info &optional predicate)
|
2012-03-06 12:57:33 -05:00
|
|
|
|
"Test if ELEMENT is a standalone image for the purpose HTML export.
|
|
|
|
|
INFO is a plist holding contextual information.
|
|
|
|
|
|
|
|
|
|
Return non-nil, if ELEMENT is of type paragraph and it's sole
|
|
|
|
|
content, save for whitespaces, is a link that qualifies as an
|
|
|
|
|
inline image.
|
|
|
|
|
|
|
|
|
|
Return non-nil, if ELEMENT is of type link and it's containing
|
|
|
|
|
paragraph has no other content save for leading and trailing
|
|
|
|
|
whitespaces.
|
|
|
|
|
|
|
|
|
|
Return nil, otherwise.
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
Bind `org-html-standalone-image-predicate' to constrain
|
2012-03-06 12:57:33 -05:00
|
|
|
|
paragraph further. For example, to check for only captioned
|
|
|
|
|
standalone images, do the following.
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
\(setq org-html-standalone-image-predicate
|
2012-03-06 12:57:33 -05:00
|
|
|
|
\(lambda \(paragraph\)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
\(org-element-property :caption paragraph\)\)\)"
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(let ((paragraph (case (org-element-type element)
|
|
|
|
|
(paragraph element)
|
|
|
|
|
(link (and (org-export-inline-image-p
|
2013-01-27 17:11:34 -05:00
|
|
|
|
element org-html-inline-image-rules)
|
org-export: Rewrite topology functions
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent, org-export-get-parent-headline,
org-export-get-parent-table): Rewrite function to use :parent
property. Remove communication channel from signature.
(org-export-get-parent-element): Rename from
`org-export-get-parent-paragraph'.
(org-export-data, org-export-table-row-is-special-p)
org-export-table-row-group, org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p, org-export-table-cell-address,
org-export-first-sibling-p, org-export-last-sibling-p,
org-export-resolve-fuzzy-link, org-export-get-ordinal): Apply
signature change.
(org-export--skip-p, org-export-table-cell-width,
org-export-table-cell-alignment, org-export-table-cell-borders):
Refactor code. Apply signature change.
* contrib/lisp/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii--unique-links, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-paragraph, org-e-ascii-quote-section,
org-e-ascii-section, org-e-ascii--table-cell-width): Apply signature
change.
* contrib/lisp/org-e-html.el (org-e-html-link,
org-e-html-link--inline-image): Use new function and apply signature
change.
(org-e-html-item, org-e-html-standalone-image-p, org-e-html-paragraph,
org-e-html-section, org-e-html-table-cell, org-e-html-table-row,
org-e-html-footnote-reference): Apply signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-link--inline-image): Use
new function and apply signature change.
(org-e-latex-footnote-reference, org-e-latex-item,
org-e-latex-table-cell, org-e-latex-table-row): Apply signature
change.
* contrib/lisp/org-e-odt.el (org-e-odt-format-formula,
org-e-odt-format-label, org-e-odt-link--inline-image): Use new
function and apply signature change.
(org-e-odt-item, org-e-odt-standalone-image-p, org-e-odt-paragraph,
org-e-odt-plain-list, org-e-odt-table-style-spec,
org-e-odt-get-table-cell-styles, org-e-odt-table-cell,
org-e-odt-table-row, org-e-odt-table, org-e-odt-footnote-reference,
org-e-odt-enumerate-element): Apply signature change.
2012-06-08 15:00:47 -04:00
|
|
|
|
(org-export-get-parent element)))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(t nil))))
|
2012-11-07 13:13:43 -05:00
|
|
|
|
(when (eq (org-element-type paragraph) 'paragraph)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(when (or (not (and (boundp 'org-html-standalone-image-predicate)
|
|
|
|
|
(functionp org-html-standalone-image-predicate)))
|
|
|
|
|
(funcall org-html-standalone-image-predicate paragraph))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(let ((contents (org-element-contents paragraph)))
|
|
|
|
|
(loop for x in contents
|
|
|
|
|
with inline-image-count = 0
|
|
|
|
|
always (cond
|
|
|
|
|
((eq (org-element-type x) 'plain-text)
|
|
|
|
|
(not (org-string-nw-p x)))
|
|
|
|
|
((eq (org-element-type x) 'link)
|
|
|
|
|
(when (org-export-inline-image-p
|
2013-01-27 17:11:34 -05:00
|
|
|
|
x org-html-inline-image-rules)
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(= (incf inline-image-count) 1)))
|
|
|
|
|
(t nil))))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-link (link desc info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a LINK object from Org to HTML.
|
|
|
|
|
|
|
|
|
|
DESC is the description part of the link, or the empty string.
|
|
|
|
|
INFO is a plist holding contextual information. See
|
|
|
|
|
`org-export-data'."
|
2012-07-07 09:54:53 -04:00
|
|
|
|
(let* ((--link-org-files-as-html-maybe
|
|
|
|
|
(function
|
|
|
|
|
(lambda (raw-path info)
|
|
|
|
|
"Treat links to `file.org' as links to `file.html', if needed.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
See `org-html-link-org-files-as-html'."
|
2012-07-07 09:54:53 -04:00
|
|
|
|
(cond
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((and org-html-link-org-files-as-html
|
2012-07-07 09:54:53 -04:00
|
|
|
|
(string= ".org"
|
|
|
|
|
(downcase (file-name-extension raw-path "."))))
|
|
|
|
|
(concat (file-name-sans-extension raw-path) "."
|
|
|
|
|
(plist-get info :html-extension)))
|
|
|
|
|
(t raw-path)))))
|
|
|
|
|
(type (org-element-property :type link))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(raw-path (org-element-property :path link))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Ensure DESC really exists, or set it to nil.
|
|
|
|
|
(desc (and (not (string= desc "")) desc))
|
2013-02-22 18:03:22 -05:00
|
|
|
|
(path
|
|
|
|
|
(cond
|
|
|
|
|
((member type '("http" "https" "ftp" "mailto"))
|
|
|
|
|
(concat type ":" raw-path))
|
|
|
|
|
((string= type "file")
|
|
|
|
|
;; Treat links to ".org" files as ".html", if needed.
|
|
|
|
|
(setq raw-path
|
|
|
|
|
(funcall --link-org-files-as-html-maybe raw-path info))
|
|
|
|
|
;; If file path is absolute, prepend it with protocol
|
|
|
|
|
;; component - "file://".
|
|
|
|
|
(when (file-name-absolute-p raw-path)
|
|
|
|
|
(setq raw-path
|
|
|
|
|
(concat "file://" (expand-file-name raw-path))))
|
|
|
|
|
;; Add search option, if any. A search option can be
|
|
|
|
|
;; relative to a custom-id or a headline title. Any other
|
|
|
|
|
;; option is ignored.
|
|
|
|
|
(let ((option (org-element-property :search-option link)))
|
|
|
|
|
(cond ((not option) raw-path)
|
|
|
|
|
((eq (aref option 0) ?#) (concat raw-path option))
|
|
|
|
|
;; External fuzzy link: try to resolve it if path
|
|
|
|
|
;; belongs to current project, if any.
|
|
|
|
|
((eq (aref option 0) ?*)
|
|
|
|
|
(concat
|
|
|
|
|
raw-path
|
|
|
|
|
(let ((numbers
|
|
|
|
|
(org-publish-resolve-external-fuzzy-link
|
|
|
|
|
(org-element-property :path link) option)))
|
|
|
|
|
(and numbers (concat "#sec-"
|
|
|
|
|
(mapconcat 'number-to-string
|
|
|
|
|
numbers "-")))))))))
|
|
|
|
|
(t raw-path)))
|
2013-01-31 04:44:15 -05:00
|
|
|
|
attributes protocol)
|
2013-02-25 08:28:55 -05:00
|
|
|
|
;; Extract attributes from parent's paragraph. HACK: Only do this
|
|
|
|
|
;; for the first link in parent. This is needed as long as
|
|
|
|
|
;; attributes cannot be set on a per link basis.
|
2013-01-31 04:44:15 -05:00
|
|
|
|
(and (setq attributes
|
2013-02-25 08:28:55 -05:00
|
|
|
|
(let ((parent (org-export-get-parent-element link)))
|
|
|
|
|
(if (not (eq (org-element-map parent 'link 'identity info t)
|
|
|
|
|
link))
|
|
|
|
|
""
|
|
|
|
|
(mapconcat
|
|
|
|
|
'identity
|
|
|
|
|
(let ((att (org-element-property :attr_html parent)))
|
|
|
|
|
(unless (and desc att
|
|
|
|
|
(string-match (regexp-quote (car att)) desc))
|
|
|
|
|
att))
|
|
|
|
|
" "))))
|
2013-03-02 03:45:26 -05:00
|
|
|
|
(unless (string= attributes "")
|
|
|
|
|
(setq attributes (concat " " attributes))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
|
|
|
|
;; Image file.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((and (or (eq t org-html-inline-images)
|
|
|
|
|
(and org-html-inline-images (not desc)))
|
|
|
|
|
(org-export-inline-image-p link org-html-inline-image-rules))
|
|
|
|
|
(org-html-link--inline-image link desc info))
|
2012-05-18 15:06:12 -04:00
|
|
|
|
;; Radio target: Transcode target's contents and use them as
|
|
|
|
|
;; link's description.
|
2012-03-04 13:49:35 -05:00
|
|
|
|
((string= type "radio")
|
2012-05-18 05:20:00 -04:00
|
|
|
|
(let ((destination (org-export-resolve-radio-link link info)))
|
|
|
|
|
(when destination
|
2012-06-08 09:25:29 -04:00
|
|
|
|
(format "<a href=\"#%s\"%s>%s</a>"
|
2012-05-18 05:20:00 -04:00
|
|
|
|
(org-export-solidify-link-text path)
|
2012-06-08 09:25:29 -04:00
|
|
|
|
attributes
|
2012-05-18 05:20:00 -04:00
|
|
|
|
(org-export-data (org-element-contents destination) info)))))
|
2013-02-23 07:47:44 -05:00
|
|
|
|
;; Links pointing to a headline: Find destination and build
|
2012-03-04 13:49:35 -05:00
|
|
|
|
;; appropriate referencing command.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
((member type '("custom-id" "fuzzy" "id"))
|
|
|
|
|
(let ((destination (if (string= type "fuzzy")
|
|
|
|
|
(org-export-resolve-fuzzy-link link info)
|
|
|
|
|
(org-export-resolve-id-link link info))))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(case (org-element-type destination)
|
2012-07-07 09:54:53 -04:00
|
|
|
|
;; ID link points to an external file.
|
|
|
|
|
(plain-text
|
|
|
|
|
(let ((fragment (concat "ID-" path))
|
|
|
|
|
;; Treat links to ".org" files as ".html", if needed.
|
|
|
|
|
(path (funcall --link-org-files-as-html-maybe
|
|
|
|
|
destination info)))
|
|
|
|
|
(format "<a href=\"%s#%s\"%s>%s</a>"
|
|
|
|
|
path fragment attributes (or desc destination))))
|
2012-03-04 13:49:35 -05:00
|
|
|
|
;; Fuzzy link points nowhere.
|
2012-06-01 19:42:00 -04:00
|
|
|
|
((nil)
|
2012-03-04 13:49:35 -05:00
|
|
|
|
(format "<i>%s</i>"
|
org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html-footnote-section, org-e-html-template,
org-e-html-dynamic-block, org-e-html-format-headline--wrap,
org-e-html-headline, org-e-html-item, org-e-html-link,
org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-dynamic-block,
org-e-latex-footnote-reference, org-e-latex-headline,
org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-write-manifest-file,
org-e-odt--caption/label-string, org-e-odt-dynamic-block,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.
Back-end can be found in communication channel with (plist-get
info :back-end). Hence back-ends do not have to hard-code their name
in any transcoder. It will allow to derive a back-end from another
one.
2012-04-28 05:33:16 -04:00
|
|
|
|
(or desc
|
org-export: Secondary strings are transcoded with `org-export-data'
* contrib/lisp/org-export.el (org-export-transcoder): New function.
(org-export-data): Also export secondary strings. Refactored.
(org-export-secondary-string): Remove function.
(org-export-expand): Fix code indentation.
(org-export-expand-macro): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-link, org-e-ascii-quote-section,
org-e-ascii--table-cell-width): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html--caption/label-string, org-e-html-meta-info,
org-e-html-preamble, org-e-html-template,
org-e-html-format-headline--wrap, org-e-html-headline,
org-e-html-item, org-e-html-link): Use `org-export-data' instead of
`org-export-secondary-string'.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-footnote-reference,
org-e-latex-headline, org-e-latex-inlinetask, org-e-latex-item,
org-e-latex-link, org-e-latex-src-block): Use `org-export-data'
instead of `org-export-secondary-string'.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-update-meta-file,
org-e-odt--caption/label-string, org-e-odt-footnote-def,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block):
Use `org-export-data' instead of `org-export-secondary-string'.
2012-04-29 20:04:03 -04:00
|
|
|
|
(org-export-data
|
org-export: Remove unnecessary back-end arguments
* contrib/lisp/org-e-ascii.el (org-e-ascii--build-title,
org-e-ascii--build-caption, org-e-ascii--list-listings,
org-e-ascii--list-tables, org-e-ascii--describe-links,
org-e-ascii-template--document-title, org-e-ascii-dynamic-block,
org-e-ascii-inlinetask, org-e-ascii-item, org-e-ascii-link,
org-e-ascii-quote-section, org-e-ascii--table-cell-width): Do not
provide back-end symbol.
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html-footnote-section, org-e-html-template,
org-e-html-dynamic-block, org-e-html-format-headline--wrap,
org-e-html-headline, org-e-html-item, org-e-html-link,
org-e-html-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-e-latex.el (org-e-latex--caption/label-string,
org-e-latex-template, org-e-latex-dynamic-block,
org-e-latex-footnote-reference, org-e-latex-headline,
org-e-latex-inlinetask, org-e-latex-item, org-e-latex-link,
org-e-latex-src-block): Do not provide back-end symbol.
* contrib/lisp/org-e-odt.el (org-e-odt-format-preamble,
org-e-odt-format-label, org-e-odt-write-manifest-file,
org-e-odt--caption/label-string, org-e-odt-dynamic-block,
org-e-odt-format-headline--wrap, org-e-odt-headline, org-e-odt-item,
org-e-odt-latex-environment, org-e-odt-link, org-e-odt-src-block,
org-e-odt-time-stamp): Do not provide back-end symbol.
* contrib/lisp/org-export.el (org-export-get-environment): Provide
back-end symbol under `:back-end' property.
(org-export-collect-tree-properties, org-export-data,
org-export-filter-verbatim-functions, org-export-install-filters,
org-export-as, org-export-expand-macro,
org-export-filter-apply-functions, org-export-secondary-string):
Remove back-end references.
* testing/lisp/test-org-export.el: Update tests.
Back-end can be found in communication channel with (plist-get
info :back-end). Hence back-ends do not have to hard-code their name
in any transcoder. It will allow to derive a back-end from another
one.
2012-04-28 05:33:16 -04:00
|
|
|
|
(org-element-property :raw-link link) info))))
|
2012-03-04 13:49:35 -05:00
|
|
|
|
;; Fuzzy link points to an invisible target.
|
|
|
|
|
(keyword nil)
|
2013-02-23 07:47:44 -05:00
|
|
|
|
;; Link points to a headline.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(headline
|
2012-06-01 19:42:00 -04:00
|
|
|
|
(let ((href
|
|
|
|
|
;; What href to use?
|
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: Headline is linked via it's CUSTOM_ID
|
|
|
|
|
;; property. Use CUSTOM_ID.
|
|
|
|
|
((string= type "custom-id")
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 18:01:21 -05:00
|
|
|
|
(org-element-property :CUSTOM_ID destination))
|
2012-06-01 19:42:00 -04:00
|
|
|
|
;; Case 2: Headline is linked via it's ID property
|
|
|
|
|
;; or through other means. Use the default href.
|
|
|
|
|
((member type '("id" "fuzzy"))
|
|
|
|
|
(format "sec-%s"
|
|
|
|
|
(mapconcat 'number-to-string
|
|
|
|
|
(org-export-get-headline-number
|
|
|
|
|
destination info) "-")))
|
|
|
|
|
(t (error "Shouldn't reach here"))))
|
2012-07-07 05:40:42 -04:00
|
|
|
|
;; What description to use?
|
2012-06-01 19:42:00 -04:00
|
|
|
|
(desc
|
2012-07-07 05:40:42 -04:00
|
|
|
|
;; Case 1: Headline is numbered and LINK has no
|
|
|
|
|
;; description or LINK's description matches
|
|
|
|
|
;; headline's title. Display section number.
|
|
|
|
|
(if (and (org-export-numbered-headline-p destination info)
|
|
|
|
|
(or (not desc)
|
|
|
|
|
(string= desc (org-element-property
|
|
|
|
|
:raw-value destination))))
|
|
|
|
|
(mapconcat 'number-to-string
|
|
|
|
|
(org-export-get-headline-number
|
|
|
|
|
destination info) ".")
|
|
|
|
|
;; Case 2: Either the headline is un-numbered or
|
|
|
|
|
;; LINK has a custom description. Display LINK's
|
|
|
|
|
;; description or headline's title.
|
|
|
|
|
(or desc (org-export-data (org-element-property
|
|
|
|
|
:title destination) info)))))
|
2012-06-08 09:25:29 -04:00
|
|
|
|
(format "<a href=\"#%s\"%s>%s</a>"
|
2012-07-12 17:53:57 -04:00
|
|
|
|
(org-export-solidify-link-text href) attributes desc)))
|
2012-07-07 09:54:53 -04:00
|
|
|
|
;; Fuzzy link points to a target. Do as above.
|
2012-06-01 19:42:00 -04:00
|
|
|
|
(t
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(let ((path (org-export-solidify-link-text path)) number)
|
2012-03-04 13:49:35 -05:00
|
|
|
|
(unless desc
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(setq number (cond
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((org-html-standalone-image-p destination info)
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(org-export-get-ordinal
|
|
|
|
|
(assoc 'link (org-element-contents destination))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
info 'link 'org-html-standalone-image-p))
|
2012-03-06 12:57:33 -05:00
|
|
|
|
(t (org-export-get-ordinal destination info))))
|
|
|
|
|
(setq desc (when number
|
|
|
|
|
(if (atom number) (number-to-string number)
|
|
|
|
|
(mapconcat 'number-to-string number ".")))))
|
2012-06-08 09:25:29 -04:00
|
|
|
|
(format "<a href=\"#%s\"%s>%s</a>"
|
2013-02-22 04:28:25 -05:00
|
|
|
|
path attributes (or desc "No description for this link")))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Coderef: replace link with the reference name or the
|
|
|
|
|
;; equivalent line number.
|
|
|
|
|
((string= type "coderef")
|
2012-03-02 02:40:12 -05:00
|
|
|
|
(let ((fragment (concat "coderef-" path)))
|
2013-03-01 11:08:27 -05:00
|
|
|
|
(format "<a href=\"#%s\"%s%s>%s</a>"
|
2012-06-08 09:25:29 -04:00
|
|
|
|
fragment
|
2013-03-01 11:08:27 -05:00
|
|
|
|
(org-trim
|
|
|
|
|
(format (concat "class=\"coderef\""
|
|
|
|
|
" onmouseover=\"CodeHighlightOn(this, '%s');\""
|
|
|
|
|
" onmouseout=\"CodeHighlightOff(this, '%s');\"")
|
|
|
|
|
fragment fragment))
|
2012-06-08 09:25:29 -04:00
|
|
|
|
attributes
|
2012-04-25 16:07:37 -04:00
|
|
|
|
(format (org-export-get-coderef-format path desc)
|
2012-03-02 02:40:12 -05:00
|
|
|
|
(org-export-resolve-coderef path info)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; Link type is handled by a special function.
|
|
|
|
|
((functionp (setq protocol (nth 2 (assoc type org-link-protocols))))
|
|
|
|
|
(funcall protocol (org-link-unescape path) desc 'html))
|
|
|
|
|
;; External link with a description part.
|
2012-06-08 09:25:29 -04:00
|
|
|
|
((and path desc) (format "<a href=\"%s\"%s>%s</a>" path attributes desc))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; External link without a description part.
|
2012-06-08 09:25:29 -04:00
|
|
|
|
(path (format "<a href=\"%s\"%s>%s</a>" path attributes path))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;; No path, only description. Try to do something useful.
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(t (format "<i>%s</i>" desc)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Paragraph
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-paragraph (paragraph contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a PARAGRAPH element from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the paragraph, as a string. INFO is
|
|
|
|
|
the plist used as a communication channel."
|
|
|
|
|
(let* ((style nil) ; FIXME
|
|
|
|
|
(class (cdr (assoc style '((footnote . "footnote")
|
|
|
|
|
(verse . nil)))))
|
|
|
|
|
(extra (if class (format " class=\"%s\"" class) ""))
|
org-export: Rewrite topology functions
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent, org-export-get-parent-headline,
org-export-get-parent-table): Rewrite function to use :parent
property. Remove communication channel from signature.
(org-export-get-parent-element): Rename from
`org-export-get-parent-paragraph'.
(org-export-data, org-export-table-row-is-special-p)
org-export-table-row-group, org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p, org-export-table-cell-address,
org-export-first-sibling-p, org-export-last-sibling-p,
org-export-resolve-fuzzy-link, org-export-get-ordinal): Apply
signature change.
(org-export--skip-p, org-export-table-cell-width,
org-export-table-cell-alignment, org-export-table-cell-borders):
Refactor code. Apply signature change.
* contrib/lisp/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii--unique-links, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-paragraph, org-e-ascii-quote-section,
org-e-ascii-section, org-e-ascii--table-cell-width): Apply signature
change.
* contrib/lisp/org-e-html.el (org-e-html-link,
org-e-html-link--inline-image): Use new function and apply signature
change.
(org-e-html-item, org-e-html-standalone-image-p, org-e-html-paragraph,
org-e-html-section, org-e-html-table-cell, org-e-html-table-row,
org-e-html-footnote-reference): Apply signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-link--inline-image): Use
new function and apply signature change.
(org-e-latex-footnote-reference, org-e-latex-item,
org-e-latex-table-cell, org-e-latex-table-row): Apply signature
change.
* contrib/lisp/org-e-odt.el (org-e-odt-format-formula,
org-e-odt-format-label, org-e-odt-link--inline-image): Use new
function and apply signature change.
(org-e-odt-item, org-e-odt-standalone-image-p, org-e-odt-paragraph,
org-e-odt-plain-list, org-e-odt-table-style-spec,
org-e-odt-get-table-cell-styles, org-e-odt-table-cell,
org-e-odt-table-row, org-e-odt-table, org-e-odt-footnote-reference,
org-e-odt-enumerate-element): Apply signature change.
2012-06-08 15:00:47 -04:00
|
|
|
|
(parent (org-export-get-parent paragraph)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
org-export: Use `eq' instead of `equal' when possible
* contrib/lisp/org-export.el (org-export-data,
org-export-footnote-first-reference-p,
org-export-get-footnote-number, org-export-get-ordinal,
org-export-get-loc, org-export-table-row-group,
org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-cell-address): Use `eq' instead of `equal' when
possible.
* contrib/lisp/org-e-ascii.el (org-e-ascii-table-row):
* contrib/lisp/org-e-beamer.el (org-e-beamer-select-environment):
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html-latex-environment, org-e-html-paragraph): Use `eq'
instead of `equal' when possible.
* contrib/lisp/org-e-latex.el (org-e-latex--get-footnote-counter):
* contrib/lisp/org-e-odt.el (org-e-odt-do-format-code,
org-e-odt-footnote-def, org-e-odt-item, org-e-odt-latex-environment,
org-e-odt-latex-fragment, org-e-odt-plain-list, org-e-odt-table,
org-e-odt-enumerate-element): Use `eq' instead of `equal' when
possible.
In particular, comparing elements shouldn't be done with `equal' since
they are circular lists. On the other hand, using `eq' is fine if
they belong to the same tree.
2012-07-16 10:19:56 -04:00
|
|
|
|
((and (eq (org-element-type parent) 'item)
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(= (org-element-property :begin paragraph)
|
|
|
|
|
(org-element-property :contents-begin parent)))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
;; leading paragraph in a list item have no tags
|
2012-02-18 01:52:31 -05:00
|
|
|
|
contents)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
((org-html-standalone-image-p paragraph info)
|
2012-03-06 12:57:33 -05:00
|
|
|
|
;; standalone image
|
|
|
|
|
contents)
|
2012-06-09 07:19:24 -04:00
|
|
|
|
(t (format "<p%s>\n%s</p>" extra contents)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Plain List
|
|
|
|
|
|
2013-02-22 04:28:25 -05:00
|
|
|
|
;; FIXME Maybe arg1 is not needed because <li value="20"> already sets
|
|
|
|
|
;; the correct value for the item counter
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-begin-plain-list (type &optional arg1)
|
2013-02-22 04:28:25 -05:00
|
|
|
|
"Insert the beginning of the HTML list depending on TYPE.
|
|
|
|
|
When ARG1 is a string, use it as the start parameter for ordered
|
|
|
|
|
lists."
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(case type
|
|
|
|
|
(ordered
|
2013-02-22 04:28:25 -05:00
|
|
|
|
(format "<ol class=\"org-ol\"%s>"
|
|
|
|
|
(if arg1 (format " start=\"%d\"" arg1) "")))
|
2012-12-18 12:38:20 -05:00
|
|
|
|
(unordered "<ul class=\"org-ul\">")
|
|
|
|
|
(descriptive "<dl class=\"org-dl\">")))
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-end-plain-list (type)
|
2013-02-22 04:28:25 -05:00
|
|
|
|
"Insert the end of the HTML list depending on TYPE."
|
2012-02-20 11:28:44 -05:00
|
|
|
|
(case type
|
|
|
|
|
(ordered "</ol>")
|
|
|
|
|
(unordered "</ul>")
|
|
|
|
|
(descriptive "</dl>")))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-plain-list (plain-list contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a PLAIN-LIST element from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the list. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2013-02-22 04:28:25 -05:00
|
|
|
|
(let* (arg1 ;; (assoc :counter (org-element-map plain-list 'item
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(type (org-element-property :type plain-list)))
|
|
|
|
|
(format "%s\n%s%s"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html-begin-plain-list type)
|
|
|
|
|
contents (org-html-end-plain-list type))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Plain Text
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-convert-special-strings (string)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Convert special characters in STRING to HTML."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((all org-html-special-string-regexps)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
e a re rpl start)
|
|
|
|
|
(while (setq a (pop all))
|
|
|
|
|
(setq re (car a) rpl (cdr a) start 0)
|
|
|
|
|
(while (string-match re string start)
|
|
|
|
|
(setq string (replace-match rpl t nil string))))
|
|
|
|
|
string))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-encode-plain-text (text)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Convert plain text characters to HTML equivalent.
|
|
|
|
|
Possible conversions are set in `org-export-html-protect-char-alist'."
|
2012-07-12 17:53:57 -04:00
|
|
|
|
(mapc
|
|
|
|
|
(lambda (pair)
|
|
|
|
|
(setq text (replace-regexp-in-string (car pair) (cdr pair) text t t)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
org-html-protect-char-alist)
|
2012-07-12 17:53:57 -04:00
|
|
|
|
text)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-plain-text (text info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a TEXT string from Org to HTML.
|
|
|
|
|
TEXT is the string to transcode. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-10-26 18:36:00 -04:00
|
|
|
|
(let ((output text))
|
|
|
|
|
;; Protect following characters: <, >, &.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(setq output (org-html-encode-plain-text output))
|
2012-10-26 18:36:00 -04:00
|
|
|
|
;; Handle smart quotes. Be sure to provide original string since
|
|
|
|
|
;; OUTPUT may have been modified.
|
|
|
|
|
(when (plist-get info :with-smart-quotes)
|
|
|
|
|
(setq output (org-export-activate-smart-quotes output :html info text)))
|
|
|
|
|
;; Handle special strings.
|
|
|
|
|
(when (plist-get info :with-special-strings)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(setq output (org-html-convert-special-strings output)))
|
2012-10-26 18:36:00 -04:00
|
|
|
|
;; Handle break preservation if required.
|
|
|
|
|
(when (plist-get info :preserve-breaks)
|
|
|
|
|
(setq output
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"\\(\\\\\\\\\\)?[ \t]*\n" "<br/>\n" output)))
|
|
|
|
|
;; Return value.
|
|
|
|
|
output))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-04-28 20:11:22 -04:00
|
|
|
|
;; Planning
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-planning (planning contents info)
|
2012-04-28 20:11:22 -04:00
|
|
|
|
"Transcode a PLANNING element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
|
|
|
|
(let ((span-fmt "<span class=\"timestamp-kwd\">%s</span> <span class=\"timestamp\">%s</span>"))
|
|
|
|
|
(format
|
|
|
|
|
"<p><span class=\"timestamp-wrapper\">%s</span></p>"
|
|
|
|
|
(mapconcat
|
|
|
|
|
'identity
|
|
|
|
|
(delq nil
|
|
|
|
|
(list
|
|
|
|
|
(let ((closed (org-element-property :closed planning)))
|
|
|
|
|
(when closed
|
|
|
|
|
(format span-fmt org-closed-string
|
2012-10-30 16:59:50 -04:00
|
|
|
|
(org-translate-time
|
|
|
|
|
(org-element-property :raw-value closed)))))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
(let ((deadline (org-element-property :deadline planning)))
|
|
|
|
|
(when deadline
|
|
|
|
|
(format span-fmt org-deadline-string
|
2012-10-30 16:59:50 -04:00
|
|
|
|
(org-translate-time
|
|
|
|
|
(org-element-property :raw-value deadline)))))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
(let ((scheduled (org-element-property :scheduled planning)))
|
|
|
|
|
(when scheduled
|
|
|
|
|
(format span-fmt org-scheduled-string
|
2012-10-30 16:59:50 -04:00
|
|
|
|
(org-translate-time
|
|
|
|
|
(org-element-property :raw-value scheduled)))))))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
" "))))
|
|
|
|
|
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Property Drawer
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-property-drawer (property-drawer contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a PROPERTY-DRAWER element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
;; The property drawer isn't exported but we want separating blank
|
|
|
|
|
;; lines nonetheless.
|
|
|
|
|
"")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Quote Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-quote-block (quote-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a QUOTE-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(format "<blockquote>\n%s</blockquote>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Quote Section
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-quote-section (quote-section contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a QUOTE-SECTION element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(let ((value (org-remove-indentation
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(org-element-property :value quote-section))))
|
2012-02-18 11:59:42 -05:00
|
|
|
|
(when value (format "<pre>\n%s</pre>" value))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Section
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-section (section contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SECTION element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the section. INFO is a plist
|
|
|
|
|
holding contextual information."
|
org-export: Rewrite topology functions
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent, org-export-get-parent-headline,
org-export-get-parent-table): Rewrite function to use :parent
property. Remove communication channel from signature.
(org-export-get-parent-element): Rename from
`org-export-get-parent-paragraph'.
(org-export-data, org-export-table-row-is-special-p)
org-export-table-row-group, org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p, org-export-table-cell-address,
org-export-first-sibling-p, org-export-last-sibling-p,
org-export-resolve-fuzzy-link, org-export-get-ordinal): Apply
signature change.
(org-export--skip-p, org-export-table-cell-width,
org-export-table-cell-alignment, org-export-table-cell-borders):
Refactor code. Apply signature change.
* contrib/lisp/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii--unique-links, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-paragraph, org-e-ascii-quote-section,
org-e-ascii-section, org-e-ascii--table-cell-width): Apply signature
change.
* contrib/lisp/org-e-html.el (org-e-html-link,
org-e-html-link--inline-image): Use new function and apply signature
change.
(org-e-html-item, org-e-html-standalone-image-p, org-e-html-paragraph,
org-e-html-section, org-e-html-table-cell, org-e-html-table-row,
org-e-html-footnote-reference): Apply signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-link--inline-image): Use
new function and apply signature change.
(org-e-latex-footnote-reference, org-e-latex-item,
org-e-latex-table-cell, org-e-latex-table-row): Apply signature
change.
* contrib/lisp/org-e-odt.el (org-e-odt-format-formula,
org-e-odt-format-label, org-e-odt-link--inline-image): Use new
function and apply signature change.
(org-e-odt-item, org-e-odt-standalone-image-p, org-e-odt-paragraph,
org-e-odt-plain-list, org-e-odt-table-style-spec,
org-e-odt-get-table-cell-styles, org-e-odt-table-cell,
org-e-odt-table-row, org-e-odt-table, org-e-odt-footnote-reference,
org-e-odt-enumerate-element): Apply signature change.
2012-06-08 15:00:47 -04:00
|
|
|
|
(let ((parent (org-export-get-parent-headline section)))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
;; Before first headline: no container, just return CONTENTS.
|
|
|
|
|
(if (not parent) contents
|
|
|
|
|
;; Get div's class and id references.
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(let* ((class-num (+ (org-export-get-relative-level parent info)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(1- org-html-toplevel-hlevel)))
|
2012-05-30 17:26:59 -04:00
|
|
|
|
(section-number
|
|
|
|
|
(mapconcat
|
|
|
|
|
'number-to-string
|
2012-07-07 09:54:53 -04:00
|
|
|
|
(org-export-get-headline-number parent info) "-")))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
;; Build return value.
|
2013-03-01 08:22:09 -05:00
|
|
|
|
(format "<div class=\"outline-text-%d\" id=\"text-%s\">\n%s</div>"
|
|
|
|
|
class-num
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 18:01:21 -05:00
|
|
|
|
(or (org-element-property :CUSTOM_ID parent) section-number)
|
2012-05-30 17:26:59 -04:00
|
|
|
|
contents)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
;;;; Radio Target
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-radio-target (radio-target text info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a RADIO-TARGET object from Org to HTML.
|
|
|
|
|
TEXT is the text of the target. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(let ((id (org-export-solidify-link-text
|
2012-03-28 08:06:39 -04:00
|
|
|
|
(org-element-property :value radio-target))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--anchor id text)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Special Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-special-block (special-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SPECIAL-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(format "<div class=\"%s\">\n%s\n</div>"
|
|
|
|
|
(downcase (org-element-property :type special-block))
|
|
|
|
|
contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Src Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-src-block (src-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SRC-BLOCK element from Org to HTML.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-12-09 06:16:37 -05:00
|
|
|
|
(if (org-export-read-attribute :attr_html src-block :textarea)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--textarea-block src-block)
|
2012-12-09 06:16:37 -05:00
|
|
|
|
(let ((lang (org-element-property :language src-block))
|
|
|
|
|
(caption (org-export-get-caption src-block))
|
2013-02-24 09:57:46 -05:00
|
|
|
|
(code (org-html-format-code src-block info))
|
|
|
|
|
(label (let ((lbl (org-element-property :name src-block)))
|
|
|
|
|
(if (not lbl) ""
|
|
|
|
|
(format " id=\"%s\""
|
|
|
|
|
(org-export-solidify-link-text lbl))))))
|
|
|
|
|
(if (not lang) (format "<pre class=\"example\"%s>\n%s</pre>" label code)
|
|
|
|
|
(format
|
|
|
|
|
"<div class=\"org-src-container\">\n%s%s\n</div>"
|
|
|
|
|
(if (not caption) ""
|
|
|
|
|
(format "<label class=\"org-src-name\">%s</label>"
|
|
|
|
|
(org-export-data caption info)))
|
|
|
|
|
(format "\n<pre class=\"src src-%s\"%s>%s</pre>" lang label code))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Statistics Cookie
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-statistics-cookie (statistics-cookie contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a STATISTICS-COOKIE object from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(let ((cookie-value (org-element-property :value statistics-cookie)))
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(format "<code>%s</code>" cookie-value)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Strike-Through
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-strike-through (strike-through contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode STRIKE-THROUGH from Org to HTML.
|
|
|
|
|
CONTENTS is the text with strike-through markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format (or (cdr (assq 'strike-through org-html-text-markup-alist)) "%s")
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
contents))
|
|
|
|
|
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Subscript
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-subscript (subscript contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SUBSCRIPT object from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-28 02:39:10 -05:00
|
|
|
|
(format "<sub>%s</sub>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Superscript
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-superscript (superscript contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a SUPERSCRIPT object from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-28 02:39:10 -05:00
|
|
|
|
(format "<sup>%s</sup>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;;;; Tabel Cell
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table-cell (table-cell contents info)
|
2012-04-22 01:09:19 -04:00
|
|
|
|
"Transcode a TABLE-CELL element from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
org-export: Rewrite topology functions
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent, org-export-get-parent-headline,
org-export-get-parent-table): Rewrite function to use :parent
property. Remove communication channel from signature.
(org-export-get-parent-element): Rename from
`org-export-get-parent-paragraph'.
(org-export-data, org-export-table-row-is-special-p)
org-export-table-row-group, org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p, org-export-table-cell-address,
org-export-first-sibling-p, org-export-last-sibling-p,
org-export-resolve-fuzzy-link, org-export-get-ordinal): Apply
signature change.
(org-export--skip-p, org-export-table-cell-width,
org-export-table-cell-alignment, org-export-table-cell-borders):
Refactor code. Apply signature change.
* contrib/lisp/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii--unique-links, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-paragraph, org-e-ascii-quote-section,
org-e-ascii-section, org-e-ascii--table-cell-width): Apply signature
change.
* contrib/lisp/org-e-html.el (org-e-html-link,
org-e-html-link--inline-image): Use new function and apply signature
change.
(org-e-html-item, org-e-html-standalone-image-p, org-e-html-paragraph,
org-e-html-section, org-e-html-table-cell, org-e-html-table-row,
org-e-html-footnote-reference): Apply signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-link--inline-image): Use
new function and apply signature change.
(org-e-latex-footnote-reference, org-e-latex-item,
org-e-latex-table-cell, org-e-latex-table-row): Apply signature
change.
* contrib/lisp/org-e-odt.el (org-e-odt-format-formula,
org-e-odt-format-label, org-e-odt-link--inline-image): Use new
function and apply signature change.
(org-e-odt-item, org-e-odt-standalone-image-p, org-e-odt-paragraph,
org-e-odt-plain-list, org-e-odt-table-style-spec,
org-e-odt-get-table-cell-styles, org-e-odt-table-cell,
org-e-odt-table-row, org-e-odt-table, org-e-odt-footnote-reference,
org-e-odt-enumerate-element): Apply signature change.
2012-06-08 15:00:47 -04:00
|
|
|
|
(let* ((table-row (org-export-get-parent table-cell))
|
|
|
|
|
(table (org-export-get-parent-table table-cell))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(cell-attrs
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(if (not org-html-table-align-individual-fields) ""
|
|
|
|
|
(format (if (and (boundp 'org-html-format-table-no-css)
|
|
|
|
|
org-html-format-table-no-css)
|
2012-04-22 01:09:19 -04:00
|
|
|
|
" align=\"%s\"" " class=\"%s\"")
|
|
|
|
|
(org-export-table-cell-alignment table-cell info)))))
|
2012-04-22 03:58:19 -04:00
|
|
|
|
(when (or (not contents) (string= "" (org-trim contents)))
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(setq contents " "))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(cond
|
2012-04-22 03:58:19 -04:00
|
|
|
|
((and (org-export-table-has-header-p table info)
|
|
|
|
|
(= 1 (org-export-table-row-group table-row info)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(concat "\n" (format (car org-html-table-header-tags) "col" cell-attrs)
|
|
|
|
|
contents (cdr org-html-table-header-tags)))
|
|
|
|
|
((and org-html-table-use-header-tags-for-first-column
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(zerop (cdr (org-export-table-cell-address table-cell info))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(concat "\n" (format (car org-html-table-header-tags) "row" cell-attrs)
|
|
|
|
|
contents (cdr org-html-table-header-tags)))
|
|
|
|
|
(t (concat "\n" (format (car org-html-table-data-tags) cell-attrs)
|
|
|
|
|
contents (cdr org-html-table-data-tags))))))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Table Row
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table-row (table-row contents info)
|
2012-04-22 01:09:19 -04:00
|
|
|
|
"Transcode a TABLE-ROW element from Org to HTML.
|
|
|
|
|
CONTENTS is the contents of the row. INFO is a plist used as a
|
|
|
|
|
communication channel."
|
|
|
|
|
;; Rules are ignored since table separators are deduced from
|
|
|
|
|
;; borders of the current row.
|
|
|
|
|
(when (eq (org-element-property :type table-row) 'standard)
|
|
|
|
|
(let* ((first-rowgroup-p (= 1 (org-export-table-row-group table-row info)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(rowgroup-tags
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: Row belongs to second or subsequent rowgroups.
|
|
|
|
|
((not (= 1 (org-export-table-row-group table-row info)))
|
2012-06-09 07:19:24 -04:00
|
|
|
|
'("<tbody>" . "\n</tbody>"))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;; Case 2: Row is from first rowgroup. Table has >=1 rowgroups.
|
|
|
|
|
((org-export-table-has-header-p
|
org-export: Rewrite topology functions
* contrib/lisp/org-export.el (org-export-get-genealogy,
org-export-get-parent, org-export-get-parent-headline,
org-export-get-parent-table): Rewrite function to use :parent
property. Remove communication channel from signature.
(org-export-get-parent-element): Rename from
`org-export-get-parent-paragraph'.
(org-export-data, org-export-table-row-is-special-p)
org-export-table-row-group, org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p, org-export-table-cell-address,
org-export-first-sibling-p, org-export-last-sibling-p,
org-export-resolve-fuzzy-link, org-export-get-ordinal): Apply
signature change.
(org-export--skip-p, org-export-table-cell-width,
org-export-table-cell-alignment, org-export-table-cell-borders):
Refactor code. Apply signature change.
* contrib/lisp/org-e-ascii.el (org-e-ascii--current-text-width,
org-e-ascii--unique-links, org-e-ascii-inlinetask,
org-e-ascii-item, org-e-ascii-paragraph, org-e-ascii-quote-section,
org-e-ascii-section, org-e-ascii--table-cell-width): Apply signature
change.
* contrib/lisp/org-e-html.el (org-e-html-link,
org-e-html-link--inline-image): Use new function and apply signature
change.
(org-e-html-item, org-e-html-standalone-image-p, org-e-html-paragraph,
org-e-html-section, org-e-html-table-cell, org-e-html-table-row,
org-e-html-footnote-reference): Apply signature change.
* contrib/lisp/org-e-latex.el (org-e-latex-link--inline-image): Use
new function and apply signature change.
(org-e-latex-footnote-reference, org-e-latex-item,
org-e-latex-table-cell, org-e-latex-table-row): Apply signature
change.
* contrib/lisp/org-e-odt.el (org-e-odt-format-formula,
org-e-odt-format-label, org-e-odt-link--inline-image): Use new
function and apply signature change.
(org-e-odt-item, org-e-odt-standalone-image-p, org-e-odt-paragraph,
org-e-odt-plain-list, org-e-odt-table-style-spec,
org-e-odt-get-table-cell-styles, org-e-odt-table-cell,
org-e-odt-table-row, org-e-odt-table, org-e-odt-footnote-reference,
org-e-odt-enumerate-element): Apply signature change.
2012-06-08 15:00:47 -04:00
|
|
|
|
(org-export-get-parent-table table-row) info)
|
2012-06-09 07:19:24 -04:00
|
|
|
|
'("<thead>" . "\n</thead>"))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;; Case 2: Row is from first and only row group.
|
2012-06-09 07:19:24 -04:00
|
|
|
|
(t '("<tbody>" . "\n</tbody>")))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
(concat
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;; Begin a rowgroup?
|
|
|
|
|
(when (org-export-table-row-starts-rowgroup-p table-row info)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(car rowgroup-tags))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;; Actual table row
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(concat "\n" (eval (car org-html-table-row-tags))
|
2012-06-09 07:19:24 -04:00
|
|
|
|
contents
|
|
|
|
|
"\n"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(eval (cdr org-html-table-row-tags)))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;; End a rowgroup?
|
|
|
|
|
(when (org-export-table-row-ends-rowgroup-p table-row info)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(cdr rowgroup-tags))))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;;;; Table
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table-first-row-data-cells (table info)
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(let ((table-row
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-element-map table 'table-row
|
|
|
|
|
(lambda (row)
|
|
|
|
|
(unless (eq (org-element-property :type row) 'rule) row))
|
|
|
|
|
info 'first-match))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(special-column-p (org-export-table-has-special-column-p table)))
|
|
|
|
|
(if (not special-column-p) (org-element-contents table-row)
|
|
|
|
|
(cdr (org-element-contents table-row)))))
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table--table.el-table (table info)
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(when (eq (org-element-property :type table) 'table.el)
|
|
|
|
|
(require 'table)
|
|
|
|
|
(let ((outbuf (with-current-buffer
|
|
|
|
|
(get-buffer-create "*org-export-table*")
|
|
|
|
|
(erase-buffer) (current-buffer))))
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(insert (org-element-property :value table))
|
|
|
|
|
(goto-char 1)
|
|
|
|
|
(re-search-forward "^[ \t]*|[^|]" nil t)
|
|
|
|
|
(table-generate-source 'html outbuf))
|
|
|
|
|
(with-current-buffer outbuf
|
|
|
|
|
(prog1 (org-trim (buffer-string))
|
|
|
|
|
(kill-buffer) )))))
|
2012-02-22 09:36:58 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-table (table contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a TABLE element from Org to HTML.
|
2012-05-23 17:21:25 -04:00
|
|
|
|
CONTENTS is the contents of the table. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-04-22 01:09:19 -04:00
|
|
|
|
(case (org-element-property :type table)
|
|
|
|
|
;; Case 1: table.el table. Convert it using appropriate tools.
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(table.el (org-html-table--table.el-table table info))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;; Case 2: Standard table.
|
|
|
|
|
(t
|
|
|
|
|
(let* ((label (org-element-property :name table))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(caption (org-export-get-caption table))
|
|
|
|
|
(attributes (mapconcat #'identity
|
|
|
|
|
(org-element-property :attr_html table)
|
|
|
|
|
" "))
|
|
|
|
|
(alignspec
|
|
|
|
|
(if (and (boundp 'org-html-format-table-no-css)
|
|
|
|
|
org-html-format-table-no-css)
|
|
|
|
|
"align=\"%s\"" "class=\"%s\""))
|
|
|
|
|
(table-column-specs
|
|
|
|
|
(function
|
|
|
|
|
(lambda (table info)
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (table-cell)
|
|
|
|
|
(let ((alignment (org-export-table-cell-alignment
|
|
|
|
|
table-cell info)))
|
|
|
|
|
(concat
|
|
|
|
|
;; Begin a colgroup?
|
|
|
|
|
(when (org-export-table-cell-starts-colgroup-p
|
|
|
|
|
table-cell info)
|
|
|
|
|
"\n<colgroup>")
|
|
|
|
|
;; Add a column. Also specify it's alignment.
|
|
|
|
|
(format "\n<col %s/>" (format alignspec alignment))
|
|
|
|
|
;; End a colgroup?
|
|
|
|
|
(when (org-export-table-cell-ends-colgroup-p
|
|
|
|
|
table-cell info)
|
|
|
|
|
"\n</colgroup>"))))
|
|
|
|
|
(org-html-table-first-row-data-cells table info) "\n"))))
|
|
|
|
|
(table-attributes
|
|
|
|
|
(let ((table-tag (plist-get info :html-table-tag)))
|
|
|
|
|
(concat
|
|
|
|
|
(and (string-match "<table\\(.*\\)>" table-tag)
|
|
|
|
|
(match-string 1 table-tag))
|
|
|
|
|
(and label (format " id=\"%s\""
|
2013-02-14 05:07:18 -05:00
|
|
|
|
(org-export-solidify-link-text label)))
|
|
|
|
|
(unless (string= attributes "")
|
|
|
|
|
(concat " " attributes))))))
|
2012-04-22 01:09:19 -04:00
|
|
|
|
;; Remove last blank line.
|
|
|
|
|
(setq contents (substring contents 0 -1))
|
2012-08-18 11:33:49 -04:00
|
|
|
|
(format "<table%s>\n%s\n%s\n%s\n</table>"
|
2013-01-27 17:11:34 -05:00
|
|
|
|
table-attributes
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(if (not caption) ""
|
|
|
|
|
(format "<caption>%s</caption>"
|
|
|
|
|
(org-export-data caption info)))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(funcall table-column-specs table info)
|
|
|
|
|
contents)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-12-09 06:18:22 -05:00
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Target
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-target (target contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a TARGET object from Org to HTML.
|
2012-03-04 13:49:35 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2012-02-29 03:39:14 -05:00
|
|
|
|
(let ((id (org-export-solidify-link-text
|
2012-03-04 13:49:35 -05:00
|
|
|
|
(org-element-property :value target))))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-html--anchor id)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
2012-04-28 20:23:09 -04:00
|
|
|
|
;;;; Timestamp
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-timestamp (timestamp contents info)
|
2012-04-28 20:23:09 -04:00
|
|
|
|
"Transcode a TIMESTAMP object from Org to HTML.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let ((value (org-html-plain-text
|
2013-01-10 15:42:21 -05:00
|
|
|
|
(org-timestamp-translate timestamp) info)))
|
2012-04-28 20:11:22 -04:00
|
|
|
|
(format "<span class=\"timestamp-wrapper\"><span class=\"timestamp\">%s</span></span>"
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(replace-regexp-in-string "--" "–" value))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
;;;; Underline
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-underline (underline contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode UNDERLINE from Org to HTML.
|
|
|
|
|
CONTENTS is the text with underline markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format (or (cdr (assq 'underline org-html-text-markup-alist)) "%s")
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
contents))
|
|
|
|
|
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
;;;; Verbatim
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-verbatim (verbatim contents info)
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
"Transcode VERBATIM from Org to HTML.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(format (or (cdr (assq 'verbatim org-html-text-markup-alist)) "%s")
|
org-element: Define new objects (bold, code, italic, ...)
* contrib/lisp/org-e-ascii.el (org-e-ascii-option-alist): Fix typo.
(org-e-ascii-bold, org-e-ascii-code, org-e-ascii-strike-through,
org-e-ascii-underline): New functions.
(org-e-ascii-emphasis): Remove function.
* contrib/lisp/org-e-html.el (org-e-html-text-markup-alist): Variable
renamed from `org-e-html-emphasis-alist'. Change value type.
(org-e-html-bold, org-e-html-italic, org-e-html-strike-through,
org-e-html-underline): New functions.
(org-e-html-verbatim): Update function.
(org-e-html-emphasis): Remove function.
* contrib/lisp/org-e-latex.el (org-e-latex-text-markup-alist):
Variable renamed from `org-e-latex-emphasis-alist'. Change value
type.
(org-e-latex-center-block): Fix docstring.
(org-e-latex--text-markup, org-e-latex-bold, org-e-latex-code,
org-e-latex-italic, org-e-latex-strike-through,
org-e-latex-underline): New functions.
(org-e-latex-verbatim): Update function.
(org-e-latex-emphasis): Remove function.
* contrib/lisp/org-e-odt.el (org-e-odt-bold, org-e-odt-code,
org-e-odt-italic, org-e-odt-strike-through, org-e-odt-underline):
New functions.
(org-e-odt-verbatim): Update function.
(org-e-odt-center-block): Fix docstring.
(org-e-odt-emphasis): Remove function.
* contrib/lisp/org-element.el (org-element-bold-parser):
(org-element-bold-interpreter, org-element-code-parser,
org-element-code-interpreter, org-element-italic-parser,
org-element-italic-interpreter, org-element-strike-through-parser,
org-element-strike-through-interpreter, org-element-underline-parser,
org-element-underline-interpreter): New functions.
(org-element-emphasis-parser, org-element-emphasis-interpreter):
Remove functions.
(org-element-verbatim-parser, org-element-verbatim-interpreter,
org-element-text-markup-successor): Update function.
(org-element-object-successor-alist): Add associations for new object
types.
(org-element-recursive-objects): Add `bold', `italic',
`strike-through' and `underline' as recursive types.
(org-element-object-restrictions): Add restrictions for new recursive
object types.
* contrib/lisp/org-export.el (org-export-filters-alist): Add filters
for new object types.
(org-export-with-todo-keywords): Add missing keywords.
(org-export-filter-center-block-functions,
org-export-filter-drawer-functions,
org-export-filter-dynamic-block-functions,
org-export-filter-headline-functions,
org-export-filter-inlinetask-functions,
org-export-filter-plain-list-functions,
org-export-filter-item-functions, org-export-filter-comment-functions,
org-export-filter-comment-block-functions,
org-export-filter-example-block-functions,
org-export-filter-export-block-functions,
org-export-filter-fixed-width-functions,
org-export-filter-footnote-definition-functions,
org-export-filter-horizontal-rule-functions,
org-export-filter-keyword-functions,
org-export-filter-latex-environment-functions,
org-export-filter-babel-call-functions,
org-export-filter-paragraph-functions,
org-export-filter-property-drawer-functions,
org-export-filter-quote-section-functions,
org-export-filter-quote-block-functions,
org-export-filter-section-functions,
org-export-filter-special-block-functions,
org-export-filter-src-block-functions,
org-export-filter-table-functions,
org-export-filter-table-cell-functions,
org-export-filter-table-row-functions,
org-export-filter-verse-block-functions,
org-export-filter-entity-functions,
org-export-filter-export-snippet-functions,
org-export-filter-footnote-reference-functions,
org-export-filter-inline-babel-call-functions,
org-export-filter-inline-src-block-functions,
org-export-filter-latex-fragment-functions,
org-export-filter-line-break-functions,
org-export-filter-link-functions, org-export-filter-macro-functions,
org-export-filter-radio-target-functions,
org-export-filter-statistics-cookie-functions,
org-export-filter-subscript-functions,
org-export-filter-superscript-functions,
org-export-filter-target-functions,
org-export-filter-time-stamp-functions,
org-export-filter-verbatim-functions): Fix docstring.
(org-export-filter-bold-functions, org-export-filter-code-functions,
org-export-filter-italic-functions,
org-export-filter-strike-through-functions,
org-export-filter-underline-functions): New variables.
(org-export-filter-emphasis-functions): Remove variable.
* testing/lisp/test-org-element.el: Add tests.
2012-04-28 12:00:50 -04:00
|
|
|
|
(org-element-property :value verbatim)))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Verse Block
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-verse-block (verse-block contents info)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Transcode a VERSE-BLOCK element from Org to HTML.
|
2012-04-25 16:15:29 -04:00
|
|
|
|
CONTENTS is verse block contents. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2012-02-18 11:59:42 -05:00
|
|
|
|
;; Replace each newline character with line break. Also replace
|
|
|
|
|
;; each blank line with a line break.
|
|
|
|
|
(setq contents (replace-regexp-in-string
|
|
|
|
|
"^ *\\\\\\\\$" "<br/>\n"
|
|
|
|
|
(replace-regexp-in-string
|
2012-04-25 16:15:29 -04:00
|
|
|
|
"\\(\\\\\\\\\\)?[ \t]*\n" " <br/>\n" contents)))
|
2012-02-18 11:59:42 -05:00
|
|
|
|
;; Replace each white space at beginning of a line with a
|
|
|
|
|
;; non-breaking space.
|
|
|
|
|
(while (string-match "^[ \t]+" contents)
|
2012-02-28 02:39:10 -05:00
|
|
|
|
(let* ((num-ws (length (match-string 0 contents)))
|
|
|
|
|
(ws (let (out) (dotimes (i num-ws out)
|
2013-03-02 00:30:46 -05:00
|
|
|
|
(setq out (concat out " "))))))
|
2012-02-28 02:39:10 -05:00
|
|
|
|
(setq contents (replace-match ws nil t contents))))
|
org-e-html/org-e-odt: Changes to caption handling
* contrib/lisp/org-e-html.el (org-e-html--caption/label-string,
org-e-html--wrap-label, org-e-html--find-verb-separator): Remove
functions.
(org-e-html-center-block, org-e-html-drawer, org-e-html-dynamic-block,
org-e-html-fixed-width, org-e-html-inline-src-block,
org-e-html-inlinetask, org-e-html-latex-environment,
org-e-html-plain-list, org-e-html-quote-block,
org-e-html-special-block, org-e-html-verse-block): Apply functions
removal.
(org-e-html-example-block, org-e-html-src-block): Allow textarea. Use
new caption scheme.
(org-e-html-horizontal-rule): Cleanup.
(org-e-html-link--inline-image, org-e-html-table): Use new caption
scheme.
* contrib/lisp/org-e-odt.el (org-e-odt--wrap-label,
org-e-odt--caption/label-string): Remove functions.
(org-e-odt-format-label): Use new caption scheme.
(org-e-odt-center-block, org-e-odt-drawer, org-e-odt-dynamic-block,
org-e-odt-example-block, org-e-odt-fixed-width,
org-e-odt-horizontal-rule, org-e-odt-inlinetask,
org-e-odt-latex-environment, org-e-odt-plain-list,
org-e-odt-quote-block, org-e-odt-special-block,
org-e-odt-verse-block): Apply functions removal.
In e-html export, textareas are now possible with the following
attribute:
#+ATTR_HTML: :textarea t :width 80 :height 10
:width and :height keywords are optional.
2012-09-13 11:15:07 -04:00
|
|
|
|
(format "<p class=\"verse\">\n%s</p>" contents))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-22 09:36:58 -05:00
|
|
|
|
;;; Filter Functions
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-final-function (contents backend info)
|
|
|
|
|
(if (not org-html-pretty-output) contents
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(with-temp-buffer
|
2012-09-28 11:08:37 -04:00
|
|
|
|
(html-mode)
|
2012-02-22 09:36:58 -05:00
|
|
|
|
(insert contents)
|
|
|
|
|
(indent-region (point-min) (point-max))
|
|
|
|
|
(buffer-substring-no-properties (point-min) (point-max)))))
|
|
|
|
|
|
|
|
|
|
|
2012-12-09 06:18:22 -05:00
|
|
|
|
|
2012-10-08 08:20:56 -04:00
|
|
|
|
;;; End-user functions
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-07-20 07:11:44 -04:00
|
|
|
|
;;;###autoload
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-export-as-html
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-07-20 07:11:44 -04:00
|
|
|
|
"Export current buffer to an HTML buffer.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 11:24:19 -05:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting buffer should be accessible
|
|
|
|
|
through the `org-export-stack' interface.
|
|
|
|
|
|
2012-07-20 07:11:44 -04:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
|
between \"<body>\" and \"</body>\" tags.
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
Export is done in a buffer named \"*Org HTML Export*\", which
|
2012-07-20 07:11:44 -04:00
|
|
|
|
will be displayed when `org-export-show-temporary-export-buffer'
|
|
|
|
|
is non-nil."
|
|
|
|
|
(interactive)
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(if async
|
|
|
|
|
(org-export-async-start
|
|
|
|
|
(lambda (output)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(with-current-buffer (get-buffer-create "*Org HTML Export*")
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert output)
|
|
|
|
|
(goto-char (point-min))
|
2013-02-12 16:21:20 -05:00
|
|
|
|
(funcall org-html-display-buffer-mode)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-export-add-to-stack (current-buffer) 'html)))
|
|
|
|
|
`(org-export-as 'html ,subtreep ,visible-only ,body-only ',ext-plist))
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(let ((outbuf (org-export-to-buffer
|
2013-01-27 17:11:34 -05:00
|
|
|
|
'html "*Org HTML Export*"
|
2012-12-02 11:24:19 -05:00
|
|
|
|
subtreep visible-only body-only ext-plist)))
|
|
|
|
|
;; Set major mode.
|
2013-02-12 16:21:20 -05:00
|
|
|
|
(with-current-buffer outbuf (funcall org-html-display-buffer-mode))
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(when org-export-show-temporary-export-buffer
|
|
|
|
|
(switch-to-buffer-other-window outbuf)))))
|
2012-07-20 07:11:44 -04:00
|
|
|
|
|
2012-05-30 14:30:56 -04:00
|
|
|
|
;;;###autoload
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-export-to-html
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-02-18 01:52:31 -05:00
|
|
|
|
"Export current buffer to a HTML file.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 11:24:19 -05:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
2012-02-18 01:52:31 -05:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
2012-07-20 07:11:44 -04:00
|
|
|
|
between \"<body>\" and \"</body>\" tags.
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return output file's name."
|
|
|
|
|
(interactive)
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(let* ((extension (concat "." org-html-extension))
|
2012-11-29 15:52:43 -05:00
|
|
|
|
(file (org-export-output-file-name extension subtreep))
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-export-coding-system org-html-coding-system))
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(if async
|
|
|
|
|
(org-export-async-start
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(lambda (f) (org-export-add-to-stack f 'html))
|
|
|
|
|
(let ((org-export-coding-system org-html-coding-system))
|
2012-12-02 11:24:19 -05:00
|
|
|
|
`(expand-file-name
|
|
|
|
|
(org-export-to-file
|
2013-01-27 17:11:34 -05:00
|
|
|
|
'html ,file ,subtreep ,visible-only ,body-only ',ext-plist))))
|
|
|
|
|
(let ((org-export-coding-system org-html-coding-system))
|
2012-12-02 11:24:19 -05:00
|
|
|
|
(org-export-to-file
|
2013-01-27 17:11:34 -05:00
|
|
|
|
'html file subtreep visible-only body-only ext-plist)))))
|
2012-02-18 01:52:31 -05:00
|
|
|
|
|
2012-10-08 08:20:56 -04:00
|
|
|
|
;;;###autoload
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(defun org-html-publish-to-html (plist filename pub-dir)
|
2012-10-08 08:20:56 -04:00
|
|
|
|
"Publish an org file to HTML.
|
|
|
|
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
|
|
|
is the property list for the given project. PUB-DIR is the
|
|
|
|
|
publishing directory.
|
|
|
|
|
|
|
|
|
|
Return output file name."
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-publish-org-to 'html filename ".html" plist pub-dir))
|
2012-10-08 08:20:56 -04:00
|
|
|
|
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
|
2012-07-24 14:48:41 -04:00
|
|
|
|
;;; FIXME
|
2012-02-20 11:28:44 -05:00
|
|
|
|
|
|
|
|
|
;;;; org-format-table-html
|
|
|
|
|
;;;; org-format-org-table-html
|
|
|
|
|
;;;; org-format-table-table-html
|
|
|
|
|
;;;; org-table-number-fraction
|
2012-02-22 09:36:58 -05:00
|
|
|
|
;;;; org-table-number-regexp
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;;;; org-html-table-caption-above
|
|
|
|
|
;;;; org-html-with-timestamp
|
|
|
|
|
;;;; org-html-html-helper-timestamp
|
|
|
|
|
;;;; org-html-inline-image-extensions
|
2012-02-29 03:39:14 -05:00
|
|
|
|
;;;; org-export-preferred-target-alist
|
|
|
|
|
;;;; class for anchors
|
|
|
|
|
;;;; org-export-with-section-numbers, body-only
|
2012-03-08 02:55:58 -05:00
|
|
|
|
;;;; org-export-mark-todo-in-toc
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;;;; org-html-format-org-link
|
2012-07-12 17:53:57 -04:00
|
|
|
|
;;;; (caption (and caption (org-xml-encode-org-text caption)))
|
|
|
|
|
;;;; alt = (file-name-nondirectory path)
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(provide 'ox-html)
|
|
|
|
|
|
|
|
|
|
;; Local variables:
|
|
|
|
|
;; generated-autoload-file: "org-loaddefs.el"
|
|
|
|
|
;; End:
|
|
|
|
|
|
|
|
|
|
;;; ox-html.el ends here
|