From c9e266b0ecc560545285dabf4ea5e076af1e578a Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 11 Feb 2009 09:23:33 +0100 Subject: [PATCH] HTML Export: Add CSS classes for section numbers --- doc/ChangeLog | 4 ++++ doc/org.texi | 1 + lisp/ChangeLog | 8 ++++++++ lisp/org-exp.el | 20 +++++++++++++++----- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 321617239..8048a7a25 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2009-02-11 Carsten Dominik + + * org.texi (CSS support): Document CSS classes for section numbers. + 2009-02-05 Carsten Dominik * org.texi (Clocking work time): Decoment how to make the clock diff --git a/doc/org.texi b/doc/org.texi index dfb1004b3..6afc6eed9 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -8106,6 +8106,7 @@ the standard classes like for headlines, tables etc. div.figure @r{how to format an inlined image} .linenr @r{the line number in a code example} .code-highlighted @r{for highlighting referenced code lines} +.section-number-N @r{section number in headlines, different for each level} @end example Each exported files contains a compact default style that defines these diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 577e2df67..a98500ffd 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2009-02-11 Carsten Dominik + + * org-exp.el (org-html-level-start): Add a CSS class to section + numbers. + (org-export-html-toplevel-hlevel): Better documentation of the + influence of this variables on H levels and css classes in + export. + 2009-02-10 Carsten Dominik * org-agenda.el (org-agenda-custom-commands-local-options): Add diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 69ebdbcfb..c40c6b210 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -653,7 +653,13 @@ settings with tags." :type 'string) (defcustom org-export-html-toplevel-hlevel 2 - "The level for level 1 headings in HTML export." + "The level for level 1 headings in HTML export. +This is also important for the classes that will be wrapped around headlines +and outline structure. If this variable is 1, the top-level headlines will +be

, and the corresponding classes will be outline-1, section-number-1, +and outline-text-1. If this is 2, all of these will get a 2 instead. +The default for this variable is 2, because we use

for formatting the +document title." :group 'org-export-html :type 'string) @@ -4646,12 +4652,16 @@ When TITLE is nil, just close all open levels." (insert "
    \n
  • " title "
    \n")))) (aset org-levels-open (1- level) t) (setq snumber (org-section-number level)) - (if (and org-export-with-section-numbers (not body-only)) - (setq title (concat snumber " " title))) (setq level (+ level org-export-html-toplevel-hlevel -1)) + (if (and org-export-with-section-numbers (not body-only)) + (setq title (concat + (format " %s" + level snumber) + title))) (unless (= head-count 1) (insert "\n\n")) - (insert (format "\n
    \n%s%s\n
    \n" - snumber level level snumber extra-targets title level snumber)) + (insert (format "\n
    \n%s%s\n
    \n" + snumber level level snumber extra-targets + title level level snumber)) (org-open-par))))) (defun org-get-text-property-any (pos prop &optional object)