Commit Graph

553 Commits

Author SHA1 Message Date
Nik Clayton ded3d27b14 ox-html: Wrap each line of a source block in a code element
* lisp/ox-html.el (org-html-do-format-code): Wrap each line of a source block
in a code element.

This makes it straightforward to add custom decorations to each line
using CSS :before and :after properties.

TINYCHANGE
2019-06-07 23:32:08 +02:00
Sacha Chua a41e9950ae Add :target option for the TOC keyword
* doc/org-manual.org, etc/ORG_NEWS: Document :target option
  for the TOC keyword.

* lisp/ox.el (org-export-resolve-link): New function.

* lisp/ox-ascii.el (org-ascii-keyword): Added :target to the TOC
  keyword.
  (org-ascii--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-html.el (org-html-keyword): Added :target to the TOC keyword.

* lisp/ox-md.el (org-md-keyword): Added :target to the TOC keyword.
  (org-md--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-odt.el (org-odt-keyword): Added :target to the TOC keyword.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Added
  tests for specifying scope by CUSTOM_ID or by fuzzy matching.
  (test-org-export/resolve-link): New test.
2019-05-30 15:25:46 +02:00
Nicolas Goaziou ff2bf22655 ox-html: Small refactoring
* lisp/ox-html.el (org-html--build-pre/postamble): Prefer `and' over
  `when' for short Sexps where return value matters.
2019-05-21 10:24:11 +02:00
Nicolas Goaziou f45caca608 Merge branch 'maint' 2019-05-21 10:17:37 +02:00
Nicolas Goaziou 31873ed27d ox-html: Do not generate empty validation link
* lisp/ox-html.el (org-html--build-pre/postamble): Do not generate
  empty validation link.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-05/msg00153.html>
2019-05-21 10:16:51 +02:00
Nicolas Goaziou 819864aebb Merge branch 'maint' 2019-02-27 21:56:36 +01:00
Nicolas Goaziou cc7c4a6732 Rationalize `org-link-(un)escape'
* contrib/lisp/org-contacts.el (org-contacts-vcard-format):
* contrib/lisp/org-link-edit.el (org-link-edit--link-data):
* contrib/lisp/org-notmuch.el (org-notmuch-search-store-link):
(org-notmuch-search-follow-link):
(org-notmuch-tree-follow-link):
* lisp/org-docview.el (org-docview-export):
* lisp/org-element.el (org-element-link-parser):
* lisp/org-lint.el (org-lint-link-to-local-file):
* lisp/org-protocol.el (org-protocol-split-data):
(org-protocol-parse-parameters):
* lisp/org.el (org-open-at-point):
(org-display-inline-images):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex--inline-image):
(org-latex-link):
* lisp/ox-publish.el (org-publish-resolve-external-link):
* lisp/ox.el (org-export-custom-protocol-maybe):
(org-export-resolve-fuzzy-link): Do not call `org-link-unescape' when
the link is obtained through the parser or as a user input.
* doc/org-manual.org (Link Format): Document escape syntax.

See <http://lists.gnu.org/r/emacs-orgmode/2019-02/msg00320.html>
2019-02-27 20:22:51 +01:00
Kyle Meyer ba321d0e44 Merge branch 'maint' 2019-01-13 15:14:37 -05:00
Paul Eggert d64c9a996b Backport commit 662bee7d7 from Emacs
* lisp/ob-eval.el (org-babel--shell-command-on-region):
* lisp/org-attach.el (org-attach-commit):
* lisp/org-macro.el (org-macro-initialize-templates):
* lisp/org.el (org-babel-load-file)
(org-file-newer-than-p):
* lisp/ox-html.el (org-html-format-spec):
* lisp/ox-publish.el (org-publish-find-date)
(org-publish-cache-ctime-of-src):
Prefer (file-attribute-size A) to (nth 7 A), and similarly
for other file attributes accessors.
* lisp/ox-publish.el (org-publish-cache-ctime-of-src):
Prefer float-time to doing time arithmetic by hand.

file-attributes cleanup
662bee7d70ccd3903e123b08c7ec9108a1a2ce0b
Paul Eggert
Sun Sep 23 18:32:59 2018 -0700
2019-01-13 12:43:04 -05:00
Paul Eggert d4a295e46a Backport commit 2fcf2dff0 from Emacs
Fix copyright years by hand
2fcf2dff00a55ece17f4342a934cb1d69ae1a743
Paul Eggert
Tue Jan 1 01:02:40 2019 +0000
2019-01-13 12:43:03 -05:00
Bastien 7a22b8f93b Merge branch 'maint' 2019-01-01 11:54:01 +01:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Toon Claes e37412b5d2 ox-html: Make it possible to self link headlines
* lisp/ox-html.el (org-html-self-link-headlines): New variable.
(org-html-headline): Create a hyperlink on headlines
when :html-self-link-headlines is set.
2018-12-29 14:58:43 +01:00
Nicolas Goaziou f8533978db Merge branch 'master' into next 2018-12-08 21:21:10 +01:00
Jens Lechtenboerger 3b5e26651b ox-html: Export attributes specified with :attr_html for links
* lisp/ox-html.el (org-html-link): Export :attr_html from link.
2018-12-08 21:20:18 +01:00
Jens Lechtenboerger 94d2dbf95f ox-html: New property HTML_HEADLINE_CLASS for class of headline
* lisp/ox-html.el (org-html-headline): Add new property
HTML_HEADLINE_CLASS to assign class attribute to headline.

* doc/org-manual.org (CSS support): Document new property
HTML_HEADLINE_CLASS.
2018-12-08 12:45:22 +01:00
Nicolas Goaziou 524be7cdb1 ox-html: Fix consistency between footnote definitions
* lisp/ox-html.el (org-html-footnote-section): Wrap inline inline
  footnote definitions within a paragraph.

Reported-by: Matthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00006.html>
2018-10-03 15:26:14 +02:00
Nicolas Goaziou 17edaf8c14 "src block" -> "source block" in documentation and comments
* etc/ORG-NEWS (Maxima: new headers ~:prologue~ and ~:epilogue~):
(Texinfo exports inline source blocks as ~@code{}~):
(Default lexical evaluation of emacs-lisp source blocks):
* lisp/ob-clojure.el (org-babel-clojure-default-ns):
* lisp/ob-core.el (org-babel-named-src-block-regexp-for-name):
(org-babel-current-src-block-location):
(org-babel-mark-block):
(org-babel-insert-result):
* lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-lob.el (org-babel-lob-ingest):
* lisp/ob-ref.el:
* lisp/org-element.el (org-element-object-restrictions):
(org-element-src-block-parser):
(org-element-inline-src-block-parser):
* lisp/org-lint.el:
(org-lint--checkers):
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src):
* lisp/org-src.el (org-edit-inline-src-code):
* lisp/org.el (org-ctrl-c-ctrl-c):
(org-in-src-block-p):
(org-fill-element):
* lisp/ox-html.el (org-html--textarea-block):
(org-html-format-code):
* lisp/ox-latex.el (org-latex-minted-options):
(org-latex-custom-lang-environments):
* lisp/ox-md.el:
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-collect-listings):
* testing/lisp/test-ob-exp.el (ob-exp/src-block-with-affiliated-keyword):
* testing/lisp/test-ob.el (test-ob/preserve-results-indentation):
  Correct "src block" occurrences when they do not specifically refer
  to the element type `src-block'.
2018-09-20 11:23:49 +02:00
Nicolas Goaziou 50aca8422b ox-html: Remove references to Github
* lisp/ox-html.el (org-html-htmlize-generate-css):
(org-html-fontify-code): Remove references to Github.

Fixes: bug#32722
2018-09-18 23:03:24 +02:00
Aaron Ecay 5192e810ae Add “summary” to ‘org-html-html5-elements’
* lisp/ox-html.el (org-html-html5-elements): Add “summary”

As suggested by Kaushal Modi in
<https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%2Bmessage-id%3A%3CCAFyQvY2YoLDpM9PWLV86FwvPOVkuxg9O8KdryG3z%3D5QRm7Aujg%40mail.gmail.com%3E&submit=Search&idxname=emacs-orgmode>
2018-05-27 16:59:15 +01:00
Aaron Ecay 673165c035 ox-*: single-armed “if” -> “when”
* lisp/ox-html.el (org-html-htmlize-generate-css):
(org-html-template, org-html-final-function):
* lisp/ox-publish.el (org-publish-cache-set-file-property):
* lisp/ox-texinfo.el (org-texinfo-quote-block): Transform ‘if’ with no
else to ‘when’.
2018-05-10 01:17:12 +01:00
Nicolas Goaziou e8a4f39e73 Merge branch 'maint' 2018-05-04 00:26:37 +02:00
Nicolas Goaziou 064caac937 ox-html: Make use of :html-preamble/postamble-format
* lisp/ox-html.el (org-html--build-pre/postamble): Use
`:html-preamble-format' and `:html-postamble-format' instead of
relying on the global variables.

