Mercurial > emacs
annotate lisp/calendar/cal-html.el @ 92831:65bc0cdc7f5f
(diary-list-entries): Fix autoload.
(generated-autoload-file): Don't set, instead use different values of
generate-autoload-cookie plus Makefile rules to allow for a mixture of
internal calendar autoloads and normal autoloads.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 13 Mar 2008 05:43:00 +0000 |
parents | 727105264b1c |
children | 9b1631fe02a8 |
rev | line source |
---|---|
73517
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
1 ;;; cal-html.el --- functions for printing HTML calendars |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
2 |
92584
727105264b1c
Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
79703
diff
changeset
|
3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 |
727105264b1c
Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
79703
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
73517
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
5 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
6 ;; Author: Anna M. Bigatti <bigatti@dima.unige.it> |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
7 ;; Keywords: calendar |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
8 ;; Human-Keywords: calendar, diary, HTML |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
9 ;; Created: 23 Aug 2002 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
10 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
12 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
78216
93e11478c954
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
15 ;; the Free Software Foundation; either version 3, or (at your option) |
73517
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
16 ;; any later version. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
17 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
22 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
26 ;; Boston, MA 02110-1301, USA. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
27 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
28 ;;; Commentary: |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
29 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
30 ;; This package writes HTML calendar files using the user's diary |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
31 ;; file. See the Emacs manual for details. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
32 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
33 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
34 ;;; Code: |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
35 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
36 (require 'calendar) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
37 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
38 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
39 (defgroup calendar-html nil |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
40 "Options for HTML calendars." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
41 :prefix "cal-html-" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
42 :group 'calendar) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
43 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
44 (defcustom cal-html-directory "~/public_html" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
45 "Directory for HTML pages generated by cal-html." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
46 :type 'string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
47 :group 'calendar-html) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
48 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
49 (defcustom cal-html-print-day-number-flag nil |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
50 "Non-nil means print the day-of-the-year number in the monthly cal-html page." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
51 :type 'boolean |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
52 :group 'calendar-html) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
53 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
54 (defcustom cal-html-year-index-cols 3 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
55 "Number of columns in the cal-html yearly index page." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
56 :type 'integer |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
57 :group 'calendar-html) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
58 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
59 (defcustom cal-html-day-abbrev-array |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
60 (calendar-abbrev-construct calendar-day-abbrev-array |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
61 calendar-day-name-array) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
62 "Array of seven strings for abbreviated day names (starting with Sunday)." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
63 :type '(vector string string string string string string string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
64 :group 'calendar-html) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
65 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
66 (defcustom cal-html-css-default |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
67 (concat |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
68 "<STYLE TYPE=\"text/css\">\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
69 " BODY { background: #bde; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
70 " H1 { text-align: center; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
71 " TABLE { padding: 2pt; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
72 " TH { background: #dee; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
73 " TABLE.year { width: 100%; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
74 " TABLE.agenda { width: 100%; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
75 " TABLE.header { width: 100%; text-align: center; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
76 " TABLE.minical TD { background: white; text-align: center; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
77 " TABLE.agenda TD { background: white; text-align: left; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
78 " TABLE.agenda TH { text-align: left; width: 20%; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
79 " SPAN.NO-YEAR { color: #0b3; font-weight: bold; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
80 " SPAN.ANN { color: #0bb; font-weight: bold; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
81 " SPAN.BLOCK { color: #048; font-style: italic; }\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
82 "</STYLE>\n\n") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
83 "Default cal-html css style. You can override this with a \"cal.css\" file." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
84 :type 'string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
85 :group 'calendar-html) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
86 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
87 ;;; End customizable variables. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
88 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
89 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
90 ;;; HTML and CSS code constants. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
91 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
92 (defconst cal-html-e-document-string "<BR><BR>\n</BODY>\n</HTML>" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
93 "HTML code for end of page.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
94 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
95 (defconst cal-html-b-tablerow-string "<TR>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
96 "HTML code for beginning of table row.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
97 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
98 (defconst cal-html-e-tablerow-string "</TR>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
99 "HTML code for end of table row.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
100 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
101 (defconst cal-html-b-tabledata-string " <TD>" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
102 "HTML code for beginning of table data.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
103 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
104 (defconst cal-html-e-tabledata-string " </TD>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
105 "HTML code for end of table data.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
106 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
107 (defconst cal-html-b-tableheader-string " <TH>" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
108 "HTML code for beginning of table header.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
109 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
110 (defconst cal-html-e-tableheader-string " </TH>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
111 "HTML code for end of table header.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
112 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
113 (defconst cal-html-e-table-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
114 "</TABLE>\n<!-- ================================================== -->\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
115 "HTML code for end of table.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
116 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
117 (defconst cal-html-minical-day-format " <TD><a href=%s#%d>%d</TD>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
118 "HTML code for a day in the minical - links NUM to month-page#NUM.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
119 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
120 (defconst cal-html-b-document-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
121 (concat |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
122 "<HTML>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
123 "<HEAD>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
124 "<TITLE>Calendar</TITLE>\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
125 "<!--This buffer was produced by cal-html.el-->\n\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
126 cal-html-css-default |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
127 "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"cal.css\">\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
128 "</HEAD>\n\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
129 "<BODY>\n\n") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
130 "Initial block for html page.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
131 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
132 (defconst cal-html-html-subst-list |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
133 '(("&" . "&") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
134 ("\n" . "<BR>\n")) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
135 "Alist of symbols and their HTML replacements.") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
136 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
137 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
138 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
139 (defun cal-html-comment (string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
140 "Return STRING as html comment." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
141 (format "<!-- ====== %s ====== -->\n" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
142 (replace-regexp-in-string "--" "++" string))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
143 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
144 (defun cal-html-href (link string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
145 "Return a hyperlink to url LINK with text STRING." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
146 (format "<A HREF=\"%s\">%s</A>" link string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
147 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
148 (defun cal-html-h3 (string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
149 "Return STRING as html header h3." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
150 (format "\n <H3>%s</H3>\n" string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
151 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
152 (defun cal-html-h1 (string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
153 "Return STRING as html header h1." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
154 (format "\n <H1>%s</H1>\n" string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
155 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
156 (defun cal-html-th (string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
157 "Return STRING as html table header." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
158 (format "%s%s%s" cal-html-b-tableheader-string string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
159 cal-html-e-tableheader-string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
160 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
161 (defun cal-html-b-table (arg) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
162 "Return table tag with attribute ARG." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
163 (format "\n<TABLE %s>\n" arg)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
164 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
165 (defun cal-html-monthpage-name (month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
166 "Return name of html page for numeric MONTH and four-digit YEAR. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
167 For example, \"2006-08.html\" for 8 2006." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
168 (format "%d-%.2d.html" year month)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
169 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
170 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
171 (defun cal-html-insert-link-monthpage (month year &optional change-dir) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
172 "Insert a link to the html page for numeric MONTH and four-digit YEAR. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
173 If optional argument CHANGE-DIR is non-nil and MONTH is 1 or 2, |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
174 the link points to a different year and so has a directory part." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
175 (insert (cal-html-h3 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
176 (cal-html-href |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
177 (concat (and change-dir |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
178 (member month '(1 12)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
179 (format "../%d/" year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
180 (cal-html-monthpage-name month year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
181 (calendar-month-name month))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
182 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
183 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
184 (defun cal-html-insert-link-yearpage (month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
185 "Insert a link to index page for four-digit YEAR, tagged using MONTH name." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
186 (insert (cal-html-h1 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
187 (format "%s %s" |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
188 (calendar-month-name month) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
189 (cal-html-href "index.html" (number-to-string year)))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
190 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
191 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
192 (defun cal-html-year-dir-ask-user (year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
193 "Prompt for the html calendar output directory for four-digit YEAR. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
194 Return the expanded directory name, which is based on |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
195 `cal-html-directory' by default." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
196 (expand-file-name (read-directory-name |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
197 "Enter HTML calendar directory name: " |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
198 (expand-file-name (format "%d" year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
199 cal-html-directory)))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
200 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
201 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
202 ;; page header |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
203 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
204 (defun cal-html-insert-month-header (month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
205 "Insert the header for the numeric MONTH page for four-digit YEAR. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
206 Contains links to previous and next month and year, and current minical." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
207 (insert (cal-html-b-table "class=header")) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
208 (insert cal-html-b-tablerow-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
209 (insert cal-html-b-tabledata-string) ; month links |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
210 (increment-calendar-month month year -1) ; previous month |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
211 (cal-html-insert-link-monthpage month year t) ; t --> change-dir |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
212 (increment-calendar-month month year 1) ; current month |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
213 (cal-html-insert-link-yearpage month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
214 (increment-calendar-month month year 1) ; next month |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
215 (cal-html-insert-link-monthpage month year t) ; t --> change-dir |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
216 (insert cal-html-e-tabledata-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
217 (insert cal-html-b-tabledata-string) ; minical |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
218 (increment-calendar-month month year -1) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
219 (cal-html-insert-minical month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
220 (insert cal-html-e-tabledata-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
221 (insert cal-html-e-tablerow-string) ; end |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
222 (insert cal-html-e-table-string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
223 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
224 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
225 ;; minical: a small month calendar with links |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
226 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
227 (defun cal-html-insert-minical (month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
228 "Insert a minical for numeric MONTH of YEAR." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
229 (let* ((blank-days ; at start of month |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
230 (mod (- (calendar-day-of-week (list month 1 year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
231 calendar-week-start-day) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
232 7)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
233 (last (calendar-last-day-of-month month year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
234 (end-blank-days ; at end of month |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
235 (mod (- 6 (- (calendar-day-of-week (list month last year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
236 calendar-week-start-day)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
237 7)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
238 (monthpage-name (cal-html-monthpage-name month year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
239 date) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
240 ;; Start writing table. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
241 (insert (cal-html-comment "MINICAL") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
242 (cal-html-b-table "class=minical border=1 align=center")) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
243 ;; Weekdays row. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
244 (insert cal-html-b-tablerow-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
245 (dotimes (i 7) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
246 (insert (cal-html-th |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
247 (aref cal-html-day-abbrev-array |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
248 (mod (+ i calendar-week-start-day) 7))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
249 (insert cal-html-e-tablerow-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
250 ;; Initial empty slots. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
251 (insert cal-html-b-tablerow-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
252 (dotimes (i blank-days) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
253 (insert |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
254 cal-html-b-tabledata-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
255 cal-html-e-tabledata-string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
256 ;; Numbers. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
257 (dotimes (i last) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
258 (insert (format cal-html-minical-day-format monthpage-name i (1+ i))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
259 ;; New row? |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
260 (if (and (zerop (mod (+ i 1 blank-days) 7)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
261 (/= (1+ i) last)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
262 (insert cal-html-e-tablerow-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
263 cal-html-b-tablerow-string))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
264 ;; End empty slots (for some browsers like konqueror). |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
265 (dotimes (i end-blank-days) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
266 (insert |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
267 cal-html-b-tabledata-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
268 cal-html-e-tabledata-string))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
269 (insert cal-html-e-tablerow-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
270 cal-html-e-table-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
271 (cal-html-comment "MINICAL end"))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
272 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
273 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
274 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
275 ;; year index page with minicals |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
276 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
277 (defun cal-html-insert-year-minicals (year cols) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
278 "Make a one page yearly mini-calendar for four-digit YEAR. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
279 There are 12/cols rows of COLS months each." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
280 (insert cal-html-b-document-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
281 (insert (cal-html-h1 (number-to-string year))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
282 (insert (cal-html-b-table "class=year") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
283 cal-html-b-tablerow-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
284 (dotimes (i 12) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
285 (insert cal-html-b-tabledata-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
286 (cal-html-insert-link-monthpage (1+ i) year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
287 (cal-html-insert-minical (1+ i) year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
288 (insert cal-html-e-tabledata-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
289 (if (zerop (mod (1+ i) cols)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
290 (insert cal-html-e-tablerow-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
291 cal-html-b-tablerow-string))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
292 (insert cal-html-e-tablerow-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
293 cal-html-e-table-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
294 cal-html-e-document-string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
295 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
296 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
297 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
298 ;; HTMLify |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
299 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
300 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
301 (defun cal-html-htmlify-string (string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
302 "Protect special characters in STRING from HTML. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
303 Characters are replaced according to `cal-html-html-subst-list'." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
304 (if (stringp string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
305 (replace-regexp-in-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
306 (regexp-opt (mapcar 'car cal-html-html-subst-list)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
307 (lambda (x) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
308 (cdr (assoc x cal-html-html-subst-list))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
309 string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
310 "")) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
311 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
312 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
313 (defun cal-html-htmlify-entry (entry) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
314 "Convert a diary entry ENTRY to html with the appropriate class specifier." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
315 (let ((start |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
316 (cond |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
317 ((string-match "block" (car (cddr entry))) "BLOCK") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
318 ((string-match "anniversary" (car (cddr entry))) "ANN") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
319 ((not (string-match |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
320 (number-to-string (car (cddr (car entry)))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
321 (car (cddr entry)))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
322 "NO-YEAR") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
323 (t "NORMAL")))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
324 (format "<span class=%s>%s</span>" start |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
325 (cal-html-htmlify-string (cadr entry))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
326 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
327 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
328 (defun cal-html-htmlify-list (date-list date) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
329 "Return a string of concatenated, HTMLified diary entries. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
330 DATE-LIST is a list of diary entries. Return only those matching DATE." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
331 (mapconcat (lambda (x) (cal-html-htmlify-entry x)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
332 (let (result) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
333 (dolist (p date-list (reverse result)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
334 (and (car p) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
335 (calendar-date-equal date (car p)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
336 (setq result (cons p result))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
337 "<BR>\n ")) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
338 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
339 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
340 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
341 ;; Monthly calendar |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
342 ;;------------------------------------------------------------ |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
343 |
92831
65bc0cdc7f5f
(diary-list-entries): Fix autoload.
Glenn Morris <rgm@gnu.org>
parents:
92584
diff
changeset
|
344 (autoload 'diary-list-entries "diary-lib") |
73517
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
345 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
346 (defun cal-html-list-diary-entries (d1 d2) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
347 "Generate a list of all diary-entries from absolute date D1 to D2." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
348 (let (diary-display-hook) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
349 (diary-list-entries |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
350 (calendar-gregorian-from-absolute d1) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
351 (1+ (- d2 d1))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
352 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
353 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
354 (defun cal-html-insert-agenda-days (month year diary-list) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
355 "Insert HTML commands for a range of days in monthly calendars. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
356 HTML commands are inserted for the days of the numeric MONTH in |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
357 four-digit YEAR. Diary entries in DIARY-LIST are included." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
358 (let ((blank-days ; at start of month |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
359 (mod (- (calendar-day-of-week (list month 1 year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
360 calendar-week-start-day) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
361 7)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
362 (last (calendar-last-day-of-month month year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
363 date) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
364 (insert "<a name=0>\n") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
365 (insert (cal-html-b-table "class=agenda border=1")) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
366 (dotimes (i last) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
367 (setq date (list month (1+ i) year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
368 (insert |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
369 (format "<a name=%d></a>\n" (1+ i)) ; link |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
370 cal-html-b-tablerow-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
371 ;; Number & day name. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
372 cal-html-b-tableheader-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
373 (if cal-html-print-day-number-flag |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
374 (format "<em>%d</em> " |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
375 (calendar-day-number date)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
376 "") |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
377 (format "%d %s" (1+ i) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
378 (aref calendar-day-name-array |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
379 (calendar-day-of-week date))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
380 cal-html-e-tableheader-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
381 ;; Diary entries. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
382 cal-html-b-tabledata-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
383 (cal-html-htmlify-list diary-list date) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
384 cal-html-e-tabledata-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
385 cal-html-e-tablerow-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
386 ;; If end of week and not end of month, make new table. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
387 (if (and (zerop (mod (+ i 1 blank-days) 7)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
388 (/= (1+ i) last)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
389 (insert cal-html-e-table-string |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
390 (cal-html-b-table |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
391 "class=agenda border=1"))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
392 (insert cal-html-e-table-string)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
393 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
394 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
395 (defun cal-html-one-month (month year dir) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
396 "Write an HTML calendar file for numeric MONTH of YEAR in directory DIR." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
397 (let ((diary-list (cal-html-list-diary-entries |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
398 (calendar-absolute-from-gregorian (list month 1 year)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
399 (calendar-absolute-from-gregorian |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
400 (list month |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
401 (calendar-last-day-of-month month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
402 year))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
403 (with-temp-buffer |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
404 (insert cal-html-b-document-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
405 (cal-html-insert-month-header month year) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
406 (cal-html-insert-agenda-days month year diary-list) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
407 (insert cal-html-e-document-string) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
408 (write-file (expand-file-name |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
409 (cal-html-monthpage-name month year) dir))))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
410 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
411 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
412 ;;; User commands. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
413 |
92831
65bc0cdc7f5f
(diary-list-entries): Fix autoload.
Glenn Morris <rgm@gnu.org>
parents:
92584
diff
changeset
|
414 ;;;###cal-autoload |
73517
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
415 (defun cal-html-cursor-month (month year dir) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
416 "Write an HTML calendar file for numeric MONTH of four-digit YEAR. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
417 The output directory DIR is created if necessary. Interactively, |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
418 MONTH and YEAR are taken from the calendar cursor position. Note |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
419 that any existing output files are overwritten." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
420 (interactive (let* ((date (calendar-cursor-to-date t)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
421 (month (extract-calendar-month date)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
422 (year (extract-calendar-year date))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
423 (list month year (cal-html-year-dir-ask-user year)))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
424 (make-directory dir t) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
425 (cal-html-one-month month year dir)) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
426 |
92831
65bc0cdc7f5f
(diary-list-entries): Fix autoload.
Glenn Morris <rgm@gnu.org>
parents:
92584
diff
changeset
|
427 ;;;###cal-autoload |
73517
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
428 (defun cal-html-cursor-year (year dir) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
429 "Write HTML calendar files (index and monthly pages) for four-digit YEAR. |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
430 The output directory DIR is created if necessary. Interactively, |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
431 YEAR is taken from the calendar cursor position. Note that any |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
432 existing output files are overwritten." |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
433 (interactive (let ((year (extract-calendar-year |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
434 (calendar-cursor-to-date t)))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
435 (list year (cal-html-year-dir-ask-user year)))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
436 (make-directory dir t) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
437 (with-temp-buffer |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
438 (cal-html-insert-year-minicals year cal-html-year-index-cols) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
439 (write-file (expand-file-name "index.html" dir))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
440 (dotimes (i 12) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
441 (cal-html-one-month (1+ i) year dir))) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
442 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
443 |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
444 (provide 'cal-html) |
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
445 |
73527 | 446 ;; arch-tag: 4e73377d-d2c1-46ea-a103-02c111da5f57 |
73517
2881aec6b925
New file, from: Anna M. Bigatti <bigatti at dima.unige.it>.
Glenn Morris <rgm@gnu.org>
parents:
diff
changeset
|
447 ;;; cal-html.el ends here |