Commit Graph

276 Commits

Author SHA1 Message Date
Rasmus e6fcc853c5 ox: Optional export of title
* ox.el (org-export-with-title): New variable.
* ox (org-export-options-alist),
  ox-ascii.el (org-ascii-template--document-title),
  ox-beamer.el (org-beamer-template), ox-html.el (org-html-template),
  ox-latex.el (org-latex-template), ox-man.el (org-man-template),
  ox-odt.el (org-odt-template), ox-org.el (org-org-template),
  ox-publish.el (org-publish-project-alist),
  ox-texinfo.el (org-texinfo-template),
  ox-groff.el (org-groff--mt-head): Use new variable.
* ox-koma-letter.el (org-koma-letter-use-title): Mark obsolete.
* test-ox.el (test-org-export/parse-option-keyword): Add :with-title.
* ORG-NEWS, org.texi: Mention org-export-with-title.

This is useful in e.g. ox-html where title can be set via
`org-html-preamble-template' or when using the {{{title}}}-macro.
2015-02-12 01:45:39 +01:00
Nicolas Goaziou 16841306ed Use `org-element-copy'
* lisp/org.el (org-timestamp-split-range): Use `org-element-copy'.  Do
  not preserve :parent property anymore.

* lisp/ox.el (org-export-as): Use `org-element-copy'.

* testing/lisp/test-org.el (test-org/timestamp-split-range): Update test.
2015-02-09 10:15:59 +01:00
Rasmus 8f38f037b4 ox.el: {{{date}}} formatting argument
* ox.el (org-export-as): Allow {{{date}}} to take formatting-argument.
* org.texi (Macro replacement): Document {{{date}}} formatting.
* test-ox.el (test-org-export/expand-macro): Test {{{data(format)}}}
* org-NEWS: Mention optional {{{data}}} argument.

Optional argument to {{{date}}} like {{{date(FMT)}}} are treated
similar to {{{time(FMT)}}} if \#+DATE is a timestamp.
2015-02-09 01:47:21 +01:00
Charles Berry 638cde3ac9 lisp/ox.el: Enable removable inline src results
* lisp/ox.el: (org-export-as): Treat `results' as an `identity' macro
  with one argument after Babel executes.
2015-01-29 12:05:31 -08:00
Nicolas Goaziou a1f54021c9 org-element: Remove :alt-title property for headlines
* lisp/org-element.el (org-element-headline-parser): Remove :alt-title.
* lisp/ox.el (org-export-get-alt-title): Check regular :ALT_TITLE
  property instead of :alt-title.

`:alt-title' is an export-specific property. As a consequence, it's
value doesn't need to be parsed at "org-element.el"'s level. There, it
is treated as a regular property : `ALT_TITLE'.

This also removes the last call to
`org-element-parse-secondary-string' from "org-element.el".
2015-01-28 11:41:39 +01:00
Nicolas Goaziou b6fce5c90b ox: Prune parse tree before calling tree filter
* lisp/ox.el (org-export-collect-tree-properties): Do not
  set :ignore-list.
(org-export--populate-ignore-list): Remove function.
(org-export--selected-trees): Small refactoring.
(org-export-prune-tree): New function.
(org-export-remove-uninterpreted-data): Fix docstring.
(org-export-as): Prune tree before calling tree filter.

* testing/lisp/test-ox.el (org-test-with-parsed-data): Fix macro.

This patch introduces two changes in the export process:

  1. Non-exported elements are removed from the tree instead of being
     moved into an ignore list (with the exceptions of tables rows
     and cells)

  2. Parse tree filter is called on the tree being exported, not the
     original one.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/94162>
2015-01-23 23:59:23 +01:00
Nicolas Goaziou f15b17688c ox: Fix docstrings
* lisp/ox.el (org-export-dictionary, org-export-translate): Fix spaces
  at the end of sentences.  Do not upcase `car' and `cdr'.
