Function: org-org-publish-to-org

org-org-publish-to-org is an autoloaded and byte-compiled function defined in ox-org.el.gz.

Signature

(org-org-publish-to-org PLIST FILENAME PUB-DIR)

Documentation

Publish an Org file to Org.

FILENAME is the filename of the Org file to be published. PLIST is the property list for the given project. PUB-DIR is the publishing directory.

Return output file name.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-org.el.gz
;;;###autoload
(defun org-org-publish-to-org (plist filename pub-dir)
  "Publish an Org file to Org.

FILENAME is the filename of the Org file to be published.  PLIST
is the property list for the given project.  PUB-DIR is the
publishing directory.

Return output file name."
  (org-publish-org-to 'org filename ".org" plist pub-dir)
  (when (plist-get plist :htmlized-source)
    (org-require-package 'htmlize)
    (require 'ox-html)
    (let* ((org-inhibit-startup t)
	   (htmlize-output-type 'css)
	   (html-ext (concat "." (or (plist-get plist :html-extension)
				     org-html-extension "html")))
	   newbuf)
      (org-with-file-buffer filename
        (font-lock-ensure)
        (org-fold-show-all)
        (setq newbuf (htmlize-buffer)))
      (with-current-buffer newbuf
	(when org-org-htmlized-css-url
	  (goto-char (point-min))
	  (and (re-search-forward
		"<style type=\"text/css\">\\(?:.\\|\n\\)*?\n[ \t]*</style>.*" nil t)
	       (replace-match
		(format
		 "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">"
		 org-org-htmlized-css-url)
                t t)))
	(write-file (concat pub-dir (file-name-nondirectory filename) html-ext)))
      (kill-buffer newbuf))))