Reported-by: Brady Trainor <mail@bradyt.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00073.html>
2018-05-04 00:24:36 +02:00
Kyle Meyer 47908228e7 Merge branch 'maint' 2018-02-18 16:33:04 -05:00
Glenn Morris 4ddfc6bd69 Backport commit 66a4e651f from Emacs
; Fix doc typos related to indefinite articles
66a4e651f3cf38c320d1a9d5ae6f88dcc641792b
Glenn Morris
Fri Feb 16 15:16:15 2018 -0500
2018-02-18 16:32:41 -05:00
Nicolas Goaziou 0155441358 Merge branch 'maint' 2018-01-19 18:22:00 +01:00
Tim Landscheidt b289a65be7 Use https for links to orgmode.org
TINYCHANGE
2018-01-19 18:14:58 +01:00
thibault ba6c0f1ea9 ox-html: Add label and number to equations in HTML export
* lisp/ox-html.el (org-html--wrap-latex-environment): New function.
(org-html--math-environment-p): New function.
(org-html-latex-environment): Use `org-html--wrap-latex-environment' to
wrap equation in HTML container (non-MathJax modes).  Make latex
environment unnumbered when compiling equations to images.  Insert latex
label in environment in MathJax mode.
(org-html-link): Calculate equation number limiting counter to equation
environments.  Use eqref for link when using MathJax
(org-html--make-unlabelled-latex-environment): New function.
2018-01-17 22:24:31 +01:00
Bastien ebb67cebe5 Merge branch 'maint' 2018-01-15 16:39:11 +01:00
Bastien ad390e895a ox-html.el (org-html-head): Fix docstring
* ox-html.el (org-html-head): Fix docstring.

Thanks to Adam Porter for reporting this.
2018-01-15 16:38:33 +01:00
Kyle Meyer d94f7024bc Merge branch 'maint' 2018-01-07 00:28:35 -05:00
Kyle Meyer 3e1641ef0a Update copyright years 2018-01-07 00:27:54 -05:00
Nicolas Goaziou 0c691737aa Merge branch 'maint' 2017-12-04 08:24:19 +01:00
thibault e22ee8b8a3 Fix bug in HTML export of code blocks with starting blank lines
* lisp/ox-html.el (org-html-do-format-code): Preverse starting blank
  lines when splitting code lines (use `split-string' instead of
  `org-split-string').

  (org-html-fontify-code): Preserve starting blank lines in returned
  code string.
2017-12-04 08:24:02 +01:00
Nicolas Goaziou 579fa12f50 Merge branch 'maint' 2017-11-26 11:02:14 +01:00
Nicolas Goaziou 18f6610b32 ox-html: Fix last commit
* lisp/ox-html.el (org-html-link): Fix last commit.
2017-11-26 10:57:02 +01:00
Nicolas Goaziou b0ab7008df Merge branch 'maint' 2017-11-26 10:47:55 +01:00
Nicolas Goaziou 6aac798f25 Fix publishing links to absolute file names belonging to project
* lisp/ox-publish.el (org-publish-file-relative-name): New function.
* lisp/ox-html.el (org-html-link): Use new function.

* testing/lisp/test-ox-publish.el (test-org-publish/file-relative-name):
  New test.
2017-11-26 10:46:53 +01:00
Nicolas Goaziou 9cac9d7bc7 Merge branch 'maint' 2017-11-12 23:29:38 +01:00
Chunyang Xu 3f8d67c490 ox-html: Allow disabling htmlize
* lisp/ox-html.el (org-html-fontify-code): Do it.

Disable htmlize by setting org-html-htmlize-output-type to nil.

TINYCHANGE
2017-11-12 23:28:57 +01:00
Nicolas Goaziou 7df5d21f79 Merge branch 'maint' 2017-10-14 12:30:59 +02:00
Nicolas Goaziou 827af59873 Fix links without contents in table of contents' entries
* lisp/ox.el (org-export-toc-entry-backend): New function.

* lisp/ox-html.el (org-html--format-toc-headline):
* lisp/ox-md.el (org-md--build-toc):
* lisp/ox-odt.el (org-odt-toc): Use new function.

* lisp/ox-texinfo.el (org-texinfo--sanitize-title):
(org-texinfo--wrap-float): Handle links without contents.

* testing/lisp/test-ox.el (test-org-export/toc-entry-backend): New
  test.

Reported-by: ConcreteVitamin <concretevitamin@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-10/msg00235.html>
2017-10-14 12:29:52 +02:00
Nicolas Goaziou cf35109ad8 Merge branch 'maint' 2017-09-19 22:01:07 +02:00
N. Raghavendra db1dab8abe ox-html.el: Partially revert d5bbf36553
* lisp/ox-html.el (org-html-src-block): Unless klipse is used, export
source code blocks as content of `pre' elements, and not as content of
`code' children of `pre' elements.  Restores the previous way of
exporting source code blocks, and fixes the display of language
indicators while hovering over the blocks in the exported HTML file,
when klipse is not used.
(org-html-keep-old-src): Remove it.  Not needed because it is now the
default, unless klipse is used.
2017-09-19 22:00:32 +02:00
Kyle Meyer 297acd7517 Merge branch 'maint' 2017-09-17 01:17:10 -04:00
Paul Eggert d4d7cda57f Backport commit 5da53a019 from Emacs
* lisp/org-info.el (org-info-other-documents)
(org-info-map-html-url):
* lisp/ox-html.el (org-html-creator-string): Use HTTPS instead of
HTTP.

Prefer HTTPS to HTTP for gnu.org
5da53a01912c2f5d46f5df4ef8cc13a34b5017d4
Paul Eggert
Wed Sep 13 15:54:25 2017 -0700
2017-09-17 00:09:11 -04:00
Nicolas Goaziou 3944547bf2 Merge branch 'maint' 2017-09-14 14:47:15 +02:00
Nicolas Goaziou 7584268314 ox-html: Fix missing Mathjax config with maths elements in captions
* lisp/ox-html.el (org-html--build-mathjax-config): Fix missing
  Mathjax config with maths elements in captions.

Reported-by: Lawrence Bottorff <borgauf@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-09/msg00302.html>
2017-09-14 14:40:33 +02:00
Nicolas Goaziou 007bbddbcc ox-html: Prevent spurious target below headlines
* lisp/ox-html.el (org-html-headline):
(org-html-link): Do not insert an additional target.

* lisp/ox-publish.el (org-publish-resolve-external-link): Add an
  optional argument.

* lisp/ox.el (org-export-get-reference): Improve docstring.

* testing/examples/pub/a.org:
* testing/examples/pub/b.org: New files.
* testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link):
  New test.
2017-09-10 00:23:42 +02:00
Bastien d0ced98943 Delete htmlize.el from Org’s contrib directory
* lisp/ox-org.el (org-org-publish-to-org):
* lisp/ox-html.el (org-html-htmlize-generate-css):
(org-html-fontify-code):
* lisp/org-agenda.el (org-agenda-write): Throw an error
requesting the user to install htmlize.el.

* doc/org.texi (Exporting agenda views, Literal examples):
Don’t assume htmlize.el is available.

You need to install it from https://github.com/hniksic/emacs-htmlize

