“Pages” will be delimited using a special regexp, such as “^\f$”. The first piece of text following the page delimiter and matching another regexp will be the title, for example “^\\(.*\\)$” which will make the first line after the page separator the title.
All textual occurences of the title will be linked to the relevant page. (Whitespace will be normalized.)
OK, here some mini-defun which could get this started. As a counterpart, we’d need a defun which looks at the text surrounding point and tries to match it against a heading returned by outline-headings. That would be the outline-wiki-jump defun then…
(defun outline-headings () "Returns a ALIST of all outline headings in the current buffer. Entries look like (HEADING POS LEVEL) where HEADING is a string, POS is the position of that heading line and LEVEL is the outline-level of that heading." (let ((regexp (concat outline-regexp "\\s-*\\(.*\\)\\s-*" outline-heading-end-regexp)) headings) (save-excursion (goto-char (point-min)) (when (looking-at regexp) ;; We are bobp (push (list (match-string 1) (point) (outline-level)) headings)) (while (outline-next-heading) (when (looking-at regexp) (push (list (match-string 1) (point) (outline-level)) headings)))) (nreverse headings)))