From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: to bookmarks Date: Sat, 26 Sep 2009 15:39:09 -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 1Mrd73-0004Np-J4 for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:39:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mrd6y-0004Jq-5f for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:39:20 -0400 Received: from [199.232.76.173] (port=42577 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mrd6y-0004Jg-1t for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:39:16 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:51161) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mrd6x-0001BV-Jn for emacs-orgmode@gnu.org; Sat, 26 Sep 2009 15:39:15 -0400 In-Reply-To: (andrea Crotti's message of "Sat, 26 Sep 2009 13:59:49 +0000 (UTC)") 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: andrea Crotti Cc: emacs-orgmode@gnu.org andrea Crotti writes: > Bookmarks from org-mode: > > I insert many many links inside my orgmode but sometimes I would also like to have them in my > browsers (safari and firefox sometimes). > > Is there already something working out of the box? > > The hierarchy like > > * level1 > ** level2 > [[http://sito.com][sito]] > > Should maybe create directories, for a cleaner view.. 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, which can then -- at least theoretically ;) -- be imported into your favorite web browser. I'm an elisp novice, but it seems to work: --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) (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 (org-substring-no-properties (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--- I'll put it up in the "hacks" section on Worg. Regards, Matt