Batch Agenda Output via Html
Success! previously i mentioned difficulty in getting the agenda output using the command line in HTML form however now after a bit of baking in today’s glorious sunshine i figured it out. As normal i’d overlooked the obvious and discounted all the info i had reviewed.
My old command looks like
/usr/local/bin/emacs -Q --batch --load ~/.emacs --eval='(org-batch-agenda "c" org-agenda-files (quote ("/srv/dev-disk-by-id-usb-Seagate_Portable_NAA570VH-0-0-part1/drakx/orgfiles/")) org-agenda-span (quote week))' > /srv/dev-disk-by-id-usb-Seagate_Portable_NAA570VH-0-0-part1/drakx/orgfiles/agenda.txt
and this is entered into the scheduled job section of the OMV server setup;

It works very well but lacked the formatting of an HTML output, now the new command looks like;
/usr/local/bin/emacs -Q -batch -l ~/.emacs -eval '(org-batch-store-agenda-views)'
and this does have HTML output however it is not achievable without some modification of the org-super-agenda setup in the dotemacs file. As shown on many including the official site there are lines to show what output format we want, i just overlooked it.
The following is a section from my dotemacs which shows the org-super-agenda setup for one command;
elisp code snippet start
'(("c" "Super view"
((agenda "" ((org-agenda-overriding-header "")
(org-super-agenda-groups
'((:name ""
:time-grid t
:date today
:order 1)))))
(alltodo "" ((org-agenda-overriding-header "")
(org-super-agenda-groups
'((:log t)
(:name "family stuff"
:discard (:deadline future)
:tag "family"
:order 8)
(:name "house stuff"
:discard (:deadline future)
:tag "house"
:order 8)
(:name "tech stuff"
:discard (:deadline future)
:tag ("tech" "emacs")
:order 1)
)))))
nil
("~/agenda.html")
)
elisp code snippet end
The critical part of this for batch processing is;
elisp code snippet start
nil
("~/agenda.html")
elisp code snippet end
This tells the batch command how to save and where to save the agenda when it runs from the commandline. At the moment there is no fancy CSS applied but you get basic CSS and this is because quoting: “when you run Emacs in batch mode, it has no display and therefore no colored faces, so that HTMLIZE will pick up simpler versions of the faces and use those.” 1
So my next job is for the agenda output with nice HTML 2020-05-29-success
Now a small modification of Tasker’s scene to use a webview box instead of text and voila i now have a nicely formatted agenda on display on my phone.
-
quote taken from the man himself on the org mailing list: https://lists.gnu.org/archive/html/emacs-orgmode/2009-02/msg00321.html ↩︎