Next: , Previous: Selecting files, Up: Configuration

13.1.4 Publishing action

Publishing means that a file is copied to the destination directory and possibly transformed in the process. The default transformation is to export Org files as HTML files, and this is done by the function org-html-publish-to-html, which calls the HTML exporter (see HTML export). But you also can publish your content as PDF files using org-latex-publish-to-pdf or as ascii, Texinfo, etc., using the corresponding functions.

If you want to publish the Org file as an .org file but with the archived, commented and tag-excluded trees removed, use the function org-org-publish-to-org. This will produce file.org and put it in the publishing directory. If you want a htmlized version of this file, set the parameter :htmlized-source to t, it will produce file.org.html in the publishing directory1.

Other files like images only need to be copied to the publishing destination. For this you can use org-publish-attachment. For non-org files, you always need to specify the publishing function:

:publishing-function Function executing the publication of a file. This may also be a list of functions, which will all be called in turn.
:htmlized-source non-nil means, publish htmlized source.

The function must accept three arguments: a property list containing at least a :publishing-directory property, the name of the file to be published and the path to the publishing directory of the output file. It should take the specified file, make the necessary transformation (if any) and place the result into the destination folder.


Footnotes

[1] If the publishing directory is the same than the source directory, file.org will be exported as file.org.org, so probably don't want to do this.