2015-01-22 00:23:06 +01:00
Nicolas Goaziou 6b450ce81c ox: Remove `org-export-ignore-element'
* lisp/ox.el (org-export-ignore-element): Remove function.
(org-export-collect-tree-properties): Do not assume users can
modify :ignore-list export property.

* testing/lisp/test-ox.el (test-org-export/user-ignore-list): Remove
  test.

:ignore-property is an implementation detail, which should not be
exposed to users.  Also, it is easier to simply remove the element to
ignore from the parse tree with `org-element-extract-element'.
2015-01-22 00:11:35 +01:00
Nicolas Goaziou b07e2f6ff1 ox: Implement local table of contents
* lisp/ox.el (org-export-collect-headlines): Allow to collect
  headlines locally.
* testing/lisp/test-ox.el (test-org-export/collect-headlines): Add
  tests.

* lisp/ox-ascii.el (org-ascii--build-toc):
(org-ascii-keyword):
* lisp/ox-html.el (org-html-toc):
(org-html-keyword):
* lisp/ox-odt.el (org-odt-toc): Allow local table of contents.
(org-odt--format-toc): New function.
(org-odt-begin-toc, org-odt-end-toc): Remove functions.

* lisp/ox-latex.el (org-latex-logfiles-extensions): Optionally remove
  "ptc" files.
(org-latex-headline, org-latex-keyword): Implement partial table of
contents assuming "titletoc" package is loaded.

* etc/ORG-NEWS:
* doc/org.texi (Table of contents): Document new parameter.
2015-01-11 22:47:02 +01:00
Nicolas Goaziou 3900155788 Implement `org-export-custom-protocol-maybe' and use it
* lisp/ox.el (org-export-custom-protocol-maybe): New function.
* contrib/lisp/ox-groff.el (org-groff-link):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-texinfo.el (org-texinfo-link): Use new function.

* testing/lisp/test-ox.el (test-org-export/custom-protocol-maybe): New
  test.
2015-01-04 22:16:36 +01:00
Nicolas Goaziou 8ce845ba6c ox: Tiny refactoring
* lisp/ox.el (org-export-inline-image-p): Tiny refactoring.
2015-01-04 21:13:27 +01:00
Rasmus 130dcdb0cb ox.el: Infer :minlevel for INCLUDE-keywords
* ox.el (org-export-expand-include-keyword): Infer :minlevel for
included Org documents if not set explicitly.
* test-ox.el (org-export-expand-include-keyword): Add tests for inferred :minlevel.
2014-12-24 12:44:51 +01:00
rasmus 7509d6d721 ox.el: Fix footnote-bug in #+INCLUDE-keyword
* ox.el (org-export--prepare-file-contents): Preserve footnotes
when using the LINES argument.  New optional argument FOOTNOTES.
 (org-export-expand-include-keyword): New optional argument
 FOOTNOTES.
* test-ox.el (test-org-export/expand-include): Add test for INCLUDE
  with :lines and footnotes.
2014-12-24 11:58:50 +01:00
Nicolas Goaziou 61ba40c371 ox: Deprecate `org-export-get-genealogy' for `org-element-lineage'
* lisp/ox.el (org-export-collect-tree-properties,
  org-export-numbered-headline-p, org-export-get-tags,
  org-export-resolve-fuzzy-link, org-export-get-ordinal,
  org-export-get-parent-headline, org-export-get-parent-element,
  org-export-get-parent-table):

* lisp/ox-ascii.el (org-ascii--current-text-width):

* lisp/ox-beamer.el (org-beamer--frame-level):

* lisp/ox-icalendar.el (org-icalendar-blocked-headline-p):

* lisp/ox-latex.el (org-latex-footnote-reference):

* lisp/ox-odt.el (org-odt--enumerate, org-odt-link--infer-description,
  org-odt-table): Use `org-element-lineage' instead of
  `org-export-get-genealogy'.
2014-11-16 13:30:33 +01:00
Nicolas Goaziou a2f8a48ab5 Merge branch 'maint'
Conflicts:
	lisp/ox.el
