emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Org-mode version 4.74


From: Carsten Dominik
Subject: Re: [Orgmode] Org-mode version 4.74
Date: Tue, 15 May 2007 13:41:18 +0200

Hi David,

thanks, I will take your patch, with the following changes:


- The name of the variable will be
  `org-agenda-export-html-style'.

- `org-level-3' will no longer be used as a face in the agenda,
  instead I use a new face `org-agenda-structure'.

- The default style will be empty, meaning that the stuff
  provided by htmlize not be changed.  Only if the variable
  `org-agenda-export-html-style contains a string that
  contains <style>...</style>, then it will replace the
  default style as given by htmlize.

- Carsten

On May 13, 2007, at 19:02, David Emery wrote:

On Date: Sun, 13 May 2007 09:35:15 +0200, Carsten Dominik <address@hidden> wrote:
I have released version 4.74 of Org-mode at

http://www.astro.uva.nl/~dominik/Tools/org/
* Overview

   This release is about exporting agenda views, to HTML, to
   postscript for printing, and to a special format (CSV) for
   further processing in scripts.

Great stuff! But of course as soon as I tried the agenda export to HTML, I wanted to be able to customize the CSS. So here's a patch that adds a setting: org-export-agenda-html-style. It's my first attempt at lisp, so I imagine it
could be improved, but it works OK for me so far.

I had originally thought to make the agenda export use org-export-html-style, (easy enough to do) and add the agenda-specific styles to that. But the fact
that the agenda content gets wrapped in <pre> tags complicates things a
bit. That still might be a better approach, but I think for most people, the style for <PRE> in regular html export would conflict with that for agenda
export.


Dave




* Incompatible Changes

   - The variable `org-agenda-remove-tags-when-in-prefix' has
     been renamed to `org-agenda-remove-tags'.

* Details

   - Agenda views can be exported as plain text, as HTML, and as
     Postscript(R).  This can simply be done from the agenda
     buffer with `C-x C-w' and then specifying a filename like
     `myagenda.html' or `myagenda.ps'.  See section 8.6.4 of the
     manual.

   - Each custom agenda view can specify a list of associated
     files names.  The command `C-c a e' then creates all views
     that have associated file names and exports the views to
     these files.  This is great for producing paper versions of
     your views, to take with you when you don't have your
     computer.  The manual has an example on how to do this, and
     in particular on how to customize the format of the printed
     version.  See section 8.6.4 of the manual.

   - You can produce a CSV format of agenda information with an
     Emacs batch command.  This is greate for further processing
     in scipts.  Thanks to Jason F. McBrayer for this idea.
     See section 8.6.5 of the manual.

   - New variable `org-agenda-skip-deadline-if-done'.  When set,
     a deadline associated with a DONE item will not be shown in
     the agenda.  This is based upon a report by Denis Bueno.

   - Quite a few bug fixes.



_______________________________________________
Emacs-orgmode mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
--- org-4.74/org.el     2007-05-13 16:25:40.000000000 +0900
+++ org.el              2007-05-14 01:12:13.000000000 +0900
@@ -2708,6 +2708,90 @@
   :group 'org-export-html
   :type 'string)

+(defcustom org-export-agenda-html-style
+"<style type=\"text/css\">
+  html {
+       font-family: Times, serif;
+       font-size: 12pt;
+  }
+  .org-level-1 {
+    font-size: 150%;
+    color: #003399;
+    font-weight: 600;
+  }
+  .org-level-2 {
+    font-size: 130%;
+    color: #003399;
+   font-weight: 600;
+  }
+  .org-level-3 {
+    font-size: 110%;
+    color: #003399;
+   font-weight: 600;
+  }
+  .org-todo {
+    color: #cc6666;Week-agenda:
+    font-weight: bold;
+  }
+  .org-done {
+    color: #339933;
+  }
+  .org-scheduled-today {
+    color: #cc6666;
+  }
+  .org-warning {
+    color: #cc6666;
+    font-weight: 600;
+  }
+
+  a {
+    color: inherit;
+    background-color: inherit;
+    font: inherit;
+    text-decoration: inherit;
+  }
+  a:hover {
+    text-decoration: underline;
+  }
+</style>"
+  "The default style specification for exported HTML Agenda files.
+Since there are different ways of setting style information, this variable +needs to contain the full HTML structure to provide a style, including the +surrounding HTML tags. The style specifications should include definitions +for new classes todo, done, title, and deadline. For example, legal values
+would be:
+
+   <style type=\"text/css\">
+       p { font-weight: normal; color: gray; }
+       .org-level-1 { color: black; }
+       .org-level-3 {
+          font-size: 110%;
+          color: #003399;
+          font-weight: 600;
+       }
+       .org-todo {
+          color: #cc6666;Week-agenda:
+          font-weight: bold;
+        }
+        .org-done {
+          color: #339933;
+        }
+        .title { text-align: center; }
+        .todo, .deadline { color: red; }
+        .done { color: green; }
+    </style>
+
+or, if you want to keep the style in a file,
+
+   <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
+
+As the value of this option simply gets inserted into the HTML <head> header,
+you can \"misuse\" it to add arbitrary text to the header."
+  :group 'org-export-html
+  :type 'string)
+
+
+
(defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n"
   "Format for typesetting the document title in HTML export."
   :group 'org-export-html
@@ -14292,6 +14376,15 @@
          ((string-match "\\.html?\\'" file)
           (require 'htmlize)
           (set-buffer (htmlize-buffer (current-buffer)))
+
+ ;; replace the <style>...</style> section with org-export-agenda-html-style
+          (goto-char (point-min))
+          (kill-region (- (search-forward "<style") 6)
+                       (search-forward "</style>")
+          )
+          (insert org-export-agenda-html-style)
+
+
           (write-file file)
           (kill-buffer (current-buffer))
           (message "HTML written to %s" file))
@@ -17269,6 +17362,8 @@
     (:tables               . org-export-with-tables)
     (:table-auto-headline  . org-export-highlight-first-table-line)
     (:style                . org-export-html-style)
+    ;;; added for agenda html export
+    (:agenda-style         . org-export-agenda-html-style)
     (:convert-org-links    . org-export-html-link-org-files-as-html)
     (:inline-images        . org-export-html-inline-images)
     (:expand-quoted-html   . org-export-html-expand)


--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477





reply via email to

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