From 4e8bf7e8c54890ee72cb2b47560b339f60186d35 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Fri, 21 Apr 2006 19:31:23 +0000 Subject: [PATCH] Re-add some cgi.el stuff and update my example config. * contrib/cgi.el (cgi-calendar-string, cgi-calendar): Re-add these, since they are mentioned in the documentation. * examples/mwolson/: Update. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-112 --- ChangeLog.2006 | 18 +++++++++++++++++ contrib/cgi.el | 36 ++++++++++++++++++++++++++++++++++ examples/mwolson/muse-init.el | 10 +++++----- examples/mwolson/templates/footer.html | 4 ++-- examples/mwolson/templates/header.html | 4 +++- 5 files changed, 64 insertions(+), 8 deletions(-) diff --git a/ChangeLog.2006 b/ChangeLog.2006 index 2490062..55fd08e 100644 --- a/ChangeLog.2006 +++ b/ChangeLog.2006 @@ -2,6 +2,24 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2006/muse--main--1.0 # +2006-04-21 19:31:23 GMT Michael Olson patch-112 + + Summary: + Re-add some cgi.el stuff and update my example config. + Revision: + muse--main--1.0--patch-112 + + * contrib/cgi.el (cgi-calendar-string, cgi-calendar): Re-add these, since + they are mentioned in the documentation. + + * examples/mwolson/: Update. + + modified files: + ChangeLog.2006 contrib/cgi.el examples/mwolson/muse-init.el + examples/mwolson/templates/footer.html + examples/mwolson/templates/header.html + + 2006-04-21 15:23:13 GMT Michael Olson patch-111 Summary: diff --git a/contrib/cgi.el b/contrib/cgi.el index a516b75..5d13486 100644 --- a/contrib/cgi.el +++ b/contrib/cgi.el @@ -153,6 +153,42 @@ (t (cgi-lose "Can't handle request method %s" method))))) +;; ==================================================================== +;; a sample application: calendar via the web. If invoked without +;; arguments, presents a calendar for the three months around the +;; current date. You can request a calendar for a specific period by +;; specifying the year and the month in the query string: +;; +;; ~$ lynx -dump 'http://localhost/cgi-bin/cal?year=1975&month=6' +;; +;; When run in batch mode, text normally displayed in the echo area +;; (via `princ' for example) goes to stdout, and thus to the browser. +;; Text output using `message' goes to stderr, and thus normally to +;; your web server's error_log. +;; ==================================================================== +(defun cgi-calendar-string () + (require 'calendar) + (let* ((args (cgi-arguments)) + (now (calendar-current-date)) + (mnth (cdr (assoc "month" args))) + (month (if mnth (string-to-number mnth) + (extract-calendar-month now))) + (yr (cdr (assoc "year" args))) + (year (if yr (string-to-number yr) + (extract-calendar-year now)))) + (with-temp-buffer + (generate-calendar month year) + (buffer-string)))) + +(defun cgi-calendar () + (cgi-evaluate + (princ "Content-type: text/html\n\n") + (princ "Emacs calendar\r\n") + (princ "

Emacs calendar

\r\n") + (princ "
\r\n")
+   (princ (cgi-calendar-string))
+   (princ "\r\n
\r\n"))) + (provide 'cgi) ;; cgi.el ends here diff --git a/examples/mwolson/muse-init.el b/examples/mwolson/muse-init.el index 110929f..0625f10 100644 --- a/examples/mwolson/muse-init.el +++ b/examples/mwolson/muse-init.el @@ -140,7 +140,7 @@ (call-interactively 'muse-project-find-file))) ;; Determine whether we are publishing a certain kind of output -(defsubst my-muse-format-p (format) +(defun my-muse-format-p (format) (let ((base (muse-get-keyword :base muse-publishing-current-style))) (when base (string-match format base)))) @@ -229,7 +229,6 @@ If FILE is not specified, use the published version of the current file." '(muse-blosxom-base-directory "~/proj/wiki/blog/") '(muse-colors-autogen-headings (quote outline)) '(muse-colors-inline-image-method (quote muse-colors-use-publishing-directory)) - '(muse-file-extension "muse") '(muse-html-charset-default "utf-8") '(muse-html-encoding-default (quote utf-8)) '(muse-html-footer "~/personal-site/muse/generic-footer.html") @@ -239,14 +238,15 @@ If FILE is not specified, use the published version of the current file." ") '(muse-latex-header "~/personal-site/muse/header.tex") - '(muse-mode-auto-p nil nil (muse-project)) - '(muse-mode-highlight-p t nil (muse-colors)) '(muse-mode-hook (quote (flyspell-mode footnote-mode))) '(muse-publish-comments-p t) '(muse-publish-desc-transforms (quote (muse-wiki-publish-pretty-title muse-wiki-publish-pretty-interwiki))) '(muse-wiki-publish-small-title-words (quote ("the" "and" "at" "on" "of" "for" "in" "an" "a" "page"))) '(muse-xhtml-footer "~/personal-site/muse/generic-footer.html") - '(muse-xhtml-header "~/personal-site/muse/generic-header.html")) + '(muse-xhtml-header "~/personal-site/muse/generic-header.html") + '(muse-xhtml-style-sheet " + +")) (custom-set-faces '(muse-bad-link ((t (:foreground "DeepPink" :underline "DeepPink" :weight bold)))) '(muse-link ((t (:foreground "blue" :underline "blue" :weight bold))))) diff --git a/examples/mwolson/templates/footer.html b/examples/mwolson/templates/footer.html index 42516e2..3da7490 100644 --- a/examples/mwolson/templates/footer.html +++ b/examples/mwolson/templates/footer.html @@ -62,9 +62,9 @@ [FSF Associate Member] - - Debian logo + Ubuntu logo diff --git a/examples/mwolson/templates/header.html b/examples/mwolson/templates/header.html index ed1eecd..41ecadb 100644 --- a/examples/mwolson/templates/header.html +++ b/examples/mwolson/templates/header.html @@ -9,7 +9,9 @@ - muse-html-style-sheet + + (muse-style-element :style-sheet muse-publishing-current-style) + -- 2.11.4.GIT