See https://github.com/hniksic/emacs-htmlize/issues/7 for this issue.
2017-08-18 09:54:19 +02:00
Kaushal Modi c8ade76ca2 Fix blank titles resulting in export of invalid HTML
* lisp/ox-html.el (org-html--build-meta-info): Use an invisible
  character "&lrm;" (left-to-right mark) in the HTML title tags
  instead of removing the title altogether (invalid HTML) or setting
  the content of title tag to nothing (invalid HTML).

Discussion:
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00021.html>
2017-08-14 16:11:32 -04:00
Rasmus 8ab9a82be2 ox-html: Respect the "title" option
* lisp/ox-html.el (org-html-template): Respect :with-title.

Reported-by: lists@wilkesley.net
<http://permalink.gmane.org/gmane.emacs.orgmode/114942>
2017-08-09 11:39:56 +02:00
Kyle Meyer d39ccc17d4 Merge branch 'maint' 2017-07-09 11:28:54 -04:00
Glenn Morris ef742df8b5 Backport commit 26a308ea1 from Emacs
* lisp/ox-html.el (org-html-infojs-template): Update copyright.

26a308ea112637911fd3870139ba0e2d98e58aa0
Glenn Morris
Wed Jul 5 14:07:14 2017 -0400
2017-07-09 11:27:10 -04:00
Rasmus acabacaa56 ox-html: Use correct "br" tag for subtitle
* lisp/ox-html.el (org-html-template): Use correct "br" tag depending
  on :html-doctype.

Reported-by: Olivier Berger <olivier.berger@telecom-sudparis.eu>
<http://permalink.gmane.org/gmane.emacs.orgmode/114546>
2017-07-04 18:50:39 +02:00
Nicolas Goaziou 865ac0952b Merge branch 'maint' 2017-05-15 18:29:23 +02:00
Nicolas Berthier 2c9f6fcef9 Fontify inline source blocks when exporting to HTML
* lisp/ox-html.el (org-html-inline-src-block): Fontify inline source
blocks.
2017-05-15 18:28:34 +02:00
Nicolas Goaziou be90287802 Merge branch 'maint' 2017-04-16 09:00:04 +02:00
aviv 842a75828f Updating MathJax CDN links
* doc/org.texi : Change reference to "cdn.mathjax.org" to "cdnjs.com",
  removing comment about no longer relevant terms of service.
* lisp/ox-html.el (org-html-mathjax-options) : Change link to
  appropriate cdnjs.com link to load MathJax.

Updating MathJax CDN links to reflect cdnjs.com as cdn.mathjax.org
will be disconitnued as of 30 April 2017.

TINYCHANGE
2017-04-16 08:59:05 +02:00
Bastien 8a7fe3c219 Merge branch 'maint' 2017-03-23 23:49:11 +01:00
Bastien e3ed81c98d ox-html.el (org-html-scripts): Fix copyright years
* lisp/ox-html.el (org-html-scripts): Fix copyright years.
2017-03-23 23:46:13 +01:00
Matt Price d5bbf36553 ox-html: Allow displaying source code block using klipse
* lisp/ox-html.el (html, org-html-template)
(org-html-src-block): Allow to display source code block using
the klipse javascript plugin.

Thanks to Nicolas Goaziou for reviewing the patch.
2017-03-23 23:22:30 +01:00
Simon Michael 09ee728c64 Babel support for hledger accounting tool
* lisp/ob-hledger.el: New file.
* lisp/org.el (org-babel-load-languages):
* lisp/ox-html.el (org-html-style-default): Allow calling hledger from
  Babel.
2017-03-14 18:19:26 +01:00
Nicolas Goaziou 2f48603d71 Merge branch 'maint' 2017-03-08 00:15:26 +01:00
Nicolas Goaziou 64a5f9a596 ox-html: Fix verse blocks
* lisp/ox-html.el (org-html-verse-block): Add missing line break at
  the end of each line in verse environments.

Reported-by: Skip Collins <skip.collins@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112537>
2017-03-08 00:12:55 +01:00
Nicolas Goaziou 4caad0555f ox-html: Fix last commit (part 2)
* lisp/ox-html.el (org-html-plain-list): Fix typo.
2017-02-14 17:27:26 +01:00
Nicolas Goaziou 0890cc7b6c ox-html: Fix last commit
* lisp/ox-html.el (org-html-plain-list): Fix last commit.
2017-02-14 16:34:17 +01:00
Nicolas Goaziou 54734bd69d ox-html: Silence byte-compiler
* lisp/ox-html.el (org-html-plain-list): Silence byte-compiler.  Small
  refactoring.
2017-02-14 16:32:44 +01:00
Rasmus ea16d4ca8f ox-html: More newlines around lists
* lisp/ox-html.el (org-html-headline):
(org-html-format-list-item):
(org-html-section): Insert more newlines.
2017-02-14 15:15:28 +01:00
Rasmus 8855c23c68 ox-html: Plain list supports arbitrary attributes
* lisp/ox-html.el (org-html-begin-plain-list):
(org-html-end-plain-list): Remove.
(org-html-plain-list):
(org-html-headline): Remove dependency on org-html-begin-plain-list
		     and org-html-end-plain-list.
2017-02-14 12:14:14 +01:00
Kyle Meyer 7278899697 Merge branch 'maint' 2017-01-26 00:05:29 -05:00
Kyle Meyer 7c710f6f57 Change :version in defcustoms from "25.2" to "26.1"
* lisp/ob-J.el (org-babel-J-command):
* lisp/ob-core.el (org-babel-hash-show-time):
* lisp/ob-exp.el (org-babel-exp-inline-code-template):
* lisp/ob-lisp.el (org-babel-lisp-eval-fn):
* lisp/org-agenda.el (org-agenda-view-columns-initially):
* lisp/org-attach.el (org-attach-commit):
(org-attach-archive-delete):
(org-attach-annex-auto-get):
* lisp/org-bibtex.el (org-bibtex-inherit-tags):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-colview.el (org-columns-summary-types):
* lisp/org-faces.el (org-block):
* lisp/org-src.el (org-src-block-faces):
* lisp/org-table.el (org-table-copy-increment):
(org-table-formula-create-columns):
(org-table-convert-region-max-lines):
* lisp/org-timer.el (org-timer-default-timer):
* lisp/org.el (org-export-backends):
(org-show-context-detail):
(org-cycle-hook):
(org-occur-case-fold-search):
(org-preview-latex-default-process):
(org-preview-latex-process-alist):
(org-preview-latex-image-directory):
(org-latex-default-packages-alist):
(org-sparse-tree-default-date-type):
(org-structure-template-alist):
(org-effort-durations):
(org-agenda-ignore-properties): Change :version from "25.2" to "26.1".
(customize-package-emacs-version-alist): Fix associations between Org
and Emacs releases.
* lisp/ox-ascii.el (org-ascii-list-margin):
* lisp/ox-beamer.el (org-beamer-subtitle-format):
* lisp/ox-html.el (org-html-format-headline-function):
(org-html-format-inlinetask-function):
(org-html-viewport):
* lisp/ox-latex.el (org-latex-caption-above):
(org-latex-prefer-user-labels):
(org-latex-subtitle-format):
(org-latex-hyperref-template):
(org-latex-footnote-defined-format):
(org-latex-images-centered):
(org-latex-default-figure-position):
(org-latex-text-markup-alist):
(org-latex-format-inlinetask-function):
(org-latex-custom-lang-environments):
(org-latex-compiler-file-string):
(org-latex-compiler):
(org-latex-bib-compiler):
(org-latex-logfiles-extensions):
(org-latex-known-warnings):
* lisp/ox-md.el (org-md-footnotes-section):
(org-md-footnote-format):
* lisp/ox-odt.el (org-odt-format-headline-function):
(org-odt-format-inlinetask-function):
(org-odt-inline-image-rules):
* lisp/ox-texinfo.el (org-texinfo-format-headline-function):
* lisp/ox.el (org-export-with-creator):
(org-export-with-title):
(org-export-with-broken-links):
(org-export-copy-to-kill-ring): Change :version from "25.2" to "26.1".

It looks like the goal is to sync Org 9.0.* (maint) with the Emacs
master branch (what will be version 26.1):
https://lists.gnu.org/archive/html/emacs-orgmode/2017-01/msg00558.html
2017-01-26 00:02:03 -05:00
Nicolas Goaziou dcad3499af Merge branch 'maint' 2017-01-25 17:58:54 +01:00
Nicolas Goaziou b6b1e35f33 ox-html: Remove <p> tag around block images when using HTML5
* lisp/ox-html.el (org-html--wrap-image): Do not add a spurious <p>
  tag when using <figure> to mark images.

