emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* agenda formatting
@ 2009-02-09 15:36 John Rakestraw
  2009-02-10  1:52 ` John Rakestraw
  0 siblings, 1 reply; 3+ messages in thread
From: John Rakestraw @ 2009-02-09 15:36 UTC (permalink / raw)
  To: emacs-orgmode

Hi --

I'd like to export my agenda to an html page, and I'd like to do
regularly with a cron job. I've set up the custom agenda view, and
use the batch processing described here:

http://orgmode.org/manual/Using-the-agenda-elsewhere.html#Using-the-agenda-elsewhere

When I export the custom agenda using C-c a e interactively from within
emacs, the agenda.html file has all the formatting of the usual agenda
within org -- colored and bold fonts as I expect them to be. However,
when I create the agenda using this command from the command line:

emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'

all of the text in agenda.html is the same color. In addition, much of
the text in the html version is italicized.

Looking at the html source of the two different versions, I see that
the CSS style settings are different, so the export process of the
batch file is picking up a different css style sheet than the one
picked up by the export process called within emacs. (I found the file
org.css in my org git directory, but that seems to have still different
settings for faces.)

I've not changed any of the default face settings.

Should the formatting in the html file produced by the batch process be
the same as the formatting produced using C-c a e within emacs. Or, in
other words, is there a problem with my set-up? 

Apologies if there's an obvious answer to this -- my searches haven't
turned up anything.

Thanks --

-- 
John Rakestraw

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: agenda formatting
  2009-02-09 15:36 agenda formatting John Rakestraw
@ 2009-02-10  1:52 ` John Rakestraw
  2009-02-10 10:50   ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: John Rakestraw @ 2009-02-10  1:52 UTC (permalink / raw)
  To: emacs-orgmode

Replying to myself, just in case others have this question.......

> Hi --
> 
> I'd like to export my agenda to an html page, and I'd like to do
> regularly with a cron job. I've set up the custom agenda view, and
> use the batch processing described here:
> 
> http://orgmode.org/manual/Using-the-agenda-elsewhere.html#Using-the-agenda-elsewhere
> 
> When I export the custom agenda using C-c a e interactively from
> within emacs, the agenda.html file has all the formatting of the
> usual agenda within org -- colored and bold fonts as I expect them to
> be. However, when I create the agenda using this command from the
> command line:
> 
> emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
> 
> all of the text in agenda.html is the same color. In addition, much of
> the text in the html version is italicized.
> 
> Looking at the html source of the two different versions, I see that
> the CSS style settings are different, so the export process of the
> batch file is picking up a different css style sheet than the one
> picked up by the export process called within emacs. (I found the file
> org.css in my org git directory, but that seems to have still
> different settings for faces.)
> 
> I've not changed any of the default face settings.
> 
> Should the formatting in the html file produced by the batch process
> be the same as the formatting produced using C-c a e within emacs.
> Or, in other words, is there a problem with my set-up? 
> 
> Apologies if there's an obvious answer to this -- my searches haven't
> turned up anything.
> 
> Thanks --
> 

With a little more digging, I've solved my problem. Not sure that this
is the best solution, because I still don't understand why running
org-batch-agenda from the command line wasn't picking up the same style
sheet as the export agenda command run interactively from within emacs.

However, inserting this in my org config file has agenda.htm looking
the same as it looks in the org buffer no matter agenda.htm is
generated:

***code starts here
(setq org-agenda-export-html-style 

"<style>
      body {
        color: #daa520;
        background-color: #000000;
      }
      .org-agenda-date {
        /* org-agenda-date */
        color: #87cefa;
      }
      .org-agenda-structure {
        /* org-agenda-structure */
        color: #87cefa;
      }
      .org-scheduled {
        /* org-scheduled */
        color: #98fb98;
      }
      .org-scheduled-previously {
        /* org-scheduled-previously */
        color: #ff7f24;
      }
      .org-scheduled-today {
        /* org-scheduled-today */
        color: #98fb98;
      }
      .org-tag {
        /* org-tag */
        font-weight: bold;
      }
      .org-todo {
        /* org-todo */
        color: #ffc0cb;
        font-weight: bold;
      }

      a {
        color: inherit;
        background-color: inherit;
        font: inherit;
        text-decoration: inherit;
      }
      a:hover {
        text-decoration: underline;
      }
</style>">
)
***code ends here

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: agenda formatting
  2009-02-10  1:52 ` John Rakestraw
@ 2009-02-10 10:50   ` Carsten Dominik
  0 siblings, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2009-02-10 10:50 UTC (permalink / raw)
  To: John Rakestraw; +Cc: emacs-orgmode