2014-11-07 00:16:42 +01:00
Leslie H. Watter d4a4fc740e ox.el: Add pt_BR translations to export engine
* lisp/ox.el: (org-export-dictionary) Add pt_BR messages to the list.

TINYCHANGE
2014-11-06 23:47:28 +01:00
Nicolas Goaziou 1c34ec85b0 ox: Update INCLUDE keywords wrt property drawers
* lisp/ox.el (org-export--inclusion-absolute-lines): Fix comment.
(org-export--prepare-file-contents):  Do not look for property drawers
after a drawer, since this is impossible.

* testing/examples/include.org: Fix test data.
2014-10-28 14:23:52 +01:00
Nicolas Goaziou d849804ac7 ox: Remove unnecessary code comments 2014-10-24 21:13:47 +02:00
Nicolas Goaziou 89f5ad36d7 Merge branch 'maint' 2014-10-12 22:55:38 +02:00
Nicolas Goaziou a0ac1344fc ox: Fix 88457acff4
* lisp/ox.el (org-export-async-start): Limit first argument to lambda
  expressions.
* lisp/ox-publish.el (org-publish, org-publish-all,
  org-publish-current-file): Replace `ignore', per limit stated above.

Due to a hack allowing to provide quasi-quoted lambda expressions,
symbols are not allowed as result handler.  This limitation is not
much of a problem as `org-export-async-start' is only meant to be used
internally.
2014-10-12 22:53:01 +02:00
Aaron Ecay bc9a582f1e [export] Raise an error if footnote definition is not found.
* lisp/ox.el (org-export-get-footnote-definition): Raise an error if
footnote definition is not found.
2014-10-12 16:47:09 +01:00
Aaron Ecay 5f423f1208 Warn about unexpanded macros on export
* lisp/org-macro.el (org-macro-replace-all): Add optional `finalize'
argument.
* lisp/ox.el (org-export-as): Use it.
2014-10-12 16:47:09 +01:00
Nicolas Goaziou fac4677e51 Merge branch 'maint' 2014-10-10 11:11:06 +02:00
Nicolas Goaziou 88457acff4 ox: Fix "void-variable ignore" error when publishing
* lisp/ox.el (org-export-async-start): Allow to use symbols as
  function.

Thanks to Julien Cubizolles for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/91532
2014-10-10 11:05:06 +02:00
Rasmus 464cd965cb ox: Support unnumbered headlines via property
* ox.el (org-export--collect-headline-numbering): Ignore unnumbered headline.
(org-export-get-headline-id,
org-export--collect-unnumbered-headline-id): New functions.
(org-export-numbered-headline-p): Further tests for unnumbered headline.
* ox-odt.el (org-odt-headline, org-odt-link,
org-odt-link--infer-description)
ox-md.el (org-md-headline, org-md-link),
ox-latex.el (org-latex-headline, org.latex-link),
ox-html.el (org-html-headline, org-html-link),
ox-ascii.el (org-ascii-link): Support unnumbered headlines.
* test-ox.el (test-org-export/org-export-get-headline-id): New test.
* OrgOdtStyles.xml: Add styles for unnumbered headings.
2014-10-03 22:06:34 +02:00
Rasmus 986037a538 ox: Allow file-links with #+INCLUDE-keyword
* org.el (org-edit-special): Handle file-links for INCLUDE.
* ox.el (org-export--prepare-file-contents): Handle links and
add option no-heading.
* ox.el (org-export-expand-include-keyword): Resolve headline
links and add option :only-contents.
* orgguide.texi (Include files)
org.texi (Include files): Updated.
* testing/examples/include.org: New examples.
* test-ox.el (test-org-export/expand-include): New tests.
2014-10-02 18:51:37 +02:00
Nicolas Goaziou 39f5f03946 ox: Resurrect :input-buffer property
* lisp/ox.el (org-export--get-buffer-attributes):
  Resurrect :input-buffer property.

This property was removed in 604b9389. since it wasn't necessary
anymore internally.  It is back again as a consequence of a user
request.
http://permalink.gmane.org/gmane.emacs.orgmode/91230
2014-09-28 23:29:59 +02:00
Nicolas Goaziou 45a00a4d82 Merge branch 'maint' 2014-09-26 11:11:34 +02:00
Kyle Meyer 4f81b8cac0 ox.el: Fix typo in documentation
* lisp/ox.el (org-export-show-temporary-export-buffer): Fix typo.

TINYCHANGE
2014-09-26 11:11:02 +02:00
Nicolas Goaziou b5c9de618e Merge branch 'maint' 2014-09-08 12:10:28 +02:00
Nicolas Goaziou 7c48bdd7a8 Revert "ox: Implement predicate for export blocks"
This reverts commit 2160b3d242.
2014-09-08 12:09:52 +02:00
Nicolas Goaziou e3369c07f0 Revert "Merge export and special blocks within back-ends"
This reverts commit fbc7097ffa.

Conflicts:
	lisp/ox-texinfo.el
2014-09-08 11:57:27 +02:00
Nicolas Goaziou c235bd83d2 ox: Implement body filter
* lisp/ox.el (org-export-filters-alist): Add body filter.
(org-export-filter-body-functions): New variable.
(org-export-as): Call body filter.

* doc/org.texi (Advanced configuration):
* etc/ORG-NEWS (argument): Document new filter.
2014-09-06 10:28:38 +02:00
Nicolas Goaziou d47f66d6d0 ox: Implement `org-export-table-row-in-header-p'
* lisp/ox.el (org-export-table-row-in-header-p): New function.
(org-export-table-row-starts-header-p,
org-export-table-row-ends-header-p): Use new function.

