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-publish-org-to-html which calls the HTML exporter (see HTML export). But you also can publish your content as PDF files using org-publish-org-to-pdf, or as ascii, latin1 or utf8 encoded files using the corresponding functions. If you want to publish the Org file itself, but with archived, commented, and tag-excluded trees removed, use org-publish-org-to-org and set the parameters :plain-source and/or :htmlized-source. This will produce and in the publishing directory1. Other files like images only need to be copied to the publishing destination; for this you may 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.
:plain-source Non-nil means, publish plain source.
: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.


[1] and if source and publishing directories are equal. Note that with this kind of setup, you need to add :exclude "-source\\.org" to the project definition in org-publish-project-alist to prevent the published source files from being considered as new org files the next time the project is published.