Hi John,

I believe the reason for this problem is that, 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.  So the solution you
are choosing is exactly the right one, defining the faces in
a CSS file.

You probably now end up with double face definitions, one
set inlined by htmlize, the other set in your class file.
You can get rid of the inlined ones by binding
htmlize-output-type to `css' for the duration of the export.

If you copy the face definitions from org.css, you will get the
default Emacs faces.  If you have configured faces and want to
use those, start an emacs session, display you agenda to make
sure all faces have been defined, and then run the command

M-x org-export-htmlize-generate-css RET

This will create css for all faces currently defined in Emacs.
The copy these definitions, or the ones you'd like to have,
into your own css file.

HTH

- Carsten




On Feb 10, 2009, at 2:52 AM, John Rakestraw wrote:

> Replying to myself, just in case others have this question.......
>
>> Hi --
>>
>> I'd like to export my agenda to an html page, and I'd like to do
>> regularly with a cron job. I've set up the custom agenda view, and
>> use the batch processing described here:
>>
>> http://orgmode.org/manual/Using-the-agenda-elsewhere.html#Using-the-agenda-elsewhere
>>
>> When I export the custom agenda using C-c a e interactively from
>> within emacs, the agenda.html file has all the formatting of the
>> usual agenda within org -- colored and bold fonts as I expect them to
>> be. However, when I create the agenda using this command from the
>> command line:
>>
>> emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
>>
>> all of the text in agenda.html is the same color. In addition, much  
>> of
>> the text in the html version is italicized.
>>
>> Looking at the html source of the two different versions, I see that
>> the CSS style settings are different, so the export process of the
>> batch file is picking up a different css style sheet than the one
>> picked up by the export process called within emacs. (I found the  
>> file
>> org.css in my org git directory, but that seems to have still
>> different settings for faces.)
>>
>> I've not changed any of the default face settings.
>>
>> Should the formatting in the html file produced by the batch process
>> be the same as the formatting produced using C-c a e within emacs.
>> Or, in other words, is there a problem with my set-up?
>>
>> Apologies if there's an obvious answer to this -- my searches haven't
>> turned up anything.
>>
>> Thanks --
>>
>
> With a little more digging, I've solved my problem. Not sure that this
> is the best solution, because I still don't understand why running
> org-batch-agenda from the command line wasn't picking up the same  
> style
> sheet as the export agenda command run interactively from within  
> emacs.
>
> However, inserting this in my org config file has agenda.htm looking
> the same as it looks in the org buffer no matter agenda.htm is
> generated:
>
> ***code starts here
> (setq org-agenda-export-html-style
>
> "<style>
>      body {
>        color: #daa520;
>        background-color: #000000;
>      }
>      .org-agenda-date {
>        /* org-agenda-date */
>        color: #87cefa;
>      }
>      .org-agenda-structure {
>        /* org-agenda-structure */
>        color: #87cefa;
>      }
>      .org-scheduled {
>        /* org-scheduled */
>        color: #98fb98;
>      }
>      .org-scheduled-previously {
>        /* org-scheduled-previously */
>        color: #ff7f24;
>      }
>      .org-scheduled-today {
>        /* org-scheduled-today */
>        color: #98fb98;
>      }
>      .org-tag {
>        /* org-tag */
>        font-weight: bold;
>      }
>      .org-todo {
>        /* org-todo */
>        color: #ffc0cb;
>        font-weight: bold;
>      }
>
>      a {
>        color: inherit;
>        background-color: inherit;
>        font: inherit;
>        text-decoration: inherit;
>      }
>      a:hover {
>        text-decoration: underline;
>      }
> </style>">
> )
> ***code ends here
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-10 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-09 15:36 agenda formatting John Rakestraw
2009-02-10  1:52 ` John Rakestraw
2009-02-10 10:50   ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).