* testing/lisp/test-ox.el (test-org-export/table-row-in-header-p): New
  test.
2014-08-26 15:05:52 +02:00
Nicolas Goaziou 81906c52ae ox: Extend first and last sibling predicates to all elements
* lisp/ox.el (org-export-first-sibling-p, org-export-first-sibling-p):
  Extend to all elements and objects.

* testing/lisp/test-ox.el (test-org-export/first-sibling-p,
  test-org-export/last-sibling-p): Add tests.

* etc/ORG-NEWS: Document change.
2014-08-26 14:48:05 +02:00
Nicolas Goaziou b1406dcddb Merge branch 'maint'
Conflicts:
	doc/org.texi
	lisp/ox-texinfo.el
2014-08-08 22:07:45 +02:00
Nicolas Goaziou 9f9aa52f14 ox: Provide output file name, if any, to back-ends
* lisp/ox.el (org-export-to-file): Provide output file name in
  communication channel, through :output-file property.

This change is needed to fix back-ends needing this information during
the process, e.g., `texinfo'.
2014-08-07 00:00:19 +02:00
Nicolas Goaziou 604b93892c ox: Title fallbacks to nil instead of file name
* lisp/ox.el (org-export--get-inbuffer-options):
(org-export-as): Remove title default value handling.
(org-export--get-buffer-attributes): Remove unnecessary property.

* doc/org.texi (Document title):
(Export settings):
* doc/orgguide.texi (Export options): Update documentation.

* testing/lisp/test-ox.el (test-org-export/set-title): Update tests
  according to new specifications.
2014-08-02 21:14:22 +02:00
Nicolas Richard 350fdfd676 ox: Signal an error if keyword is unknown while defining backends
* lisp/ox.el (org-export-define-backend):
(org-export-define-derived-backend): Signal an error if keyword is
unknown.
2014-07-31 12:22:00 +02:00
Nicolas Goaziou bc43228e6d Remove `export-block' syntax type
* lisp/org-element.el (org-element-all-elements): Remove
  `export-block' type.
(org-element-block-name-alist): Make it a defconst since it is not
meant to be changed anymore.
(org-element-export-block-parser,
org-element-export-block-interpreter): Remove functions.

* lisp/ox.el (org-export-filters-alist): Remove export block filter.
(org-export-register-backend): Do not alter
`org-export-block-name-alist' anymore.
(org-export-define-backend, org-export-define-derived-backend): Update
docstring.
(org-export-filter-export-block-functions): Remove variable.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser,
  test-org-element/export-block-interpreter): Remove tests.

