emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Juan Reyero <joanmg@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Org-jekyll - org-publish-initialize-files-alist
Date: Fri, 2 Jul 2010 16:25:45 +0200	[thread overview]
Message-ID: <AANLkTikqwauQh7_EOVrgWGlvgShcE0iZVyWYYOmuXwv9@mail.gmail.com> (raw)
In-Reply-To: <8763105olf.fsf@gmx.de>

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 <sebastian_rose@gmx.de> wrote:
>
> Nathan Neff <nathan.neff@gmail.com> 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.  Can anyone suggest a fix?  I don't mean to push this
> > on anyone, but I really don't know lisp that well.
>
> > ...
>
> > (defun org-jekyll-export-current-entry ()
> >   (interactive)
> >   (save-excursion
> >     (org-publish-initialize-files-alist) ; <----------------here
> >     (let ((project-name (cdr (assoc (expand-file-name (buffer-file-name))
> >                                     org-publish-files-alist))))
> >       (org-back-to-heading t)
> >       (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"
>                  (filename &optional up))
>
> (defun org-jekyll-export-current-entry ()
>  (interactive)
>  (save-excursion
>    (let ((project-name (org-publish-get-project-from-filename buffer-file-name)))
>      (org-back-to-heading t)
>      (org-jekyll-export-entry project-name))))
>
>
>
>
>
> > (defun org-jekyll-export-blog ()
> >   "Export all entries in project files that have a :blog: keyword
> > and an :on: datestamp.  Property drawers are exported as
> > front-matters, outline entry title is the exported document
> > title. "
> >   (interactive)
> >   (save-excursion
> >     (org-publish-initialize-files-alist) ;; < -------------- here
> >     (setq org-jekyll-new-buffers nil)
> >     (mapc
> >      (lambda (jfile-project)
> >        (let ((jfile (car jfile-project))
> >              (project (cdr jfile-project)))
> >          (if (string= (file-name-extension jfile) "org")
> >              (with-current-buffer (org-get-jekyll-file-buffer jfile)
> >                (org-map-entries (lambda () (org-jekyll-export-entry project))
> >                                 "blog|BLOG")))))
> >      (org-publish-get-files (org-publish-expand-projects
> >                              (list (org-publish-get-project-from-filename
> >                                     (buffer-file-name) 'up)))))
> >     (org-release-buffers org-jekyll-new-buffers)))
>
>
> (defun org-jekyll-export-blog ()
>  "Export all entries in project files that have a :blog: keyword
> and an :on: datestamp.  Property drawers are exported as
> front-matters, outline entry title is the exported document
> title. "
>  (interactive)
>  (save-excursion
>    (setq org-jekyll-new-buffers nil)
>    (mapc
>     (lambda (jfile-project)
>       (let ((jfile (car jfile-project))
>             (project (cdr jfile-project)))
>         (if (string= (file-name-extension jfile) "org")
>             (with-current-buffer (org-get-jekyll-file-buffer jfile)
>               (org-map-entries (lambda () (org-jekyll-export-entry project))
>                                "blog|BLOG")))))
>
>     ;; NOT SURE IF THIS WILL WORK HERE:
>     (org-publish-get-base-files
>       (list (org-publish-get-project-from-filename (buffer-file-name) 'up))))
>    (org-release-buffers org-jekyll-new-buffers)))
>
>
>
> HTH
>
>   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

      reply	other threads:[~2010-07-02 14:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 22:45 Org-jekyll - org-publish-initialize-files-alist Nathan Neff
2010-06-30  3:27 ` Puneeth
2010-06-30  3:49   ` Nick Dokos
2010-06-30 11:32 ` Sebastian Rose
2010-06-30 11:45 ` Sebastian Rose
2010-06-30 14:27   ` Nathan Neff
2010-06-30 19:04     ` Sebastian Rose
2010-07-02 14:25       ` Juan Reyero [this message]

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=AANLkTikqwauQh7_EOVrgWGlvgShcE0iZVyWYYOmuXwv9@mail.gmail.com \
    --to=joanmg@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).