Reported-by: Matt Price <moptop99@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111568>
2017-01-25 17:58:07 +01:00
Nicolas Goaziou 969d14deef Merge branch 'maint' 2017-01-24 18:20:22 +01:00
Nicolas Goaziou 9f4c77cb6c ox-html: Fix missing space in coderef links
* lisp/ox-html.el (org-html-link): Add missing space.

Reported-by: dmg <dmg@turingmachine.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/111625>
2017-01-24 18:19:23 +01:00
Nicolas Goaziou 343417bcdb Merge branch 'maint' 2017-01-12 14:48:53 +01:00
Nicolas Goaziou 0e626313e1 ox-html: Fix verse environment
* lisp/ox-html.el (org-html-verse-block): Do not insert duplicates
  "br" close-tags.  Refactor code.
2017-01-12 14:47:32 +01:00
Nicolas Goaziou 1d57c5670a ox-html: Fix docstrings style
* lisp/ox-html.el (org-html-close-tag):
(org-html-doctype):
(org-html--make-attribute-string): Fix docstring style.
2017-01-12 09:58:50 +01:00
Nicolas Goaziou ee181b3250 ox-html: Remove spurious white space when closing a tag
* lisp/ox-html.el (org-html-close-tag): Remove spurious white space
  when no attribute is given.  Add a docstring.
2017-01-12 09:54:22 +01:00
Kyle Meyer 0d3683f2cd Merge branch 'maint' 2017-01-05 20:23:58 -05:00
Kyle Meyer 713f785017 Update copyright years 2017-01-05 20:19:37 -05:00
Nicolas Goaziou 5ffb373a2c Implement `org-export-insert-image-links'
* lisp/ox.el (org-export-insert-image-links):
* lisp/ox-odt.el (org-odt--translate-image-links):
* lisp/ox-latex.el (org-latex-image-link-filter):
* lisp/ox-html.el (org-html-image-link-filter): New functions.
2016-12-17 11:36:49 +01:00
Nicolas Goaziou 1319a3be44 ox-html: Fix %d placeholder in pre/postamble string
* lisp/ox-html.el (org-html-format-spec): Correctly apply
  `org-html-metadata-timestamp-format' on %d placeholder.

Reported-by: Pavel Panchekha <me@pavpanchekha.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110374>
2016-11-19 23:17:32 +01:00
Nicolas Goaziou 1d7150319b Fix docstrings
* lisp/org-clock.el (org-clock-get-table-data):
* lisp/org-element.el (org-element--cache-objects):
(org-element--cache-generate-key):
* lisp/org-footnote.el (org-footnote--collect-references):
* lisp/org-list.el (org-list-to-lisp):
* lisp/org-table.el (orgtbl-to-generic):
* lisp/org.el (org-file-apps):
(org-execute-file-search-functions):
(org-after-todo-statistics-hook):
(org-find-olp):
* lisp/ox-html.el (org-html-table-row-open-tag): Do not escape
  parenthesis in docstring when not at column 0.
2016-10-31 10:01:33 +01:00
Nicolas Goaziou 0cf58cc208 Improve docstrings
* lisp/ob-core.el (org-confirm-babel-evaluate):
(org-babel-no-eval-on-ctrl-c-ctrl-c):
(org-babel-hash-at-point):
* lisp/org-agenda.el (org-agenda-custom-commands):
(org-stuck-projects):
(org-agenda):
(org-timeline):
(org-todo-list):
(org-agenda-filter-by-tag):
(org-agenda-log-mode):
(org-agenda-refile):
(org-agenda-show-and-scroll-up):
(org-agenda-tree-to-indirect-buffer):
(org-agenda-show-the-flagging-note):
(org-agenda-to-appt):
* lisp/org-capture.el (org-capture-mode):
(org-capture-use-agenda-date):
(org-capture):
* lisp/org-clock.el (org-clock-in):
(org-clock-display):
* lisp/org-colview.el (org-columns--display-here):
(org-columns):
* lisp/org-footnote.el (org-footnote-section):
* lisp/org-gnus.el (org-gnus-prefer-web-links):
* lisp/org-lint.el (org-lint):
* lisp/org-list.el (org-plain-list-ordered-item-terminator):
(org-list-allow-alphabetical):
(org-list-automatic-rules):
(org-list-use-circular-motion):
* lisp/org-protocol.el (org-protocol-store-link):
(org-protocol-create-for-org):
* lisp/org-src.el (org-src-preserve-indentation):
(org-edit-src-content-indentation):
(org-src-mode-hook):
(org-src-mode):
(org-edit-table.el):
(org-edit-export-block):
(org-edit-src-code):
(org-edit-fixed-width-region):
* lisp/org-table.el (org-table-automatic-realign):
(org-table-copy-increment):
(org-table-formula-evaluate-inline):
(org-table-allow-automatic-line-recalculation):
(org-table-edit-field):
(orgtbl-ascii-plot):
* lisp/org-timer.el (org-timer):
* lisp/org.el (org-deadline-string):
(org-comment-string):
(org-ellipsis):
(org-show-context-detail):
(org-indirect-buffer-display):
(org-cycle-global-at-bob):
(org-insert-heading-respect-content):
(org-enable-table-editor):
(org-context-in-file-links):
(org-display-internal-link-with-indirect-buffer):
(org-file-apps):
(org-refile-targets):
(org-todo-keywords):
(org-use-fast-todo-selection):
(org-treat-insert-todo-heading-as-state-change):
(org-time-clocksum-use-fractional):
(org-time-clocksum-use-effort-durations):
(org-agenda-files):
(org-cycle-hide-archived-subtrees):
(org-cycle):
(org-global-cycle):
(org-tree-to-indirect-buffer):
(org-insert-heading):
(org-store-link):
(org-insert-link):
(org-mark-ring-push):
(org-refile):
(org-todo):
(org-show-todo-tree):
(org-reveal):
(org-check-deadlines):
(org-switchb):
(org-cdlatex-mode):
(org-toggle-latex-fragment):
(org-ctrl-c-ctrl-c):
(org-toggle-heading):
(org-indent-line):
(org-yank):
(org-speedbar-set-agenda-restriction):
* lisp/ox-html.el (org-html-htmlize-output-type):
* lisp/ox-icalendar.el (org-icalendar-combined-agenda-file):
* lisp/ox-publish.el (org-publish-project-alist):
* lisp/ox.el (org-export-in-background):
(org-export-stack-mode):
(org-export--stack-source-at-point):
(org-export-dispatch): Improve quotes and formatting in docstrings.
2016-10-15 17:43:54 +02:00
Nicolas Goaziou 0c0bc84190 Change "Org-mode" into "Org mode"
* lisp/org-agenda.el:
* lisp/org-attach.el:
* lisp/org-bbdb.el:
* lisp/org-capture.el:
* lisp/org-clock.el:
* lisp/org-entities.el:
* lisp/org-gnus.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-info.el:
* lisp/org-inlinetask.el:
* lisp/org-irc.el:
* lisp/org-list.el:
* lisp/org-mhe.el:
* lisp/org-mouse.el:
* lisp/org-table.el:
* lisp/ox-html.el:
* lisp/ox-odt.el: Use "Org mode", or "Org", instead of "Org-mode".
2016-10-11 18:00:08 +02:00
Nicolas Goaziou d907041911 Change :version in defcustoms from "25.1" to "25.2"
* lisp/ob-exp.el (org-babel-exp-inline-code-template):
* lisp/ob-lisp.el (org-babel-lisp-eval-fn):
* lisp/org-agenda.el (org-agenda-view-columns-initially):
* lisp/org-attach.el (org-attach-commit):
(org-attach-archive-delete):
(org-attach-annex-auto-get):
* lisp/org-bibtex.el (org-bibtex-inherit-tags):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-colview.el (org-columns-summary-types):
* lisp/org-table.el (org-table-copy-increment):
(org-table-formula-create-columns):
(org-table-convert-region-max-lines):
* lisp/org-timer.el (org-timer-default-timer):
* lisp/org.el (org-export-backends):
(org-cycle-hook):
(org-occur-case-fold-search):
(org-preview-latex-image-directory):
(org-latex-default-packages-alist):
(org-sparse-tree-default-date-type):
(org-structure-template-alist):
(org-effort-durations):
(org-agenda-ignore-properties): Change :version from "25.1" to "25.2".
(customize-package-emacs-version-alist): Fix associations between Org
and Emacs releases.
* lisp/ox-ascii.el (org-ascii-list-margin):
* lisp/ox-beamer.el (org-beamer-subtitle-format):
* lisp/ox-html.el (org-html-format-headline-function):
(org-html-format-inlinetask-function):
(org-html-viewport):
* lisp/ox-latex.el (org-latex-caption-above):
(org-latex-prefer-user-labels):
(org-latex-subtitle-format):
(org-latex-hyperref-template):
(org-latex-images-centered):
(org-latex-text-markup-alist):
(org-latex-format-inlinetask-function):
(org-latex-custom-lang-environments):
(org-latex-compiler-file-string):
(org-latex-compiler):
(org-latex-bib-compiler):
(org-latex-logfiles-extensions):
(org-latex-known-warnings):
* lisp/ox-md.el (org-md-footnotes-section):
(org-md-footnote-format):
* lisp/ox-odt.el (org-odt-format-headline-function):
(org-odt-format-inlinetask-function):
(org-odt-inline-image-rules):
* lisp/ox-texinfo.el (org-texinfo-format-headline-function):
* lisp/ox.el (org-export-with-creator):
(org-export-with-title):
(org-export-with-broken-links):
(org-export-copy-to-kill-ring): Change :version from "25.1" to "25.2".

