[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Need help publishing subdirectories

From: Nick Dokos
Subject: Re: [Orgmode] Re: Need help publishing subdirectories
Date: Tue, 12 Oct 2010 14:10:14 -0400

Jeff Horn <address@hidden> wrote:

> > So, you are changing the project settings but you don't see the changes
> > in the html files? Have you investigated caching effects? Not only at
> > the web browser but also at the org-mode publishing level? org-publish
> > keeps timestamps on org files and does not update the html files if they
> > have not been changed.
> Thanks for your help, Nick. I have been deleting ~/.org-timestamps/
> when republishing, and forcing a refresh of the web browser.
> If I open the HTML files in an editor, I can see the table of contents
> in the file, and there is no customer stylesheet link, and there is
> the default style wrapped in CDATA.

OK - let me try to summarize and see if I have understood correctly:

o in your org-publish-project-alist you set :table-of-contents to nil
o you clear the timestamps directory
o you run org-publish and you examine the resulting html file and it
  contains a TOC.
o the html file's modification time is correct, i.e. it was updated
  a few seconds ago.

Correct so far?

I cannot reproduce this in my setup:

Org-mode version 7.01trans (release_7.01h.654.g3afc)

Unless somebody can see what's wrong, if you don't mind doing some elisp
debugging, I 'd suggest adding a (debug) call in org-publish-file and
checking the value of the plist before the publishing function is
called (look for the big, marked section below for more details):

(defun org-publish-file (filename &optional project no-cache)
  "Publish file FILENAME from PROJECT.
If NO-CACHE is not nil, do not initialize org-publish-cache and
write it to disk.  This is needed, since this function is used to
publish single files, when entire projects are published.
See `org-publish-projects'."
  (let* ((project
          (or project
              (or (org-publish-get-project-from-filename filename)
                  (error "File %s not part of any known project"
                         (abbreviate-file-name filename)))))
         (project-plist (cdr project))
         (ftname (expand-file-name filename))
          (or (plist-get project-plist :publishing-function)
            (or (plist-get project-plist :base-directory)
                (error "Project %s does not have :base-directory defined"
                       (car project))))))
            (or (plist-get project-plist :publishing-directory)
                (error "Project %s does not have :publishing-directory defined"
                       (car project))))))

    (unless no-cache
      (org-publish-initialize-cache (car project)))

    (setq tmp-pub-dir
           (concat pub-dir
                   (and (string-match (regexp-quote base-dir) ftname)
                        (substring ftname (match-end 0))))))

;;; add a debug call, reeavaluate the function, do the publish and when
;;; you are dumped into the debugger, say e project-plist <RET> and see
;;; what :table-of-contents is set to. If it's what it's supposed to be,
;;; continue execution with c and look at the html file, both contents
;;; and modification time. If it's still wrong in terms of contents but
;;; right in terms of modification time, there is something wrong with
;;; the publishing function: you might want to step through it with
;;; edebug, checking things along the way.



    (if (listp publishing-function)
        ;; allow chain of publishing functions
        (mapc (lambda (f)
                (when (org-publish-needed-p filename pub-dir f tmp-pub-dir)
                  (funcall f project-plist filename tmp-pub-dir)
                  (org-publish-update-timestamp filename pub-dir f)))
      (when (org-publish-needed-p filename pub-dir publishing-function
        (funcall publishing-function project-plist filename tmp-pub-dir)
         filename pub-dir publishing-function)))
    (unless no-cache (org-publish-write-cache-file))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]