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

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

Re: [emacs-wiki-discuss] Creating a "Planner Weekly Overview" page


From: David O'Toole
Subject: Re: [emacs-wiki-discuss] Creating a "Planner Weekly Overview" page
Date: Mon, 26 Apr 2004 13:34:09 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I encountered a related problem trying to include diary entries in
published wiki pages (for example, the diary entries associated with a
particular event.) I never could get the HTML looking right using the
standard fancy-diary-display whenever multiple days were involved.  

I wanted to just put the following in my wiki pages:

* Convention schedule
<lisp>(dto/planner-diary-format "~/Diary/2004.IndustryConvention" 9 
"2004.05.08")</lisp>

and have it "Just Work" in HTML too.

So I wrote the following, which may help you:
----------------------------------------------------------------------

;; this can be made much more configurable.
;; one could specify an entire style

(defun dto/planner-diary-format (my-diary &optional no-of-days starting-date)
  "* Summarize diary entries in a plan page. Acts like the fancy diary
display, but rendering to emacs-wiki markup. Suitable for publishing
from within emacs-wiki <lisp> sections."
  (let* ((date (planner-filename-to-calendar-date (planner-expand-name
                                                   (or starting-date 
(planner-today)))))
         (days (or no-of-days 1))
         (diary-file my-diary)
         (diary-list-include-blanks t)
         (diary-display-hook '(ignore))
         (entries (list-diary-entries date days))
         (previous-date nil)
         (output ""))
    (dolist (entry entries)
      (let* ((current-date (nth 0 entry))
             (entry-text (nth 1 entry)))
        (when (not (equal previous-date current-date))  ;; know when to mark 
headings
          (setq output (concat output (format "\n\n** %s \n" 
(calendar-date-string current-date))))) 
        (setq output (concat output "\n- " entry-text))
        (setq previous-date current-date)))
    output))









"Travis B. Hartwell" <address@hidden> writes:

> Hey all,
>
> I'm trying to get create what is in effect a "Week at a glance" page
> for Planner.  This would be different from a Project or Day page.
> What I have in mind right now is to have these various things on it
> (some of which hasn't yet been implemented, of course):
>
> Planner Overview Page:
> 1. A link to today's planner page
> 2. Normal fancy diary display for the next 7 days
> 3. List of tasks due the next 7 days
> 4. Index of Project pages
> 5. Link to index of notes -> day pages
> 6. Link to list of all open planner buffers
>
> Since this isn't either a project or day page, I'm not sure if I will
> need to do something special.
>
> Anyway, I have started the page (basically a project page with the
> * Tasks and * Notes sections removed).  This is what I have so far,
> which is broken:
> ------------------
>
> * Planner Overview Page
>
> [[lisp://plan][Today's Planner Page]]
>
> * This week's appointments
>
> <lisp>
> (planner-diary-update-section (buffer-file-name)
>                            "* This week's appointments"
>                             (planner-diary-get-diary-entries
>                              (calendar-current-date)
>                              7
>                              planner-diary-file))
> </lisp>
>
> ------------
>
> This would produce something that looks something like this:
>
> * Planner Overview Page
>
> _Today's Planner Page_
>
> * This week's appointments
>
> Monday, April 26, 2004
> ======================
> 6:30pm-8:00pm April Birthday Party Lundstrum Park
>
> Tuesday, April 27, 2004
> =======================
> 12:00pm-1:00pm Meeting with Bill
> 18:00 Haircut
>
> Wednesday, April 28, 2004
> =========================
> 12:00pm-1:00pm Commencement Practice -- HPER field
>
> Sunday, May 2, 2004
> ===================
> 12:30-15:30 Church
>
> ------------
>
> Unfortunately, the first problem is that the <lisp></lisp> segment
> replaces itself.  If I put it above the "* This week's appointments",
> it never displays and Emacs keeps trying to insert the diary.  So, the
> first question is how would I appropriately do that?  I'm guessing
> writing a whole new module (planner-overview.el) that does something
> similar to planner-diary.el and just has this above template.
>
> Other immediate questions I have relate to Overview Page items 3 and 4
> above.  I have dug deep enough, but is there a way I can get the tasks
> due in the next 7 days and then display them something like this:
>
> Monday, April 26, 2004
> ======================
> #A1  _ Call Joe {{Tasks:72}} (TaskPool)
> #A2  _ E-mail April {{Tasks:86}} (GeneralProfessional)
> #A3  _ Burn Mandrake CD for Daniel {{Tasks:82}} (TaskPool)
> #A4  _ Make Deposit {{Tasks:81}} (TaskPool)
> #A5  _ Configure Tiger on desktop {{Tasks:78}} (ComputerGeneral)
> #A6  _ Find a reliable way to know when pertinent security updates happen 
> {{Tasks:76}} (CvsRoxorGamesComSysAdmin)
>
> Tuesday, April 27, 2004
> =======================
> #A1 _ Mail phone bill payment {{Tasks:87}} (TaskPool)
> #A2 _ Compile new kernel for desktop {{Tasks:95}} (ComputerGeneral)
>
> ...etc...
>
> (Actually, perhaps it would be cool to mingle this with the diary
> data.  I haven't decided yet the best way to display that.  Anyway,
> how would I get at this info?
>
> And then, about getting a listing of all project pages.  Is there a
> function for that?  Again, I'm lazy and haven't looked through the
> code yet.
>
> The last item (#6) would just be a link like this:
>
> [[lisp://tbh-show-planner-buffers][Show Open Planner Buffers]]
>
> I have the function defined as such:
>
> (defun tbh-show-planner-buffers ()
>   (interactive)
>   (when (not (get-buffer "*planner buffers*"))
>       (progn
>       (ibuffer)
>       (ibuffer-limit-by-mode 'planner-mode)
>       (rename-buffer "*planner buffers*")))
>   (switch-to-buffer "*planner buffers*"))
>
> I have that bound to C-cpb ("planner buffers") and I find it useful.
>
>
> Any suggestions, ideas, or help?  I think I might actually be
> motivated enough to work on this this week. :)
>
> Travis
>
>
> _______________________________________________
> emacs-wiki-discuss mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/emacs-wiki-discuss

-- 
David O'Toole
Office Manager, Irrational Games
617.269.0424 x335
address@hidden




reply via email to

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