Re-implement org-export-as-html and add support for odt backend.
commit8ebbd9f81a8abb4ccadc25c512119a6369f03406
authorJambunathan K <kjambunathan@gmail.com>
Sun, 20 Mar 2011 12:07:59 +0000 (20 17:37 +0530)
committerJambunathan K <kjambunathan@gmail.com>
Sun, 20 Mar 2011 17:51:50 +0000 (20 23:21 +0530)
tree98c8c3a4b30a4714d8565a68ded0fe15b6d047bc
parent3d802ee691664ee93c1680e323a3486d972db578
Re-implement org-export-as-html and add support for odt backend.

* lisp/org.el (org-structure-template-alist): Allow easy
insertion of odt blocks.

* lisp/org-footnote.el
(insertion-point-for-normalized-footnotes): New variable that
controls the where the normalized footnote definitions are
inserted. Affects only pre-processor related
normalization. html and odt backends bind this to `point-min'
so that the footnote definitions are seen before the footnote
references.
(org-footnote-normalize): Honor above var.

* lisp/org-exp.el (org-export): Register `org-export-as-odt'
and `org-export-as-odt-and-open'. Define default keybindings
for the same.
(org-export-select-backend-specific-text): Register odt.
(org-export-do-format-source-code-or-example): Renamed from
`org-export-fromat-source-code-or-example'.
(org-export-format-source-code-or-example): New
function. Preferentially call backend-specific formatter if
available with a fallback to a generic formatter.

* lisp/org-html.el (org-do-export): The core generic
exporter. Derived from org-export-as-html. Binds
`insertion-point-for-normalized-footnotes' to point-min.

(org-export-as-html): Make use of `org-do-export'.

(org-html-entity-control-callbacks-alist)
(org-html-entity-format-callbacks-alist): New variables.

(org-html-get): Get callback for html backend.

(org-html-get-coding-system-for-save)
(org-html-get-coding-system-for-write): Get routines for html
backend.

(org-html-format-tags, org-html-format-footnotes-section)
(org-html-format-footnote-reference, org-html-format-anchor)
(org-html-format-headline, org-html-format-heading)
(org-html-format-link, org-html-format-fontify)
(org-html-format-comment, org-html-format-plain)
(org-html-format-horizontal-line, org-html-format-line-break)
(org-html-format-tabs, org-html-format-spaces)
(org-html-format-table-cell, org-html-format-table-row)
(org-html-format-toc-item, org-html-format-toc-entry):
Formatting callbacks for html backend.

(org-html-begin-footnote-definition)
(org-html-end-footnote-definition, org-html-end-table)
(org-html-begin-table, org-html-end-table-rowgroup)
(org-html-begin-table-rowgroup, org-html-begin-list-item)
(org-html-end-list-item, org-html-begin-list)
(org-html-end-list)
(org-html-html-list-type-to-canonical-list-type)
(org-html-begin-environment, org-html-end-environment)
(org-html-format-environment, org-html-begin-paragraph)
(org-html-end-paragraph, org-html-begin-section)
(org-html-end-section, org-html-begin-level)
(org-html-end-level, org-html-begin-document-content)
(org-html-end-document-content, org-html-begin-document-body)
(org-html-end-document-body, org-html-end-export): Control
callbacks for html backend.

(org-html-protect): New variable. Controls emitting of
protected tags - @<tag> ... @</tag>
(org-html-emphasis-alist): New variable. Takes over
`org-html-emphasis-alist'.

(org-html-insert-postamble, org-html-insert-preamble): New
functions. Factored out from `org-export-as-html'.

(org-parse-table-of-contents): New variable. Contains table of
contents.
(org-html-prepare-toc): New function that emits table of
contents. Uses a temporary buffer for reaping the table of
contents and sets `org-parse-table-of-contents'.

(org-html-footnote-number, org-html-footnote-definitions): New
variables let bound witin `org-do-export'.
(org-html-footnote-buffer): New variable. The temporary buffer
in which footnote definitions are reaped.
(org-html-output-buffer): New variable. The buffer that holds
the exported output.

