From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Lundin Subject: Re: to bookmarks Date: Sat, 26 Sep 2009 15:48:19 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrdFt-000843-QU for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:48:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrdFp-00082k-3F for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:48:29 -0400 Received: from [199.232.76.173] (port=56354 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrdFp-00082h-1P for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:48:25 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:45275) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrdFo-00030P-NY for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:48:24 -0400 In-Reply-To: (Matt Lundin's message of "Sat, 26 Sep 2009 15:39:09 -0400") 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: Matt Lundin Cc: emacs-orgmode@gnu.org, andrea Crotti Matt Lundin writes: > I've been looking for similar functionality for a while so I hacked up a > simple function to export the bookmarks of an org file as an html > file, Here's a better version of the function: --8<---------------cut here---------------start------------->8--- (defun org-export-html-bookmarks () "Extract bookmarks from the current org file and create an html file that can be imported into a web browser." (interactive) (unless (eq major-mode 'org-mode) (error "Not in an org buffer")) (let ((file (file-name-nondirectory (buffer-file-name))) bookmarks) (save-excursion (goto-char (point-min)) (while (re-search-forward org-bracket-link-analytic-regexp nil t) (when (equal (match-string 2) "http") (let ((url (concat (match-string 1) (match-string 3))) (desc (match-string 5))) (push (concat "
" desc "\n") bookmarks)))) (with-temp-buffer (insert "\n" "\n" "\n" "Bookmarks\n" "

Bookmarks

\n" "

" file " (" (format-time-string "%Y-%m-%d") ")

\n" "

\n") (apply 'insert (nreverse bookmarks)) (insert "

\n" "") (write-file (concat (file-name-sans-extension file) "-bookmarks.html")))))) --8<---------------cut here---------------end--------------->8---