* lisp/org.el (org-latex-to-html-convert-command): New option to
convert a LaTeX fragment directly into HTML.
(org-format-latex): Use the new option.
(org-format-latex-as-html): Do the conversion and return HTML.
* lisp/ox-html.el (org-html-with-latex): Document the 'html symbol.
(org-html-format-latex): This custom HTML conversion, like MathJax,
doesn't require preprocessing.
(org-html-latex-fragment): Use the new option.
This allows you to set a custom command
`org-latex-to-html-convert-command' that will take as input a LaTeX
fragment and use it to generate HTML for export. This is very
open-ended in the sense that you can use any shell-command you
want. This has been added in order to use latexml, but you could
use any other tool that generates HTML output text.
* lisp/ox-html.el (org-html-headline): When CUSTOM_ID is set, use it
to set the outline-container-* <div> id.
TINYCHANGE
When exporting HTML the exporter generate ids for references.
Unfortunately those id are not stable in the sense that exporting
twice generate two different set of ids.
Using CUSTOM_ID one could already use have fixed anchors in the
generated HTML. So for example we could share URL with
...index.html#my-section-id and it will be the same URL even if we
export the HTML again.
Unfortunately, this CUSTOM_ID is not used for the outline ids. And
thus if we expose the html in a git repository for example. Each
export will generate a big diff that "pollute" the diff because it
will show changes for all org items while most of them could still be
unchanged.
With this PR, HTML export will use CUSTOM_ID for both the headers id
and the org outline ids. For Items without CUSTOM_ID the behavior will
stay identical as before.
* lisp/ox-html.el (org-html-scripts)
(org-html-infojs-template): Enhance the display of the
licenses for Javascript scripts.
Thanks to Arne Babenhauserheide for suggesting this.
* lisp/org-attach.el (org-attach-link-expand): New function for link
element expansion.
* lisp/org-element.el (org-element-link-parser): Remove info about
expanded attachment paths from link elements.
* lisp/ol.el (org-link-open)
* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Refactor to use new link
expansion function from org-attach.el instead of (now removed)
custom link property from org-element.el.
* lisp/org-element.el (org-element-link-parser): Add info about
expanded attachment paths to the link parse tree export.
* lisp/org-attach.el Remove org-attach-open-link. Let attachment
links use the built in code that already is developed for file
links.
* lisp/ol.el (org-link-open): Add knowledge about attachment links to
the function opening links, so they can be opened exactly as file
links are opened.
* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Refactor to use property from
link parser instead of invoking attachment expansion in the
exporter.
* lisp/ox-texinfo.el (org-texinfo-link)
* lisp/ox-odt.el (org-odt-link)
* lisp/ox-md.el (org-md-link)
* lisp/ox-man.el (org-man-link)
* lisp/ox-latex.el (org-latex--inline-image, org-latex-link)
* lisp/ox-html.el (org-html-link)
* lisp/ox-ascii.el (org-ascii-link): Move point to the link for
org-attach-expand to know from which headline to expand the link.
* lisp/ox-html.el (org-html-link, org-html-inline-image-rules)
* lisp/ox-odt.el (org-odt-inline-image-rules)
* lisp/ox-texinfo.el (org-texinfo-link)
(org-texinfo-inline-image-rules): Make attachment links consistently
expand as relative to file and add attachment link type to
image rules for consistency among export backends.
Make attachment links export just as file links.
* lisp/ox-ascii.el
* lisp/ox-html.el
* lisp/ox-latex.el
* lisp/ox-man.el
* lisp/ox-md.el
* lisp/ox-texinfo.el
* lisp/org-attach.el: Move export functionality for attachment links
into the respective export backend, for feature parity with file
links.
* lisp/ox-html.el (org-html-format-code, org-html-do-format-code):
Use new export option :html-wrap-src-lines with variable
org-html-wrap-src-lines to control whether source code lines should
be wrapped in code elements or not.
* doc/org-manual.org: Document the new option
* lisp/org-attach.el
Changed the way attachments deal with property-inheritance. It now
adheres to the =org-use-property-inheritance= setting by default but
it can be customized if needed (I recommend to enable it!).
The property ATTACH_DIR is deprecated in favour of the shorter and simpler
property DIR.
Added an explicit option to =org-attach= for unsetting
attachment-directories (i.e. remove DIR property and deal with the
attachments by interaction).
Added attachment link type with the prefix "attachment:".
Added customizations:
- org-attach-dir-relative
- org-attach-preferred-new-method
- org-attach-use-inheritance
- org-attach-id-to-path-function
Hooks added:
- org-attach-after-change-hook
- org-attach-open-hook
A new linktype "attachment" is added in order to reduce
link-duplication when wanting to link to files in attached folders of
nodes. This works for both ID and DIR properties. The goal is to
make the functionality for attachment links mirror the functionality
for file links.
* lisp/org-attach-git.el
New file, existing functionality. Code here has been factored out
from org-attach.el and if GIT-functionality is to be used this module
needs to be required sepatately. It extends org-attach by use of its
hooks.
Activating git functionality in org-attach is done by loading
org-attach-git from now on, instead of customizing a variable.
Naming of both functions and tests has been modified to match the move
of functionality into its own module.
* lisp/org.el
Inline images are shown also using attachment-links, exactly the same
as it works for file-links today.
Make org-open-at-point respect ARG when opening attachment-dir.
* lisp/org-compat.el
org-attach-directory has been deprecated in favour for
org-attach-id-dir. The new name matches its purpose better.
* lisp/ox-html.el
Export attachment links to images as inline images, in the same way as
file links work today.
* etc/ORG-NEWS
Mention the changes in this patch.
* doc/org-manual.org
The chapter "Refile, Copy, Archive" has been split into two separate
chapters.
- "Refile, Copy and Archiving" for information related to moving
existing data around.
- "Capture, Attachments, RSS Feeds and Protocols" for information
related to working with external data.
The attachment-part has been rewritten and extended to match the
changes in this patch.
The new attachment link type is mentioned both inside the attachments
chapter and in the chapter dealing with links.
Documentation related to external links has been improved.
* testing/lisp/test-org-attach-annex.el
Require org-attach-git instead of org-attach, since this file tests
the GIT-functionality.
* testing/lisp/test-org-attach.el
Add tests for org-attach.
* testing/org-test.el
Define a symbol for a file to test attachments with.
* testing/examples/*
A bunch of new example files and folders are created and are used in
testing of org-attach to verify its functionality.
* lisp/ox-html.el (org-html-do-format-code): If line numbers are enabled
then include a data-ox-html-linenr attribute that contains this line's
line number.
This allows you to have more control over line number formatting and
placement. For example, the following CSS hides the span that contains
the line number, and uses a CSS :before property to position and format
the line number with a border instead of a semi-colon separating content
and line number.
span.linenr { display: none; }
code[data-ox-html-linenr]:before {
content: attr(data-ox-html-linenr);
display: inline-block;
border-right: 1px solid;
width: 1rem;
text-align: right;
}
TINYCHANGE
* 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
* 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.
* 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.
* 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.
* 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>
* 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.
* 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.
* 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.
* 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.
* lisp/ox-html.el (org-html--build-meta-info): Use an invisible
character "‎" (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>
* 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
* 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.
* 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>
* 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>
* 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.
* 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>
* 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.
* 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.
* 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'.
* 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.
* 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.
* 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.
* 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
* 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.