emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Jeff Horn <jrhorn424@gmail.com>
Cc: nicholas.dokos@hp.com, Org-mode ml <emacs-orgmode@gnu.org>
Subject: Re: Re: Need help publishing subdirectories
Date: Tue, 12 Oct 2010 14:10:14 -0400	[thread overview]
Message-ID: <30536.1286907014@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Jeff Horn <jrhorn424@gmail.com> of "Tue, 12 Oct 2010 13:42:12 EDT." <AANLkTikXumVVRZdayktSN9ETAf8F9M9KeZj1gxV8tYE6@mail.gmail.com>

Jeff Horn <jrhorn424@gmail.com> 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))
	 (publishing-function
	  (or (plist-get project-plist :publishing-function)
	      'org-publish-org-to-html))
	 (base-dir
	  (file-name-as-directory
	   (expand-file-name
	    (or (plist-get project-plist :base-directory)
		(error "Project %s does not have :base-directory defined"
		       (car project))))))
	 (pub-dir
	  (file-name-as-directory
	   (file-truename
	    (or (plist-get project-plist :publishing-directory)
		(error "Project %s does not have :publishing-directory defined"
		       (car project))))))
	 tmp-pub-dir)

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

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

;;;VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
;;; 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.

    (debug)

;;;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    (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)))
	      publishing-function)
      (when (org-publish-needed-p filename pub-dir publishing-function
				  tmp-pub-dir)
	(funcall publishing-function project-plist filename tmp-pub-dir)
	(org-publish-update-timestamp
	 filename pub-dir publishing-function)))
    (unless no-cache (org-publish-write-cache-file))))


HTH,
Nick

  reply	other threads:[~2010-10-12 18:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12  3:59 Need help publishing subdirectories Jeff Horn
2010-10-12  5:29 ` Jeff Horn
2010-10-12 15:29   ` Jeff Horn
2010-10-12 15:38     ` Nick Dokos
2010-10-12 16:41       ` Jeff Horn
2010-10-12 17:24         ` Nick Dokos
2010-10-12 17:42           ` Jeff Horn
2010-10-12 18:10             ` Nick Dokos [this message]
2010-10-13  4:24               ` Jeff Horn
2010-10-13 15:23               ` Jeff Horn
2010-10-13 18:02                 ` Jeff Horn
2010-10-14  6:12                   ` Nick Dokos
2010-10-14 11:53                     ` Jeff Horn
2010-10-14  7:30                   ` Carsten Dominik
2010-10-12 18:13             ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30536.1286907014@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jrhorn424@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).