0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-24 13:32:52 +00:00

HTML Export: Add CSS classes for section numbers

This commit is contained in:
Carsten Dominik 2009-02-11 09:23:33 +01:00
parent bc5b0056e7
commit c9e266b0ec
4 changed files with 28 additions and 5 deletions

View file

@ -1,3 +1,7 @@
2009-02-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (CSS support): Document CSS classes for section numbers.
2009-02-05 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Clocking work time): Decoment how to make the clock

View file

@ -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

View file

@ -1,3 +1,11 @@
2009-02-11 Carsten Dominik <carsten.dominik@gmail.com>
* 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 <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-custom-commands-local-options): Add

View file

@ -653,7 +653,13 @@ settings with <style>...</style> tags."
:type 'string)
(defcustom org-export-html-toplevel-hlevel 2
"The <H> level for level 1 headings in HTML export."
"The <H> 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 <h1>, 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 <h1> 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 "<ul>\n<li>" title "<br/>\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 "<span class=\"section-number-%d\"> %s</span>"
level snumber)
title)))
(unless (= head-count 1) (insert "\n</div>\n"))
(insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d\">\n<h%d id=\"sec-%s\">%s%s</h%d>\n<div id=\"text-%s\">\n"
snumber level level snumber extra-targets title level snumber))
(insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d\">\n<h%d id=\"sec-%s\">%s%s</h%d>\n<div class=\"outline-text-%d\" id=\"text-%s\">\n"
snumber level level snumber extra-targets
title level level snumber))
(org-open-par)))))
(defun org-get-text-property-any (pos prop &optional object)