Neither Org 8.3 nor Org 9.0 were released with Emacs 25.1.
2016-10-05 11:18:39 +02:00
Aaron Ecay 1c18efb615 String handling improvements.
* lisp/org-agenda.el (org-agenda-export-csv-mapper): Use `replace-regexp-in-string'.
* lisp/org-capture.el (org-capture): Use `string-prefix-p'.
* lisp/org-compat.el (string-blank-p, string-remove-prefix):
* lisp/org-compat.el (string-remove-suffix): Add compatibility defuns
for emacs 24.3.
* lisp/org-datetree.el (org-datetree-cleanup): Use `string-suffix-p'.
* lisp/org-footnote.el (org-footnote-normalize-label): Use
`string-remove-prefix'.
* lisp/org-gnus.el (org-gnus-group-link): Use `string-prefix-p'.
* lisp/org-list.el (org-list-struct):
(org-list-get-list-type, org-list-send-item):
(org-list-use-alpha-bul-p): Use `string-match-p'.
* lisp/org.el (org-paste-subtree): Use `string-suffix-p'.
(org-open-file, org-refile-get-targets): Use `replace-regexp-in-string'.
(org-make-tags-matcher): Use `string-prefix-p'.
(org-set-tags): Use `string-(prefix,suffix)-p'.
* lisp/ox-beamer.el (org-beamer--element-has-overlay-p):
(org-beamer--format-block):
Use `string-(prefix,suffix)-p'.
* lisp/ox-html.el (org-html-fix-class-name): Use `replace-regexp-in-string'.
* lisp/ox-md.el (org-md-verbatim): Use `string-(prefix,suffix)-p'.
(org-md-paragraph): Use `string-prefix-p'.
2016-09-03 02:05:10 +01:00
Nicolas Goaziou cd18ac22ff Merge branch 'maint' 2016-09-01 18:33:19 +02:00
Nicolas Goaziou d2cb298e72 ox-html: Remove duplicate option in back-end
* lisp/ox-html.el (html): Remove spurious :html-link-use-abs-url option.

Reported-by: Arun Isaac <arunisaac@systemreboot.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/108952>
2016-09-01 18:32:16 +02:00
thibault c72a0d2df9 ox-html: Add pre.src-lua to CSS
* lisp/ox-html.el (org-html-style-default): Add pre.src-lua to CSS.
2016-08-29 09:03:27 +02:00
Nicolas Goaziou 7a14bd172c Merge branch 'maint' 2016-08-28 12:02:51 +02:00
Nicolas Goaziou b7c144a104 ox-html: Remove spurious newline at the end of inline source code
* lisp/ox-html.el (org-html-inline-src-block): Do not call
  `org-html-format-code', which is meant to be used for source blocks
  only.

Reported-by: Clément Pit--Claudel <clement.pit@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108890>
2016-08-28 12:01:08 +02:00
Nicolas Goaziou de24694f05 Turn org-mode into Org or Org mode
Use Org or Org mode instead of org-mode or Org-mode according to
"Documentation standards".
2016-08-23 22:13:56 +02:00
Nicolas Goaziou 596f585a7d ox-html: Tiny fix
* lisp/ox-html.el (org-html-paragraph): Move space after the figure
  number within the "figure-number" class so it can be hidden if needed.
  Small refactoring.
2016-08-22 22:13:24 +02:00
Nicolas Goaziou 579569cc84 ox-html: Number source blocks with listings
* lisp/ox-html.el (org-html-src-block): Number source block if it has
  a caption.  Numbering is done among source blocks with a caption,
  only.

Suggested-by: Clément Pit--Claudel <clement.pit@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/108808>
2016-08-22 22:07:34 +02:00
Jarmo Hurri 04e0bc0b00 ox-html: Provide a default CSS class for embedded SVG images
* lisp/ox-html.el (org-html--svg-image): Set CSS class of embedded SVG
images to be org-svg if no other class is set in attributes.
org-html-style-default: Provide default properties for new CSS class.

* doc/org.texi (CSS support): Documentation of default CSS class
org-svg for SVG images embedded into exported HTML.
2016-07-26 10:37:17 +02:00
Nicolas Goaziou c4da20a2f3 Silence byte-compiler
* lisp/ob-core.el (org-babel-process-params): Silence byte-compiler.
* lisp/ob-groovy.el (org-babel-groovy-evaluate):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-io.el (org-babel-io-evaluate):
* lisp/ob-octave.el (org-babel-octave-evaluate-external-process):
(org-babel-octave-evaluate-session):
* lisp/ob-perl.el (org-babel-perl-evaluate):
* lisp/ob-python.el (org-babel-python-evaluate-external-process):
(org-babel-python-evaluate-session):
* lisp/ob-ruby.el (org-babel-ruby-pp-wrapper-method):
(org-babel-ruby-evaluate):
* lisp/ob-scala.el:
* lisp/ob-tangle.el:
(org-babel-tangle-collect-blocks):
* lisp/org-agenda.el (org-agenda-get-category-icon):
(org-agenda-todo-yesterday):
* lisp/org-bbdb.el (org-bbdb-anniv-extract-date):
(org-bbdb-make-anniv-hash):
(org-bbdb-anniversaries-future):
* lisp/org-bibtex.el (org-bibtex-fleshout):
(org-bibtex-read):
(org-bibtex-write):
* lisp/org-capture.el (org-capture-set-target-location):
(org-capture-get-indirect-buffer):
(org-mks):
* lisp/org-clock.el (org-clock--oldest-date):
(org-clock-resolve):
(org-clock-sum):
(org-clock-special-range):
(org-clocktable-steps):
* lisp/org-ctags.el (org-ctags-create-tags):
* lisp/org-element.el (org-element--interpret-affiliated-keywords):
(org-element--cache-shift-positions):
(org-element--cache-sync):
(org-element--cache-submit-request):
* lisp/org-habit.el (org-habit-parse-todo):
* lisp/org-inlinetask.el (org-inlinetask-hide-tasks):
* lisp/org-lint.el (org-lint--generate-reports):
* lisp/org-mouse.el (org-mouse-get-context):
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data):
(org-plot/gnuplot):
* lisp/ox-ascii.el (org-ascii--current-text-width):
(org-ascii--current-justification):
(org-ascii--build-caption):
(org-ascii--checkbox):
(org-ascii-item):
* lisp/ox-html.el (org-html-footnote-section):
* lisp/ox-latex.el (org-latex--make-option-string):
* lisp/ox-odt.el (org-odt-toc):
(org-odt-add-automatic-style):
(org-odt-format-label):
(org-odt-link--inline-image):
(org-odt--render-image/formula):
(org-odt--enumerable-image-p):
(org-odt--enumerable-latex-image-p):
(org-odt--enumerable-formula-p):
(org-odt-do-format-code):
(org-odt-table-cell): Silence byte-compiler.
2016-07-25 17:10:53 +02:00
Nicolas Goaziou 72461eaeaf Use `string-match-p' instead of `org-string-match-p'
* contrib/lisp/org-contacts.el (org-contacts-filter):
(org-contacts-complete-group):
(org-contacts-complete-tags-props):
* contrib/lisp/org-wl.el (org-wl-open):
* contrib/lisp/ox-bibtex.el (org-bibtex-merge-contiguous-citations):
* lisp/ob-core.el (org-babel-demarcate-block):
* lisp/ob-processing.el (org-babel-processing-view-sketch):
* lisp/ob-stan.el (org-babel-execute:stan):
* lisp/org-agenda.el (org-agenda-get-category-icon):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-element.el (org-element-link-parser):
* lisp/org-lint.el (org-lint-orphaned-affiliated-keywords):
(org-lint-invalid-babel-call-block):
(org-lint-colon-in-name):
* lisp/org-list.el (org-list-item-body-column):
* lisp/org-macro.el (org-macro-replace-all):
* lisp/org-plot.el (org-plot/gnuplot-script):
* lisp/org-table.el (org-table-export):
(org-table-align):
(org-table-get-range):
(org-table-recalculate):
(org-table-expand-lhs-ranges):
(org-table-formula-substitute-names):
(org-table-show-reference):
(orgtbl-to-texinfo):
(org-table-remote-reference-indirection):
* lisp/org.el (org-make-link-string):
(org--open-elisp-link):
(org-open-at-point):
(org-store-log-note):
(org-cached-entry-get):
(org--valid-property-p):
(org-entry-properties):
(org-buffer-property-keys):
(org-insert-drawer):
(org-display-inline-images):
(org-in-commented-heading-p):
* lisp/ox-ascii.el (org-ascii-keyword):
* lisp/ox-beamer.el (org-beamer--format-frame):
* lisp/ox-html.el (org-html-keyword):
* lisp/ox-latex.el (org-latex--label):
(org-latex-headline):
(org-latex-item):
(org-latex-keyword):
(org-latex--inline-image):
(org-latex-src-block):
* lisp/ox-odt.el (org-odt-styles-dir):
(org-odt-keyword):
(org-odt--translate-latex-fragments):
* lisp/ox-texinfo.el (org-texinfo-template):
(org-texinfo-keyword):
(org-texinfo-src-block):
* lisp/ox.el (org-export-inline-image-p):
(org-export-file-uri):
* testing/lisp/test-org-table.el (test-org-table/to-generic):
(test-org-table/to-latex):
(test-org-table/to-html):
(test-org-table/named-field):
(test-org-table/named-column):
(test-org-table/tab-indent):
(test-org-table/first-rc):
(test-org-table/last-rc): Use `string-match-p' instead of
`org-string-match-p'.
2016-07-25 15:21:12 +02:00
Nicolas Goaziou eb9fb15b2d ox-html: Remove unprefixed "cl" macros
* lisp/ox-html.el (org-html-infojs-install-script):
(org-html-list-of-listings):
(org-html-list-of-tables):
(org-html-format-list-item):
(org-html-inline-image-p):
(org-html-standalone-image-p):
(org-html-link):
(org-html-begin-plain-list):
(org-html-end-plain-list):
(org-html-table): Refactor code so as to avoid using un-prefixed "cl"
macros.
2016-07-20 22:02:50 +02:00
Nicolas Goaziou 3548c4bead ox-html: Use unescaped URL in links without description
* lisp/ox-html.el (org-html-link): Use unescaped URL in links without
  description.

