emacs-wiki-discuss
[Top][All Lists]
Advanced

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

[emacs-wiki-discuss] Wikipedia-style extended links


From: Helge Kosuch
Subject: [emacs-wiki-discuss] Wikipedia-style extended links
Date: Sat, 28 Feb 2004 09:42:01 +0100

Hallo EmacsWikizens!

First: EmacsWiki is great, thank you for everybody contributing to it!

Second: I would like to insert a mode which alters the format of the
extended links in a way that it matches wikipedia.org's extended links. I
bravely tried to just alter the emacs-wiki-extended-link-regexp... but that
was too brave. It worked fine for generating a link, but I hit an error when
I tried to follow that link, because there are probably other places in the
code which need to be altered. Can anybody give me a hint at which places I
should take a look?

More info:
The extended link
[[BogusInfo][This is a link to bogus info]]
would be
[[BogusLink|This is a link to bogus info]]
in Wikipedia.

[[http://www.bogus.com][This is a link to bogus info]]
would be
[[http://www.bogus.com This is a link to bogus info] (This time without the
"|"!)
in Wikipedia.

I know that EmacsWiki's format is nicer and more consistent, but having to
bother about only one format is more important to me.

Cheers,

:) Helge

Here comes my version of the regexp for wikipedia-style extended links:

;;(defcustom emacs-wiki-extended-link-regexp
;;  "\\[\\[\\([^] \t\n]+\\)\\(\\|\\([^]\n]+\\)\\)?\\]\\]"
;;  "Regexp used to match [[extended][links]]."
;;  :type 'regexp
;;  :group 'emacs-wiki)
  
  ;; The whole thing as a hierarchy:
  
        ;;              \\[\\[
        ;;              \\(
        ;;                      [^
        ;;                              ]
        ;;                              SPACE
        ;;                              \t
        ;;                              \n 
        ;;                      ]+
        ;;              \\)
        ;;              
        ;;              \\(
        ;;                      \\[
        ;;                      \\(
        ;;                              [^
        ;;                                      ]
        ;;                                      \n
        ;;                              ]+
        ;;                      \\)
        ;;              \\)?
        ;;
        ;;      \\]
        ;;      \\]      





reply via email to

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