0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-22 10:10:42 +00:00
Commit graph

36 commits

Author SHA1 Message Date
Jambunathan K c08183d043 org-odt.el: Create and update meta.xml towards end of the export
* contrib/lisp/org-odt.el
(org-odt-init-outfile): Don't create meta.xml here.
(org-odt-update-meta-file): Create and update meta.xml here
instead.  Note that this routine gets called just before the
component files are zipped.
(org-export-odt-meta-lines): Remove it. Not needed any longer.
(org-odt-save-as-outfile): No need to create backup files
while saving xml buffers.
2011-09-05 12:03:10 +05:30
Jambunathan K 74e78a1456 org-lparse.el: Support for list-tables (first cut)
* contrib/lisp/org-lparse.el
(org-lparse-list-table:table-cell-open): New variable.
(org-lparse-begin-list-table:table-cell)
(org-lparse-end-list-table:table-cell): New routines.  Use
`org-lparse-begin-collect' and `org-lparse-end-collect' to get
a string representation of a multi-line table cell.
(org-lparse-list-table-p, org-lparse-list-level)
(org-lparse-list-item-count, org-lparse-list-stack)
(org-lparse-list-table:table-cell-open)
(org-lparse-list-table:table-row)
(org-lparse-list-table:lines): New variables to keep track of
the state of the list at a point in time during export.
(org-do-lparse): Init above variables.
(org-lparse-begin-list, org-lparse-end-list)
(org-lparse-begin-list-item, org-lparse-end-list-item):
Modified so that list marked as list-table are exported as a
table.  Refer notes in the file for more information.
(org-lparse-do-format-list-table): Make sure that `org-table'
is loaded.

* contrib/lisp/org-odt.el (org-odt-format-table-cell): Table
cells are list-tables are already paragraphs.  No need to
enclose them in paragraphs again.
2011-09-01 23:44:17 +05:30
Jambunathan K 30aa8f61da Revert "Introduce org-odt-begin-table-cell and org-odt-end-table-cell"
This reverts commit e887881e13.  Keep things
simple for now.
2011-09-01 23:44:04 +05:30
Jambunathan K e887881e13 Introduce org-odt-begin-table-cell and org-odt-end-table-cell
* contrib/lisp/org-odt.el
(org-odt-entity-control-callbacks-alist): Added an entry for
TABLE-CELL.
(org-odt-begin-paragraph, org-odt-format-stylized-paragraph):
Honour `org-lparse-current-paragraph-style'.
(org-odt-begin-table-cell, org-odt-end-table-cell): Factored
out from the earlier `org-odt-format-table-cell'. Note that
these functions set and reset
`org-lparse-current-paragraph-style'.
(org-odt-format-table-cell): Use the above functions.
* contrib/lisp/org-lparse.el
(org-lparse-current-paragraph-style): New variable.
(org-do-lparse): Init the above variable at the beginning of
export.
2011-09-01 19:36:34 +05:30
Jambunathan K ad3419180f Refactor org-odt-format-table-cell
* contrib/lisp/org-odt.el
(org-odt-get-paragraph-style-cookie-for-table-cell)
(org-odt-get-style-name-cookie-for-table-cell): Factored out
from `org-odt-format-table-cell'.
(org-odt-format-table-cell): Simplified using above functions.
2011-09-01 18:32:13 +05:30
Jambunathan K a0769aaebb Introduce org-lparse-begin/end-list-item
* contrib/lisp/org-lparse.el (org-lparse-end-list-item):
Renamed to `org-lparse-end-list-item-1'.
(org-lparse-begin-list-item, org-lparse-end-list-item): New
functions.  Use these instead of doing (org-lparse-begin
'LIST-ITEM ...) or (org-lparse-end 'LIST-ITEM ...).
(org-lparse-export-list-line, org-lparse-begin-level)
(org-lparse-end-level): Propagate above changes.
* contrib/lisp/org-odt.el
(org-odt-begin-list-item, org-odt-end-list-item): ditto.
* contrib/lisp/org-xhtml.el (org-xhtml-format-toc-item)
(org-xhtml-begin-toc, org-xhtml-end-toc): ditto.
2011-08-31 22:28:14 +05:30
Jambunathan K 2adfdac23b Run org-export-odt-preprocess-latex-fragments only if backend is odt
* contrib/lisp/org-odt.el
(org-export-odt-do-preprocess-latex-fragments): Renamed from
org-export-odt-preprocess-latex-fragments.
(org-export-odt-preprocess-latex-fragments): Check that
backend is odt. If yes, delegate to
org-export-odt-do-preprocess-latex-fragments.
2011-08-28 01:48:25 +05:30
Jambunathan K 3688deeb3f org-odt.el: Support for captioning and labelling of equation images
* contrib/lisp/org-lparse.el (org-do-lparse): let-bind
org-lparse-opt-plist to current export options.
* contrib/lisp/org-odt.el
(org-odt-begin-office-body): Add a directive so that Equations
can be sequentially numbered.
(org-export-odt-preprocess): Removed call to
org-export-odt-preprocess-latex-fragments.
(org-export-odt-preprocess-latex-fragments): Fix signature and
hook it to org-export-preprocess-after-blockquote-hook. Use
org-lparse-opt-plist.
(org-odt-unload-function): Leave no trace in
org-export-preprocess-after-blockquote-hook.

