emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Possible? Markdown-syntax for links in org-mode


From: Carsten Dominik
Subject: Re: [Orgmode] Possible? Markdown-syntax for links in org-mode
Date: Mon, 4 Dec 2006 11:52:45 +0100

Hi Phil,

this is currently not possible.

I guess my solution would be to create a special command to insert links, similar to C-c C-l in org-mode. If you then bind this function also to C-c C-l in whatever mode you are using for writing markdown, this command would prompt you for link and description just like the Org-mode command, but then insert the markdown syntax into the buffer.

Something like:

(defun my-insert-markdown-link (link description title)
  "Insert a markdown link."
  (interactive "sLink: \nsDescription: \nsTitle: ")
  (if (string-match "\\S-" title)
      ;; we do have a non-empty title
      (insert (format "[%s](%s \"%s\")" description link title))
    (insert (format "[%s](%s)" description link))))

(add-hook 'my-markdown-mode-hook
          (lambda ()
            (define-key (current-local-map) "\C-c\C-l"
              'my-insert-markdown-link)))

"my-markdown-mode-hook" must be the correct hook for the mode you are using.

Hope this helps.

- Carsten




On Dec 1, 2006, at 20:49, Phil wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm using Markdown on my wordpress-powered-blog and I'm always confused when switching applications, because the syntax is different:

+ org-mode: [[LINK-TEXT][URL]]
documentation: http://staff.science.uva.nl/~dominik/Tools/org/org.html#Hyperlinks

+ markdown: [LINK-TEXT](URL "optional TITLE")
documentation: http://daringfireball.net/projects/markdown/syntax#link

QUESTION: Is there a way to setup org-mode to use the markdown-syntax?

regards from Berlin

- - Phil


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFcIdMuJlsHqDZFGYRAhCRAJ0ZjWxXzh+Tz03060yJNqFcaODGNwCfayn6
R0eNy37oPszVlflhUOFIXEo=
=oG+1
-----END PGP SIGNATURE-----


_______________________________________________
Emacs-orgmode mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477





reply via email to

[Prev in Thread] Current Thread [Next in Thread]