Reported-by: Arun Isaac <arunisaac@systemreboot.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/108359>
2016-07-20 21:52:10 +02:00
Nicolas Goaziou adcaf91648 Mark `org-link-escape-browser' as obsolete
* lisp/org-compat.el (org-link-escape-browser): Make function an alias
  for `url-encode-url'.
* lisp/org.el (org-link-escape-chars-browser): Remove variable.
(org-link-escape-browser): Remove function.
(org-open-at-point):
* lisp/ox-html.el (org-html-link): Use `url-encode-url'.
* testing/lisp/test-org.el(test-org/org-link-escape-chars-browser):
  Remove test.
2016-07-01 12:00:23 +02:00
Nicolas Goaziou b2091f6d75 Move obsolete declarations into "org-compat.el"
* lisp/org-agenda.el (org-agenda-list):
(org-agenda-goto-today):
(org-agenda-reset-view): Remove reference to obsolete
`org-agenda-ndays'.
2016-06-30 15:20:51 +02:00
Nicolas Goaziou d13b0745dc Mark a few functions as obsolete
* lisp/ob-R.el (org-babel-variable-assignments:R):
* lisp/ob-ref.el (org-babel-ref-goto-headline-id):
* lisp/org-agenda.el (org-agenda-prepare-window):
(org-agenda-switch-to):
* lisp/org-capture.el (org-capture-goto-target):
* lisp/org-clock.el (org-clock-goto):
(org-clock-special-range):
* lisp/org-ctags.el (org-ctags-visit-buffer-or-file):
* lisp/org-eshell.el (org-eshell-open):
* lisp/org-feed.el (org-feed-show-raw-feed):
* lisp/org-id.el (org-id-goto):
* lisp/org-irc.el (org-irc-visit-erc):
* lisp/org-macs.el (org-string-nw-p):
* lisp/org-mobile.el (org-mobile-apply):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org.el (org-get-location):
(org-tree-to-indirect-buffer):
(org-mark-ring-goto):
(org-refile):
(org-add-log-note):
(org-revert-all-org-buffers):
(org-switchb):
(org-cycle-agenda-files):
(org-submit-bug-report):
(org-goto-marker-or-bmk):
* lisp/ox-html.el (org-html-htmlize-generate-css): Silence byte
  compiler.