* testing/lisp/test-ox.el (test-org-export/define-backend): Update test.
2014-07-27 14:29:21 +02:00
Nicolas Goaziou b77a026a24 Merge branch 'maint' 2014-07-27 14:28:53 +02:00
Nicolas Goaziou 2160b3d242 ox: Implement predicate for export blocks
* lisp/ox.el (org-export-raw-special-block-p): New function.

* testing/lisp/test-ox.el (test-org-export/raw-special-block-p): New
  test.

This patch is a forward-compatibility measure since the function is
mandatory for export back-ends in Org 8.3. It makes it easier for
back-end maintainers to provide a back-end compatible with both Org
8.2 and 8.3.
2014-07-27 14:25:44 +02:00
Nicolas Goaziou 8d0f7340ed ox: Fix inline footnote definitions
* lisp/ox.el (org-export-collect-tree-properties): Make sure changes
  to the parse tree propagate to the value of
  `org-export-get-footnote-definition'.

Thanks to Florian Beck for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/88419
2014-07-16 16:11:52 +02:00
Nicolas Goaziou ca6ecf9e49 org-element: Remove :inline-definition from inline footnotes
* lisp/org-element.el (org-element-recursive-objects): Add
  `footnote-reference'.
(org-element-secondary-value-alist): Remove reference to
`footnote-reference'.
(org-element-footnote-reference-parser): Definition for inline
references is stored as the contents of the reference, not in
a secondary string.
(org-element-footnote-reference-interpreter): Apply changes from
parser.

* lisp/ox.el (org-export-get-footnote-definition,
  org-export-get-environment): Apply changes from parser.

* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
  Update test.
(test-org-element/context): Add test.

Storing definition in a secondary string was a poor design choice as
there is no "primary" string anyway.  This also prevents
`org-element-context' from finding objects within the inline
definition.
2014-07-06 11:24:12 +02:00
Nicolas Goaziou 8b959237fc ox: Small refactoring
* lisp/ox.el (org-export-get-category): Refactor code.
2014-06-18 23:30:54 +02:00
Achim Gratz 4ed554196b ox: implement additional #+INCLUDE markup
* lisp/ox.el (org-export-expand-include-keyword): Change parsing so
  that arbitrary blocks around the included content can be used.
  Content is not code-escaped unless it is a literal block, this
  applies to "src" and "example".
* doc/org.texi (Include files): Document the additional markup.
* testing/lisp/test-ox.el (test-org-export/expand-include): Add test
  for an #+INCLUDE with "html" and "center" markup.
* testing/examples/include.html: New file, used for testing
  "#+INCLUDE html".
2014-06-07 18:02:52 +02:00
Nicolas Goaziou 38ac0d8b56 Merge branch 'maint'
Conflicts:
	lisp/ox.el
2014-06-03 22:13:31 +02:00
Nicolas Goaziou 0fbc4893ed ox: Fix priority bug in :title property
* lisp/ox.el (org-export--get-inbuffer-options): Return the empty
  string instead of nil when TITLE keywords has no value.
(org-export--get-buffer-attributes): Do not set :title property
early.
(org-export--get-global-options): Do not ignore anymore nil values.
Small refactoring.
(org-export-as): Correctly set :title here.

Thanks to Nicolas Richard for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/87149
2014-06-03 22:07:35 +02:00
Achim Gratz 5bf928bae7 Merge branch 'maint'
Conflicts:
	lisp/ob-core.el
	lisp/org.el
	lisp/ox.el
2014-05-28 16:23:08 +02:00
Achim Gratz 6c1b41bd68 org, ox: move defsubst before first use
* lisp/ox.el (org-export-get-parent): Move definition of
  'org-export-get-parent' before first use.  Leave comment at original
  place of definition.

* lisp/org.el (org-uniquify): Move definition of 'org-uniquify' before
  first use.  Leave comment at original place of definition.
2014-05-28 13:44:53 +02:00