Thanks to Myles English for registering this requirement.
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01116.html
2011-08-27 20:31:43 +05:30
Jambunathan K 09618ba25a org-odt.el: Honor caption, label and attributes for latex png images
* contrib/lisp/org-odt.el (org-export-odt-format-image): Honor
captions, label and attributes for all images including those
generated from latex fragments.
2011-08-27 20:31:33 +05:30
Jambunathan K 457af1b109 Refactor org-export-odt-preprocess
* contrib/lisp/org-odt.el
(org-export-odt-preprocess-latex-fragments)
(org-export-odt-preprocess-label-references): New
routines. Factored out of the earlier
org-export-odt-preprocess.
(org-export-odt-preprocess): Use above functions.

Preparing for enabling of captions and labels for latex fragments
embedded as images.
2011-08-27 20:31:23 +05:30
Jambunathan K cfe467c01d org-odt.el: Fix byte-compiler warnings 2011-08-27 20:31:13 +05:30
Jambunathan K ce02a1b986 org-odt: Force columns of tables to have the same width
* contrib/lisp/org-odt.el (org-odt-end-table): Associate table
columns with `OrgTableColumn' style.
(org-odt-format-source-code-or-example): Delete trailing
whitespace.

* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Modify
`OrgTable' style to use a relative width of 90%. Effective
table width is now increased so that tables are not
congested. There could be a reverse problem of they being too
big. This is OK. Introduced `OrgTableColumn' style and force
the columns to use the same width.

Fixes the following symptoms - congested table and uneven
columns - seen with the below report..

http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01053.html

Table cookies can specify default column width. These could be
used for finer control of column widths on per-table
basis. However this introduces the need to create automatic
column styles for each and every column that is explicitly
sized. The exporter has so far avoided creating of automatic
styles `on the go' and instead relied on a custom styles for
formatting. If column-widths are made user-controllable then
this has to change and the exporter could become a bit
inelegant. Is the overhead worth it?
2011-08-26 03:12:51 +05:30
Jambunathan K f131417f7d org-odt.el: Fix a bug in outline numbering
* contrib/lisp/org-odt.el
(org-odt-configure-outline-numbering): Fixed a bug with
outline numbering. Also removed the check for
org-export-odt-factory-settings (for now).
2011-08-24 04:41:43 +05:30
Jambunathan K 78e59a22d0 Add support for fontification of odt src blocks using htmlfontify
* contrib/lisp/org-lparse.el (org-do-lparse): Bind
hfy-user-sheet-assoc.
* contrib/lisp/org-odt.el
(org-export-odt-default-org-styles-alist): Rename
OrgSourceBlock to OrgSrcBlock for consistency.
(org-odt-format-source-code-or-example): Modified. Call either
org-odt-format-source-code-or-example-plain or
org-odt-format-source-code-or-example-colored.
(org-odt-format-source-code-or-example-plain): New. Identical
to the earlier org-odt-format-source-code-or-example.
(org-odt-format-source-code-or-example-colored): New
defun. Use htmlfontify for emitting coloring of source blocks.
(org-export-odt-use-htmlfontify)
(org-export-odt-create-custom-styles-for-srcblocks): New
customizable variables
(org-src-block-paragraph-format): New variable.
(org-odt-hfy-face-to-css)
(org-odt-insert-custom-styles-for-srcblocks): New defuns.
(org-odt-save-as-outfile): Modified. Use
org-odt-insert-custom-styles-for-srcblocks.
2011-08-19 01:02:00 +05:30
Jambunathan K ad9f393b61 org-odt: Rename style OrgSourceBlock' to OrgFixedWidthBlock'
* contrib/odt/styles/OrgOdtStyles.xml: Rename the style
`OrgSourceBlock' to `OrgFixedWidthBlock'.
* contrib/lisp/org-odt.el
(org-export-odt-default-org-styles-alist): Map fixedwidth
paragraphs to the custom style `OrgFixedWidthBlock'.
(org-odt-format-line, org-odt-format-source-code-or-example):
Style both fixedwidth paragraphs and src/example blocks in
fixedwidth format.
2011-08-19 00:38:44 +05:30
Jambunathan K 1ab7fbeb46 org-odt.el: Minor refactoring of src and example block formatters
* contrib/lisp/org-odt.el (org-odt-format-source-code-or-example-line)
(org-odt-format-example): Removed.
(org-odt-format-source-code-or-example, org-odt-format-line);
Changes related to above removal.
2011-08-19 00:38:35 +05:30
Jambunathan K 321f4d3a42 Introduce a new customizable variable org-export-odt-prettify-xml
* contrib/lisp/org-odt.el (org-export-odt-prettify-xml): New
customizable variable.
(org-odt-save-as-outfile): Honor the setting of the above
variable.

There have not been much reported issues with the odt output.  So turn
off prettifying of xml buffers.  But retain the option to turn it on
if required.
2011-08-19 00:38:25 +05:30
Jambunathan K a2e6a7ef90 Minor cleanups in org-odt
* contrib/lisp/org-odt.el (org-odt-format-spaces): Minor
change. Always emit a leading space.
(org-odt-fill-tabs-and-spaces): Simplify.
(org-odt-finalize-outfile): Remove a stray message.
2011-08-19 00:38:16 +05:30
Jambunathan K 395a816a18 Prettify inlinetasks in odt and (x)html backends
* lisp/org-inlinetask.el (org-inlinetask-export-templates):
Fixed template for html so that the exported file is valid
xhtml. Added template for odt.
(org-inlinetask-export-handler): Fix typo in the regexp that
trims content. Make sure that the content is flanked by
paragraph boundaries on either side.

* lisp/org-html.el (org-export-html-style-default): Add style
for inlinetask.

* contrib/lisp/org-xhtml.el (org-export-xhtml-style-default):
Add style for inlinetask.

* contrib/odt/styles/OrgOdtStyles.xml: Added following custom
styles:  OrgInlineTaskHeading and OrgInlineTaskFrame.

* contrib/lisp/org-odt.el (org-odt-format-textbox)
(org-odt-format-inlinetask): Added

Refer following threads:
1. http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00238.html
2. http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00154.html

Thanks to Suvayu Ali for reporting this issue and suggesting
improvements.
2011-08-16 21:29:52 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
Jambunathan K 99466ce716 Fix issues with numbering of lists found during odt to doc conversion
* contrib/lisp/org-lparse.el (org-do-lparse): Add new let
bound variable org-lparse-list-level.
(org-lparse-begin-list, org-lparse-end-list): New functions.
(org-lparse-export-list-line, org-lparse-begin-level)
(org-lparse-end-level): Use new functions.

* contrib/lisp/org-odt.el (org-odt-begin-list): Fixed
signature so that it is consistent with how org-lparse library
invokes it. Forcibly emit text:continue-numbering="false"
attribute for the top-level <text:list> element. This fixes
numbering issue found during odt to doc conversion. See
http://thread.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/14739
(org-odt-begin-list-item, org-odt-end-list-item): Use
org-lparse-begin-list and org-lparse-end-list.

* contrib/lisp/org-xhtml.el (org-xhtml-format-toc-item)
(org-xhtml-begin-toc, org-xhtml-end-toc): Use
org-lparse-begin-list and org-lparse-end-list.
(org-xhtml-begin-list): Fixed signature so that it is
consistent with how org-lparse library invokes it.
2011-08-08 11:31:17 +05:30
Jambunathan K 44472fa6cf Usability improvements to org-lparse-convert and co (First cut)
* contrib/lisp/org-lparse.el (org-lparse-and-open)
(org-lparse-register-backend, org-lparse-format-table)
(org-lparse-begin, org-lparse-end): Checkdoc related fixes.
(org-lparse-get-converter): Added
(org-lparse-get-other-backends, org-lparse-all-backends):
Re-implemented. Also improved docstring.
(org-lparse): Make use of improvements in the converter
routines. Improve the following: a) gathering of
target-backend and native-backend args during interactive
calls b) error handling.
(org-lparse-convert): Introduced prefix arg for opening of
converted files. Make use of improvements in the converter
routines. Improve error handling.
(org-lparse-convert-processes): New customizable variable.
(org-lparse-convert-process): Make it customizable. Set
default value to nil.
(org-lparse-convert-capabilities): New customizable variable.
(org-lparse-use-flashy-warning): Fix group and improve docstring.

* contrib/lisp/org-odt.el (org-odt-get): Don't set
CONVERT-METHOD and OTHER-BACKENDS options. Fallback to the
global converter settings for now.
(org-export-odt-preferred-output-format): New variable
(org-export-as-odt-and-open, org-export-as-odt): Use the
afore-mentioned variable.

* contrib/lisp/org-xhtml.el (org-xhtml-get): Don't set
CONVERT-METHOD and OTHER-BACKENDS options. Fallback to the
global converter settings for now.
2011-08-05 02:04:30 +05:30
Jambunathan K 4db8048a23 Introduce org-lparse-unregister-backend and use it
* contrib/lisp/org-lparse.el (org-lparse-unregister-backend):
New.
* contrib/lisp/org-odt.el (org-odt-unload-function):
New. De-register from org-lparse on unload.
* contrib/lisp/org-xhtml.el (org-xhtml-unload-function):
New. De-register from org-lparse on unload.
2011-08-02 15:00:15 +05:30
Jambunathan K 76297448c9 org-odt: Emit OD compatible date string in the default case
* contrib/lisp/org-odt.el (org-odt-format-date): New
(org-odt-update-meta-file): Use the above routine

Knocks off an error reported by
http://tools.services.openoffice.org/odfvalidator/
2011-07-27 14:43:07 +02:00
Jambunathan K 5aae06d9f4 org-odt: Include mimetype in the exported odt file
* contrib/lisp/org-odt.el (org-export-odt-save-list): Add the
file "mimetype".
(org-odt-init-outfile): Write contents of "mimetype".
(org-odt-save-as-outfile): Include "mimetype" file in the
exported file.
(org-export-odt-mimetype-lines): Removed.

This change knocks of an error while validating against
http://tools.services.openoffice.org/odfvalidator/.
2011-07-27 14:41:52 +02:00
Jambunathan K 3e2057732a org-odt: Check for zip early during export
* contrib/lisp/org-odt.el (org-odt-init-outfile): Abort export
if zip utility is not available.
2011-07-22 17:49:03 +02:00
Jambunathan K 651e38ddc6 org-odt: Improve customization of org-export-odt-styles-file
* contrib/lisp/org-odt.el (org-odt-data-dir)
(org-export-odt-automatic-styles-file): Update docstring.
(org-export-odt-use-bookmarks-for-internal-links): Update
docstring. Improve customization interface.
2011-07-22 17:48:52 +02:00
Jambunathan K 054ab6ceee org-odt: Use lang specific value for "Table Of Contents"
* contrib/lisp/org-odt.el (org-odt-begin-toc): Use lang
specific value for "Table Of Contents".
2011-07-21 11:18:24 +02:00
Jambunathan K 48b998cefc org-odt: Simplify org-odt-format-org-entity
* contrib/lisp/org-odt.el (org-odt-format-org-entity):
Simplify.  Component xml files in odt document are always
utf-8 encoded. As a result, emitting of numeric character
references based on utf-8 value is superfluous.
2011-07-21 11:18:20 +02:00
Jambunathan K 3aa87582b6 org-odt: Correctly export iso-8859-1 files with non-ascii chars
* contrib/lisp/org-odt.el (org-odt-get): Set
CODING-SYSTEM-FOR-WRITE and CODING-SYSTEM-FOR-SAVE to 'utf-8
irrespective of buffer-file-coding-system.

Fixes issue reported by Renzo Been in the following post.
http://lists.gnu.org/archive/html/emacs-orgmode/2011-07/msg00795.html
2011-07-18 14:55:13 +05:30
Jambunathan K 7aee4082c1 Backends now register with org-lparse during load time
* contrib/lisp/org-lparse.el (org-lparse-native-backends): Set
default value to nil. Also update docstring.
(org-lparse-register-backend): New
* contrib/lisp/org-xhtml.el (org-xhtml-get): Add self -
"xhtml" - as one of the other backends. Call
org-lparse-register-backend on load.
* contrib/lisp/org-odt.el: Call org-lparse-register-backend on
load.
2011-07-09 01:35:50 +05:30
Bastien Guerry 227bd77874 contrib/lisp/org-odt.el: rename org-export-convert-process.
Rename org-export-convert-process to org-lparse-convert-process.

Other cosmetic changes.
2011-07-08 12:32:15 +02:00
Bastien Guerry c75aa036a2 contrib/org-lparse.el and org-odt.el: cosmetic changes. 2011-07-07 15:18:47 +02:00
Jambunathan K 23c8be4518 org-lparse/org-odt: Add docstring. Silence byte-compiler
I am attaching two org-odt patches for inclusion. Both are desirable and
not mandatory.
2011-07-03 12:35:51 +02:00
Jambunathan K a51c5637f9 Make org-xhtml and org-odt usable
* contrib/lisp/org-odt.el (org-odt-data-dir): Update to
reflect new directory layout.

* contrib/lisp/org-xhtml.el
(org-export-xhtml-special-string-regexps): Define it.
2011-07-01 15:04:05 +02:00
Bastien Guerry 63b8ecb4ea Add Jambunathan's odt exporter in contrib/.
This adds these new files:

contrib/lisp/org-lparse.el
contrib/lisp/org-odt.el
contrib/lisp/org-xhtml.el
contrib/odt/BasicODConverter/BasicODConverter-0.8.0.oxt
contrib/odt/BasicODConverter/Filters.bas
contrib/odt/BasicODConverter/Main.bas
contrib/odt/OASIS/OpenDocument-schema-v1.1.rng
contrib/odt/OASIS/OpenDocument-v1.2-cs01-manifest-schema.rng
contrib/odt/OASIS/OpenDocument-v1.2-cs01-schema.rng
contrib/odt/README.org
contrib/odt/etc/schema/od-manifest-schema-v1.2-cs01.rnc
contrib/odt/etc/schema/od-schema-v1.1.rnc
contrib/odt/etc/schema/od-schema-v1.2-cs01.rnc
contrib/odt/etc/schema/schemas.xml
contrib/odt/styles/OrgOdtAutomaticStyles.xml
contrib/odt/styles/OrgOdtStyles.xml

Notes:

contrib/lisp/org-xhtml.el is meant to be merged at some point with
lisp/org-html.el, to avoid code redundancies.

The feature as a whole is meant to move to Org's core when things
are tested and stable enough.

Thanks a lot to Jambunathan for this great contribution and for
his patience!
2011-07-01 11:12:19 +02:00