The following functions are marked as obsolete:
- `org-string-match-p'
- `org-number-sequence'
- `org-floor*'
- `org-pop-to-buffer-same-window'
- `org-delete-directory'
- `org-buffer-narrowed-p'
2016-06-23 10:00:00 +02:00
Nicolas Goaziou a24f339f58 Work around a display bug when previewing LaTeX fragments
* lisp/org.el (org-format-latex): Change signature.
(org-toggle-latex-fragment):
* lisp/ox-html.el (org-html-format-latex): Apply signature change.
2016-06-23 00:56:18 +02:00
Nicolas Goaziou 2f2e6625ac Work around a display bug when previewing LaTeX fragments
* lisp/org.el (org-format-latex): Change signature.
(org-toggle-latex-fragment):
* lisp/ox-html.el (org-html-format-latex): Apply signature change.
2016-06-23 00:33:22 +02:00
Brian Carlson af8e3d84ee ox: Provide offset to [+-]n in SRC/EXAMPLE export
* lisp/org-element.el (org-element-example-block-parser): Use cons cell
  for :number-lines specifying offset in addition to type (new/continue).
  ('continue . offset) for :number-lines will add this offset count to
  the last line number. ('new . offset) for :number-lines will reset the
  line number counting starting at offset
(org-element-src-block-parser): same for SRC block as EXAMPLE block

* lisp/ox-html.el (org-html-format-code):
* lisp/ox-latex.el (org-latex-src-block):
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-resolve-coderef):
(org-export-get-loc):
(org-export-format-code-default):
* contrib/lisp/ox-groff.el (org-groff-src-block): Use new cons cell
  for :number-lines.

* testing/lisp/test-ox.el  (ert-deftest test-org-export/get-loc): Tests for
changes
(test-org-gen-loc-list): Helper function for `test-org-export/get-loc'.
2016-05-24 21:40:35 +02:00
Rasmus 9a7bf6d649 Merge branch 'maint' 2016-05-22 15:31:27 +02:00
Rasmus d07fafed4a ox-html: Find preamble-spec case-insensitively
* ox-html.el (org-html--build-pre/postamble): Find the spec based on the
  language case-insensitively.

Note that the default org-html-preamble-format and
org-export-default-language are incompatible.
2016-05-22 15:30:11 +02:00
Feng Shu bf93e166be Use dvisvgm to preview latex formulas
* ox-html.el (org-html-with-latex): Add dvisvgm support.
(org-html-with-latex): Add dvisvgm support.
(org-html-format-latex): "ltxpng" -> "ltximg".
(org-html-latex-environment): Add dvisvgm support.
(org-html-latex-fragment): Add dvisvgm support.

* org.el (org-preview-latex-default-process): New variable.
(org-latex-create-formula-image-program): Rename it to `org-preview-latex-default-process'.
(org-latex-preview-ltximg-directory): Rename it to `org-preview-latex-image-directory'.
(org-preview-latex-image-directory): New variable.
(org--format-latex-make-overlay): Add optional image-type, which used to deal with svg.
(org-toggle-latex-fragment): "org-ltxpng" -> "org-ltximg".
(org-format-latex): Add dvisvgm support.
(org-create-formula-image): Big refactor, merge dvipng and imagemagick
backend's feature.  Add dvisvgm feature.
(org-preview-latex-process-alist): Add new variable, which used to set
latex preview processes.
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick): Useless, removed.

* org.texi (@LaTeX{} fragments):
(Previewing @LaTeX{} fragments):
(Math formatting in HTML export):
(Working with @LaTeX{} math snippets): Add dvisvgm information.
2016-05-21 10:50:38 +02:00
Robert Klein 59237bc028 ox-html: Support more programming languages in CSS
* lisp/ox-html.el (org-html-style-default): Add languages.

The standard CSS for HTML export only supported a couple of
programming languages to have a language name "hover" on src
blocks.  This patch adds all languages supported per Org
manual, those from org.el's org-babel-load-languages-alist,
additional language identifiers in ob-*.el and languages
which have a) an emacs mode and b) are supported by the LaTeX
listings package.  Additional a language "conf" is supported
for generic configuraiton files; an emacs mode exists for
this, but for LaTeX listings a language " " has to be faked.
As this patch is for HTML, this is no impediment.

Thanks for reporting the missing support to Tianxian XIONG.
2016-05-10 22:21:21 +02:00
Nicolas Goaziou f07580066e ox-html: Silence byte-compiler 2016-03-30 17:18:47 +02:00
Nicolas Goaziou 3149a01513 Merge branch 'maint' 2016-03-30 17:17:51 +02:00
Nicolas Goaziou cb683e3a56 ox-html: Fix planning info export
* lisp/ox-html.el (org-html-planning): Properly escape angle brackets in
  time-stamps.

Reported-by: Keith Sutton <kesutt@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105945>
2016-03-30 17:17:07 +02:00
John Kitchin d5b9c74430 ox-html: Add html attributes to special blocks
* lisp/ox-html.el (org-html-special-block): enables #+attr_html and puts
  an id in when the special block is named.
2016-03-30 17:01:12 +02:00
John Kitchin 8f4f7dfd14 ox-html: Add html attributes to quote-block
* lisp/ox-html.el (org-html-quote-block): Enables #+attr_html: and puts
  a id attribute when the block is named into the html element.
2016-03-30 16:38:53 +02:00
John Kitchin 2ce1fc2c0d ox-html: Add id attribute to example-block on html export
* lisp/ox-html.el (org-html-example-block): Add "id" attribute according
  to name.

This allows you to hyperlink to the block.
2016-03-30 16:16:12 +02:00
Nicolas Goaziou 0f512848ea Merge branch 'maint' 2016-03-28 11:07:27 +02:00
Nicolas Goaziou a94147535a ox-html: Fix Usenet links
* lisp/ox-html.el (org-html-link): Properly export Usenet links.

Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/105915>
2016-03-28 11:06:56 +02:00
Nicolas Goaziou 1795d505e8 ox-html: Fix code comment
* lisp/ox-html.el (org-html-link): Radio-targets are not meant to be
  resolved through cross-referencing.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou e6984bd74b Merge branch 'maint' 2016-02-19 14:29:06 +01:00
Austin Walker 5a193ed485 ox-html.el: Fix TOC export of TODO headlines
* lisp/ox-html.el (org-html--todo): Don't show nil in format string for
  TODO class

Use empty string if :html-todo-kwd-class-prefix is not present.

TINYCHANGE
2016-02-19 14:22:08 +01:00
Kyle Meyer e44524b3b2 Merge branch 'maint' 2016-02-03 23:37:26 -05:00
Kyle Meyer 2fc29a1796 Fix "it's" typos
* lisp/ob-C.el (org-babel-expand-body:cpp):
(org-babel-expand-body:C++):
(org-babel-expand-body:D):
(org-babel-expand-body:C):
(org-babel-C-expand-C++):
(org-babel-C-expand-C):
(org-babel-C-expand-D):
* lisp/ob-exp.el (org-babel-exp-src-block):
* lisp/ob-fortran.el (org-babel-expand-body:fortran):
* testing/org-test.el (org-test-buffer):
Correct "it's" typo in docstring.

* doc/org.texi:
Correct "it's" typos.
2016-02-03 23:33:28 -05:00
Fabrice Popineau 6af83e0aa7 ox-html: Fix org-html-table-row wrt lexical binding
* lisp/ox-html.el (org-html-table-row-open-tag):
(org-html-table-row-close-tag): New variables.
(org-html-table-row-tags): Remove variable.

(org-html-table-row): Use new variables.
2016-02-03 00:10:24 +01:00
Nicolas Goaziou 7148ae780b Merge branch 'maint' 2016-01-31 23:23:13 +01:00
Nicolas Goaziou 48e046047b ox-html: Properly encode links without a description
* lisp/ox-html.el (org-html-link): Encode URI in default description
  when none is provided.

Reported-by: mail@fritzreichwald.de
<http://permalink.gmane.org/gmane.emacs.orgmode/104645>
2016-01-31 23:21:34 +01:00
Kyle Meyer 23ca3fa100 Merge branch 'maint' 2016-01-29 00:28:48 -05:00
Kyle Meyer a4edee4069 org-compat: Update font-lock-ensure alias
* lisp/org-compat.el (org-font-lock-ensure): Add new alias that accepts
  the same number of arguments as font-lock-ensure does.  Use an org-
  prefix.
* lisp/org-clock.el (org-clock-get-clocktable):
* lisp/org.el (org-fontify-like-in-org-mode):
* lisp/ox-html.el (org-html-fontify-code):
* lisp/ox-odt.el (org-odt-do-format-code):
* lisp/ox-org.el (org-org-publish-to-org): Use org-font-lock-ensure.

See Emacs's bug#22399.
2016-01-29 00:28:37 -05:00
Kyle Meyer 6345de2d05 Merge branch 'maint' 2016-01-09 17:43:27 -05:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou 54318add34 Change export block syntax
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.

* lisp/ox.el (org-export-register-backend):
(org-export-define-derived-backend): Remove :export-block keyword from
back-end's definition.
(org-export-expand-include-keyword): Use new syntax for include
keywords.

* lisp/ox-ascii.el (ascii):
* lisp/ox-beamer.el (beamer):
* lisp/ox-html.el (html):
* lisp/ox-latex.el (latex):
(org-latex-prefer-user-labels):
* lisp/ox-man.el (man):
* lisp/ox-md.el (md):
* lisp/ox-odt.el (odt):
* lisp/ox-texinfo.el (texinfo): Propagate changes to "ox.el".

* lisp/ob-core.el (org-babel-insert-result):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new syntax.

* lisp/org.el (org-structure-template-alist): Use new syntax.
(org-protecting-blocks): Add "export" to protected blocks.  Remove
  back-ends blocks, which are now special blocks.
(org-fontify-meta-lines-and-blocks-1): Fontify correctly new blocks.

* lisp/org-footnote.el (org-footnote-forbidden-blocks):
* lisp/org-list.el (org-list-forbidden-blocks): Add "export" to
  forbidden blocks.  Remove back-ends blocks, which are now special
  blocks.

* contrib/lisp/ox-extra.el: Update comments.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
(test-org-element/export-block-interpreter):
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
* testing/lisp/test-ox.el (test-org-export/expand-include): Update tests.

Export blocks are explicitly marked as such at the syntax level to
disambiguate their parsing from special blocks.  The new syntax is

  #+BEGIN_EXPORT backend
  ...
  #+END_EXPORT

instead of

  #+BEGIN_backend
  ...
  #+END_backend

As a consequence, =INCLUDE= keywords syntax is modified, e.g.,

  #+INCLUDE: "file.org" HTML

becomes

  #+INCLUDE: "file.org" export html
2015-12-20 21:56:27 +01:00
Nicolas Goaziou d01ed5b89b ox-html: Remove spurious # in some links
* lisp/ox-html.el (org-html-link): Remove spurious # introduced in
  8594aed.

Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/103599>
2015-12-14 23:52:11 +01:00
Nicolas Goaziou 8594aed1d6 ox-html: Always resolve external custom-id links
* lisp/ox-html.el (org-html-link): Always resolve external custom-id links.

Suggested-by: Alan Schmitt <alan.schmitt@polytechnique.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/103552>
2015-12-12 09:57:51 +01:00
Ruben Maher 6b2c38bb71 ox-html.el: Add lang attribute to html tag
* lisp/ox-html.el (org-html-template): Add lang attribute to exported
  html tag.  Some features of the CSS Text Module (Level 3) require this
  attribute to be present (for example, so that the browser knows how to
  hyphenate the text). For more info, please take a look here:
  https://drafts.csswg.org/css-text-3/#languages

TINYCHANGE
2015-12-01 23:34:27 +01:00
Ruben Maher eeee60da70 ox-html.el: Remove superflous whitespace
* lisp/ox-html.el: Remove superfluous whitespace from meta tags, put
  there by `org-html--buld-meta-info' and `org-html--build-head'.
  `org-html-close-tag' already inserts a space, so it is not necessary
  to add another.  Previously these affected tags would look like
  <meta  name="generator" content="Org-mode" />.

TINYCHANGE
2015-12-01 23:34:23 +01:00
Aaron Ecay e4cd3dd22b Remove some home-grown copies of cl-lib functions.
* lisp/org.el (org-count, org-remove-if, org-remove-if-not):
(org-reduce, org-every, org-some): Obsolete, use cl-lib versions
everywhere.
(org-sublist): Reimplement in terms of `cl-subseq'; make obsolete.
2015-11-06 12:50:40 +00:00
Nicolas Goaziou 0198e3955d ox-html: Use lexical binding
* lisp/ox-html.el (org-html-infojs-install-script):
(org-html-format-drawer-function):
(org-html--has-caption-p):
(org-html--make-string):
(org-html-footnote-section):
(org-html--build-mathjax-config):
(org-html--build-pre/postamble):
(org-html--priority):
(org-html--toc-text):
(org-html-bold):
(org-html-center-block):
(org-html-clock):
(org-html-code):
(org-html-dynamic-block):
(org-html-entity):
(org-html-example-block):
(org-html-export-snippet):
(org-html-export-block):
(org-html-fixed-width):
(org-html-footnote-reference):
(org-html-headline):
(org-html-format-headline-default-function):
(org-html-horizontal-rule):
(org-html-inline-src-block):
(org-html-italic):
(org-html-keyword):
(org-html-latex-environment):
(org-html-latex-fragment):
(org-html-line-break):
(org-html-node-property):
(org-html-plain-list):
(org-html-convert-special-strings):
(org-html-planning):
(org-html-property-drawer):
(org-html-quote-block):
(org-html-src-block):
(org-html-statistics-cookie):
(org-html-strike-through):
(org-html-subscript):
(org-html-superscript):
(org-html-table-row):
(org-html-table--table.el-table):
(org-html-target):
(org-html-timestamp):
(org-html-underline):
(org-html-verbatim):
(org-html-verse-block):
(org-html-final-function): Silence byte-compiler.  Refactor `mapc' +
`lambda' into `dolist'.
2015-10-29 18:35:20 +01:00
Kyle Meyer 00dacdcc50 Clean up spacing to pass Emacs's pre-commit check
This is in preparation for syncing with the Emacs repo.
2015-10-04 02:31:29 -04:00
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Kyle Meyer 0839dc4322 Protect remaining apostrophes in docstrings
Protect apostrophes not covered by the last backport.  Convert
expressions like '(...)  to \\='(...)  and symbols written as 'name to
`name'.  (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)

If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
2015-09-21 18:38:39 -04:00
Kyle Meyer d77a52a502 Backport quote-related commits from Emacs
These changes are the combination of the commits below (in order
applied).  Unlike other backports, these are applied in one commit
because they are closely related and because some of the later commits
reverse changes in earlier commits.  Changes to message and help quote
display for Emacs 25 seem to be here to stay.  The quote protections are
required to ensure grave accents and apostrophes are displayed as
intended in Emacs 25, and they should not affect earlier versions.

  Quoting fixes in lisp/org
  6cd2629bd1b3ce77d29ac28e29237c94a4197116
  Paul Eggert
  Mon Aug 31 00:29:40 2015 -0700

  More-conservative ‘format’ quote restyling
  fbb5531fa11d13854b274d28ccd329c9b6652cfc
  Paul Eggert
  Sun Aug 23 22:39:06 2015 -0700

  Prefer directed to neutral quotes
  875a5d0ead827d3da32ecbd30e739a29f07bbc87
  Paul Eggert
  Mon Aug 24 23:57:25 2015 -0700

  Escape ` and ' in doc
  19532d147b431a4fe34f088d6de07891c48e2c5c
  Paul Eggert
  Tue Sep 1 18:23:21 2015 -0700

  Fix some more docstring etc. quoting problems
  26bd978d87dfbf9baa115cd961a67d42b416c4bf
  Paul Eggert
  Thu Sep 3 15:32:54 2015 -0700

  Go back to grave quoting in source-code docstrings etc.
  6afef3f6ca2f3009c722b84e249903b7f807b044
  Paul Eggert
  Mon Sep 7 16:09:27 2015 -0700
2015-09-21 18:38:18 -04:00
Nicolas Goaziou 980aef2dfb ox-html: Fix links with ampersands
* lisp/ox-html.el (org-html-link): Escape ampersands and other special
  characters in anchor once and only once.

Reported-by: "Greedwolf DSS" <passchaos@163.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100797>
2015-09-02 21:30:59 +02:00
Rasmus 6ddde6132b ox-html: Fix center block class
* ox-html.el (org-html-center-block): Correct class.

Reported-by: j_l_domenech@yahoo.com
<http://permalink.gmane.org/gmane.emacs.bugs/105805>
2015-08-26 01:16:46 +02:00
Nicolas Goaziou cf31ea1660 ox-html: Rename `org-html-html5-fancy-p' to `org-html--html5-fancy-p'
* lisp/ox-html.el (org-html--html5-fancy-p): Renamed from
  `org-html-html5-fancy-p'.  Add docstring.
(org-html--wrap-image):
(org-html-template):
(org-html-toc):
(org-html-special-block): Apply renaming.

As an internal function, it should follow the convention of double
hyphens in its name.
2015-08-19 11:07:06 +02:00
Eric Abrahamsen f149060678 Add function to better guard html5 exports
* lisp/ox-html.el (org-html-html5-fancy-p): New function to check
  that we are exporting to HTML5 and that the user has requested
  fancy elements.
  (org-html--wrap-image, org-html-template, org-html-toc)
  (org-html-special-block): Use the new function.
2015-08-18 17:59:01 +02:00
Bastien 55544780e2 ox-html.el (org-html-use-unicode-chars): Delete.
* ox-html.el (org-html-use-unicode-chars): Delete.
(html, org-html-final-function): Update.

* org.texi (Publishing options): Don't mention
`org-html-use-unicode-chars'.

Thanks to Vladimir Alexiev for raising this.
2015-08-16 16:01:57 +02:00
Bastien 0d0d0ad56e Merge branch 'backport-master'
Conflicts:
	lisp/org-table.el
2015-08-05 01:01:46 +02:00
Rasmus af35955781 Fix typo in 6db0b0cd43 2015-08-04 19:19:52 +02:00