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

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

[emacs-wiki-discuss] Re: how to manage links for non-wiki files


From: Jean-Philippe Georget
Subject: [emacs-wiki-discuss] Re: how to manage links for non-wiki files
Date: Sat, 25 Sep 2004 14:48:52 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Sacha Chua <address@hidden> a écrit :

> Jean-Philippe Georget <address@hidden> writes:
>
>> How can manage files which are not wiki files ?
>> For example, I have these files :
>>   ~/Wiki/WelcomePage
>>   ~/Wiki/example.pdf
>> and in my ~/Wiki/WelcomePage, I put [[example.pdf]].
>> How can I publish my wiki page and my pdf file ?
>
> Due to the difficulty of telling wiki pages and non-wiki pages apart,
> everything in my planner directory is a wiki page. (Otherwise,
> emacs-wiki would try to publish example.pdf.)
>
> I get around this limitation by using directories. For example, I
> store my planner pages in notebook/plans/ and my published wiki pages
> in notebook/wiki/ . I can then link to resources in my published wiki
> directory with the link [[../wiki/example.pdf]], which works in Emacs
> and on the Net.

Thanks for your answers.

1.
I find also this trick on http://www.math.tu-berlin.de/~freundt/.wiki

  
  (defvar my-emacs-wiki-never-publish '(".*priv\\|\\.\\(?:jpg\\|png\\|css\\)")
    "Files never to be published.")
  
  (defun emacs-wiki-private-p (name)
    "Return non-nil if NAME is a private page, and shouldn't be published."
    (if name
        (if emacs-wiki-use-mode-flags
            (let* ((page-file (emacs-wiki-page-file name t))
                   (filename (and page-file (file-truename page-file))))
              (if filename
                  (or (eq ?- (aref (nth 8 (file-attributes
                                           (file-name-directory filename))) 7))
                      (eq ?- (aref (nth 8 (file-attributes filename)) 7))
                      ;; changes beginning
                      (some (lambda (rexp)
                              (string-match rexp filename))
                            my-emacs-wiki-never-publish))))
                      ;; changes end
          (let ((private-pages emacs-wiki-private-pages) private)
            (while private-pages
              (if (string-match (car private-pages) name)
                  (setq private t private-pages nil)
                (setq private-pages (cdr private-pages))))
            private))))

and then put this in my init file

  (setq emacs-wiki-private-pages 
'("[/?]\\|\\.\\(html?\\|pdf\\|priv\\|css\\|tex\\|el\\|zip\\|txt\\|tar\\)\\(\\.\\(gz\\|bz2\\)\\)?\\'"))
  (setq my-emacs-wiki-never-publish 
'("[/?]\\|\\.\\(html?\\|pdf\\|tex\\|priv\\|css\\|\\|el\\|zip\\|txt\\|tar\\)\\(\\.\\(gz\\|bz2\\)\\)?\\'"))


and it works (even I don't understand everything but it works  ;-). 

The problem now is that I have to publish manually my pdf files for
example.


2.  Now, I use also "priv" extension (see variables above) to have
some "private" wiki pages. I use this with <comment>. Finally, I use
it with something like

  <comment>
  [[./PrivatePage.priv]]
  </comment>

I can have some informations in my wiki that will not be published.


-- 
Jean-Philippe Georget - address@hidden





reply via email to

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