(org-table-style, org-table-ncols, org-table-rownum)
(org-table-is-styled, org-table-begin-marker)
(org-table-num-numeric-items-per-column)
(org-table-colalign-info, org-table-colalign-vector)
(org-table-get-colalign-info, org-table-rowgroup-info)
(org-table-rowgroup-open)
(org-table-current-rowgroup-is-header): ): New variables that
are let bound by routines that emit tables
`org-do-format-org-table-html' and
`org-do-format-table-table-html'.
(org-format-org-table-html): Derived from
`org-format-org-table-html'.
(org-do-format-org-table-html): Wrapper around
`org-do-format-org-table-html'. Switches to a temporary buffer
and returns the formattted table as a string.
(org-do-format-table-table-html): Derived from
`org-format-table-table-html'.
(org-format-table-table-html): Wrapper around
`org-do-format-table-table-html'. Switches to a temporary
buffer and returns the formattted table as a string.

(org-html-export-list-line, org-html-format-section-number)
(org-html-format-org-tags, org-html-format-extra-targets)
(org-html-format-todo, org-html-insert-toc)
(org-html-insert-tag, org-html-bind-local-variables): Newly
introduced helper routines.

(org-html-format-org-link): Derived from `org-html-make-link'.

(org-export-html-format-image): Change signature. Use macro
`with-org-html-preserve-paragraph-state'.

(org-html-handle-time-stamps)
(org-export-html-convert-sub-super): Modified.
(org-export-html-convert-emphasize): Modified. Use
`org-html-emphasis-alist' instead of `org-emphasis-alist'.

(org-html-insert-tag-with-newlines): New variable. Controls
inclusion of newlines in the tag related routines.

(org-close-li): Modified.

(org-html-export-list-line): Modified

(org-html-level-start): Renamed to org-html-begin-level.
(org-html-level-close): Renamed to org-html-end-level.

(with-org-html-preserve-paragraph-state): New macro.

(org-open-par): Removed. Superceded by
`org-parse-begin-paragraph'.
(org-close-par-maybe): Removed. Superceded by
`org-parse-end-paragraph'.
(org-close-li): Modified.

(org-parse-debug): New variable. Use this to embed useful
debugging info as comment sections in the exported document.

(org-parse-begin, org-parse-end): Parse routines that invoke
control callbacks on the backend.
(org-parse-format): Parser routine that invokes formatting
callbacks on the backend.
(org-parse-get): Parser routine that invokes the get callback
on the backend.

(org-parse-link-description-is-image)
(org-parse-dyn-current-environment): New variables that are
backend agnostic.

(org-parse-begin-paragraph): Derived from `org-open-par'.
(org-parse-end-paragraph): Derived from `org-close-par-maybe'.
(org-parse-format-org-link, org-parse-format-table-row)
(org-parse-end-table, org-parse-begin-table-rowgroup)
(org-parse-begin-footnote-definition)
(org-parse-end-footnote-definition)
(org-parse-current-environment-p, org-parse-begin-environment)
(org-parse-end-environment): New routines that are backend
agnostic.

* lisp/org-odt.el: New backend file for export to
OpenDocumentText.

* contrib/odt/: New directory. Holds data files used in
conjunction with org-odt.el
* contrib/odt/OrgOdtAutomaticStyles.xml:
* contrib/odt/OrgOdtStyles.xml: Default style file used by
org-odt.el
* contrib/odt/OpenDocument-schema-v1.1.rng: Copy of
http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-schema-v1.1.rng
* contrib/odt/OpenDocument-schema-v1.1.rnc: Relax-NG schema
file for validating OpenDocumentText files. Auto-generated
from rng file using trang -
http://www.thaiopensource.com/relaxng/trang.html.
* contrib/odt/schemas.xml: Sample schema locating file for use
with auto-validation of OpenDocumentText files.
* contrib/odt/setup.el: Suggested code for use within user's
.emacs file.
* contrib/odt/files/: Unit test directory for org-odt.el.
* contrib/odt/files/test.org: Sample org file for testing.
* contrib/odt/files/org-mode-unicorn.png: Image file for use
within the unit test file.
13 files changed:
contrib/odt/OpenDocument-schema-v1.1.rnc [new file with mode: 0644]
contrib/odt/OpenDocument-schema-v1.1.rng [new file with mode: 0644]
contrib/odt/OrgOdtAutomaticStyles.xml [new file with mode: 0644]
contrib/odt/OrgOdtStyles.xml [new file with mode: 0644]
contrib/odt/files/org-mode-unicorn.png [new file with mode: 0644]
contrib/odt/files/test.org [new file with mode: 0644]
contrib/odt/schemas.xml [new file with mode: 0755]
contrib/odt/setup.el [new file with mode: 0644]
lisp/org-exp.el
lisp/org-footnote.el
lisp/org-html.el
lisp/org-odt.el [new file with mode: 0644]
lisp/org.el