>>>>> "BP" == Bob Paddock <[EMAIL PROTECTED]> writes:

  BP> I want to overhaul my websites, and I'd like to use Muse.  I've
  BP> looked for a simple, and complete, example of how to use Muse
  BP> when the site is organized into different directories, but have
  BP> not found one.  Can someone please point me to such an example?


I use a combination of the following:

First, I set

(setq muse-file-regexp "/$\\|[a-zA-Z]+[.][a-zA-Z]+)")

which make .. and . have the semantics you would expect (as well as
other things, so be careful!).

Secondly, I use my own muse-settings.el package which allows you to
configure muse in each directory with (sort of) local files. This
package should work better, but it's some of the way there. I posted
this a few days back.

Finally, I use an "interwiki" protocol that I wrote (below). This
enables the website presentation and the local directory structure to
be differentiated from each other. 

I think that I'm in the same position though. Muse inherits its
interaction pattern from emacs-wiki which is focused on the "source
files in one directory, wiki", while I am trying to use it as a
general purpose web publishing environment. Better directory support
*should* enable both. On the other hand, it may conflict with the idea
of muse as a general purpose multi-format publishing environment,
which, I admit, I care less about. 

All of the following should be taken with a pinch of salt. Muse
advances all the time, and it may have better mechanisms in place for
support of stuff that I hacked in during earlier versions. 

Phil



;; interwiki protocol handling. This enables non wiki word type
;; interwiki support, with a different local resolve. 
;; (adelete 'muse-url-protocols "iw:")
(add-to-list 'muse-url-protocols
             '("iw:" phil-muse-browse-url-iw phil-muse-resolve-url-iw))

(setq phil-muse-interwiki-protocol-alist
      '(("home" "/" "~/src/ht/home_website")
        ("silly" "/silly/" "~/src/ht/home_website/silly")
        ("energy" "/energy/" "~/src/ht/home_website/energy")
        ("journal" "/journal/" "~/src/ht/home_website/journal")))
     
     
(defun phil-muse-resolve-url-iw (url)
  (when (string-match "\\`iw:\\([a-zA-Z]*\\)\\\\\\(.+\\)\\([#].*\\)" url)
    (let* ((wiki-resolve 
            (assoc (match-string 1 url)
                   phil-muse-interwiki-protocol-alist))
           (publish-resolve
            (nth 1 wiki-resolve)))
      
      (concat publish-resolve 
              (match-string 2 url)
              ;; hard coded extensions. Sure muse stores this
              ;; somewhere. 
              ".html"
              (match-string 3 url)))))
     
;; this doesn't handle anchors properly yet. 
(defun phil-muse-browse-url-iw (url)
  (when (string-match "\\`iw:\\([a-zA-Z]*\\)\\\\\\(.+\\)#?\\(.*\\)" url)
    (let* ((wiki-resolve 
            (assoc (match-string 1 url)
                   phil-muse-interwiki-protocol-alist))
           (browse-resolve
            (or (nth 2 wiki-resolve)
                (nth 1 wiki-resolve))))
      (find-file 
       (concat browse-resolve "/"
               (match-string 2 url)
               ".muse")))))

_______________________________________________
Muse-el-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/muse-el-discuss

Reply via email to