From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Reyero Subject: Re: Org-jekyll - org-publish-initialize-files-alist Date: Fri, 2 Jul 2010 16:25:45 +0200 Message-ID: References: <87bpas7ngq.fsf@gmx.de> <8763105olf.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=47767 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUhBe-0003Ku-GX for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 10:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUhBc-0006J2-SJ for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 10:25:50 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:63624) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUhBc-0006Ia-Hd for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 10:25:48 -0400 Received: by fxm17 with SMTP id 17so2773102fxm.0 for ; Fri, 02 Jul 2010 07:25:47 -0700 (PDT) In-Reply-To: <8763105olf.fsf@gmx.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Nathan, I've just pushed a version of org-jekyll that should solve the problem, following Sebastian's suggestions, and it's available at http://github.com/juanre/org-jekyll. Sorry it's taken me so long to respond; I am pretty much off-line lately for personal reasons. And thanks for bringing it out. Best, jm -- http://juanreyero.com On Wed, Jun 30, 2010 at 9:04 PM, Sebastian Rose wro= te: > > Nathan Neff writes: > > ... > > Below is the code where org-publish-initialize-files-alist is called > > in org-jekyll. > > It looks like in both cases, the code is trying to figure out what > > project the current > > file belongs to. =A0Can anyone suggest a fix? =A0I don't mean to push t= his > > on anyone, but I really don't know lisp that well. > > > ... > > > (defun org-jekyll-export-current-entry () > > =A0 (interactive) > > =A0 (save-excursion > > =A0 =A0 (org-publish-initialize-files-alist) ; <----------------here > > =A0 =A0 (let ((project-name (cdr (assoc (expand-file-name (buffer-file-= name)) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= org-publish-files-alist)))) > > =A0 =A0 =A0 (org-back-to-heading t) > > =A0 =A0 =A0 (org-jekyll-export-entry project-name)))) > > I suppose `project-name' shall be the name of the project, i.e. a > string? > > > ;; Evtl. needed to keep compiler happy: > (declare-function org-publish-get-project-from-filename "org-publish" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(filename &optional up)) > > (defun org-jekyll-export-current-entry () > =A0(interactive) > =A0(save-excursion > =A0 =A0(let ((project-name (org-publish-get-project-from-filename buffer-= file-name))) > =A0 =A0 =A0(org-back-to-heading t) > =A0 =A0 =A0(org-jekyll-export-entry project-name)))) > > > > > > > (defun org-jekyll-export-blog () > > =A0 "Export all entries in project files that have a :blog: keyword > > and an :on: datestamp. =A0Property drawers are exported as > > front-matters, outline entry title is the exported document > > title. " > > =A0 (interactive) > > =A0 (save-excursion > > =A0 =A0 (org-publish-initialize-files-alist) ;; < -------------- here > > =A0 =A0 (setq org-jekyll-new-buffers nil) > > =A0 =A0 (mapc > > =A0 =A0 =A0(lambda (jfile-project) > > =A0 =A0 =A0 =A0(let ((jfile (car jfile-project)) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0(project (cdr jfile-project))) > > =A0 =A0 =A0 =A0 =A0(if (string=3D (file-name-extension jfile) "org") > > =A0 =A0 =A0 =A0 =A0 =A0 =A0(with-current-buffer (org-get-jekyll-file-bu= ffer jfile) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(org-map-entries (lambda () (org-jekyll-= export-entry project)) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "blog|B= LOG"))))) > > =A0 =A0 =A0(org-publish-get-files (org-publish-expand-projects > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(list (org-p= ublish-get-project-from-filename > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= (buffer-file-name) 'up))))) > > =A0 =A0 (org-release-buffers org-jekyll-new-buffers))) > > > (defun org-jekyll-export-blog () > =A0"Export all entries in project files that have a :blog: keyword > and an :on: datestamp. =A0Property drawers are exported as > front-matters, outline entry title is the exported document > title. " > =A0(interactive) > =A0(save-excursion > =A0 =A0(setq org-jekyll-new-buffers nil) > =A0 =A0(mapc > =A0 =A0 (lambda (jfile-project) > =A0 =A0 =A0 (let ((jfile (car jfile-project)) > =A0 =A0 =A0 =A0 =A0 =A0 (project (cdr jfile-project))) > =A0 =A0 =A0 =A0 (if (string=3D (file-name-extension jfile) "org") > =A0 =A0 =A0 =A0 =A0 =A0 (with-current-buffer (org-get-jekyll-file-buffer = jfile) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 (org-map-entries (lambda () (org-jekyll-expor= t-entry project)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"blog|BLOG= "))))) > > =A0 =A0 ;; NOT SURE IF THIS WILL WORK HERE: > =A0 =A0 (org-publish-get-base-files > =A0 =A0 =A0 (list (org-publish-get-project-from-filename (buffer-file-nam= e) 'up)))) > =A0 =A0(org-release-buffers org-jekyll-new-buffers))) > > > > HTH > > =A0 Sebastian > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode -- http://juanreyero.com/ http://unarueda.com