Using org-publish to publish org project
Home > CentOS > CentOS 6.x > Text editors > Emacs > Using org-publish to publish org project
To publish an org project first create publish.el with contents like:
(require 'org)
(require 'ox-publish)
;(load-file "./elisp/htmlize.el")
(defvar *src-dir* "./")
(defvar *docs-dir* "../docs")
(setq org-docs
`("org-docs"
:base-directory ,*src-dir*
:base-extension "org"
:publishing-directory ,*docs-dir*
:recursive t
:publishing-function org-html-publish-to-html
:headline-levels 4 ; Just the default for this project.
:auto-preamble t
:auto-sitemap t
))
(setq org-static `("org-static"
:base-directory ,*src-dir*
:base-extension "css\\|js\\|png\\|ico\\|jpg\\|png\\|gif\\|mp3\\|ogg\\|swf\\|emacs\\|sh\\|py\\|pdf\\|tex\\|css\\|ss\\|rkt\\|flv\\|tgz"
:publishing-directory ,*docs-dir*
:recursive t
:publishing-function org-publish-attachment
))
(setq myproject1
'("myproject1" :components ("org-docs" "org-static")))
(setq org-publish-project-alist
(list org-docs org-static myproject1))
(org-publish-project
myproject1 ; project name
t ; force
)
Then use command 'emacs --script publish.el' to build the project. Here it is assumed that publish.el is in the folder where all the org-files are present. Further it is assumed that documentation (HTML export) is desired in ../docs folder.
Also refer to http://emacs.stackexchange.com/questions/551/how-to-have-org-publish-automatically-publish-generated-images By adding everything except last call to org-publish-project in .emacs, it would be possible to publish default set of projects from running emacs using org-publish-project command without requiring the shell command.
Home > CentOS > CentOS 6.x > Text editors > Emacs > Using org-publish to publish org project