emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* HTML export: feature request
@ 2009-02-10 22:14 Wanrong Lin
  2009-02-10 23:26 ` Richard Riley
  2009-02-11  1:41 ` Sebastian Rose
  0 siblings, 2 replies; 4+ messages in thread
From: Wanrong Lin @ 2009-02-10 22:14 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

One problem I have with current HTML export is the section number (like 
"1", "2.1", "2.1.2" and etc) is not very distinctive from the actual 
section heading. Also, sometimes I wish the sub-section headings are 
indented. So I wonder whether we can add the following features:

1. Assign a CSS class to the section number, so the section number font 
and color can be customized through CSS
2. Add a variable to control whether sub-sections should be indented in 
the export, and by how much.

Thank you for giving some thoughts on the above.

Wanrong

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

* Re: HTML export: feature request
  2009-02-10 22:14 HTML export: feature request Wanrong Lin
@ 2009-02-10 23:26 ` Richard Riley
  2009-02-11  1:41 ` Sebastian Rose
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Riley @ 2009-02-10 23:26 UTC (permalink / raw)
  To: Wanrong Lin; +Cc: emacs-orgmode

Wanrong Lin <wanrong.lin@gmail.com> writes:

> Hi,
>
> One problem I have with current HTML export is the section number
> (like "1", "2.1", "2.1.2" and etc) is not very distinctive from the
> actual section heading. Also, sometimes I wish the sub-section
> headings are indented. So I wonder whether we can add the following
> features:
>
> 1. Assign a CSS class to the section number, so the section number
> font and color can be customized through CSS
> 2. Add a variable to control whether sub-sections should be indented
> in the export, and by how much.
>
> Thank you for giving some thoughts on the above.

Similar on this subject, is there a reason ID numbers and classes are
not aligned? 

e.g

<div class="outline-3" id="outline-container-1.1">

is output. (6.18 trans with emacs 23)


-- 
 important and urgent problems of the technology of today are no longer the satisfactions of the primary needs or of archetypal wishes, but the reparation of the evils and damages by the technology of yesterday.  ~Dennis Gabor, Innovations:  Scientific, Technological and Social, 1970

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

* Re: HTML export: feature request
  2009-02-10 22:14 HTML export: feature request Wanrong Lin
  2009-02-10 23:26 ` Richard Riley
@ 2009-02-11  1:41 ` Sebastian Rose
  2009-02-11 10:34   ` Carsten Dominik
  1 sibling, 1 reply; 4+ messages in thread
From: Sebastian Rose @ 2009-02-11  1:41 UTC (permalink / raw)
  To: Wanrong Lin; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]

Wanrong Lin <wanrong.lin@gmail.com> writes:

> Hi,
>
> One problem I have with current HTML export is the section number (like "1",
> "2.1", "2.1.2" and etc) is not very distinctive from the actual section
> heading. Also, sometimes I wish the sub-section headings are indented. So I
> wonder whether we can add the following features:
>
> 1. Assign a CSS class to the section number, so the section number font and
> color can be customized through CSS

That would be great indeed:

<h2 id="sec-1"><span class="section-number-2">1</span> Headline</h2>
                            \------------/ ^      
                               basename    |
                                         level

> 2. Add a variable to control whether sub-sections should be indented in the
> export, and by how much.

This is possible through CSS more easy and flexible (different projects,
different designs):

.outline-2 h2 {}

Ahh - Carsten, would it easy to add a new class here?


<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">1 blabla </h2>
<div class="outline-text-2" id="text-1">
                ^
Here -----------'
the 

We could the indent the text independently from the headline (or add
additional indentation to the sections body).


The appended patch does both of these. Add a class to the section
number, and a class to the container of the sections content.


Regards,

   Sebastian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1526 bytes --]

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 69ebdbc..4e5f2e5 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -4646,12 +4646,12 @@ 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 "<span class=\"section-number-" (format "%d" level) "\">" snumber "</span> " 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=\"online-text-
+                       snumber level level snumber extra-targets title level level snumber))
        (org-open-par)))))
 
 (defun org-get-text-property-any (pos prop &optional object)
</#part>


--
Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover
Tel.:  +49 (0)511 - 36 58 472
Fax:   +49 (0)1805 - 233633 - 11044
mobil: +49 (0)173 - 83 93 417
Http:  www.emma-stil.de

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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 related	[flat|nested] 4+ messages in thread

* Re: HTML export: feature request
  2009-02-11  1:41 ` Sebastian Rose
@ 2009-02-11 10:34   ` Carsten Dominik
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2009-02-11 10:34 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1667 bytes --]


On Feb 11, 2009, at 2:41 AM, Sebastian Rose wrote:

> Wanrong Lin <wanrong.lin@gmail.com> writes:
>
>> Hi,
>>
>> One problem I have with current HTML export is the section number  
>> (like "1",
>> "2.1", "2.1.2" and etc) is not very distinctive from the actual  
>> section
>> heading. Also, sometimes I wish the sub-section headings are  
>> indented. So I
>> wonder whether we can add the following features:
>>
>> 1. Assign a CSS class to the section number, so the section number  
>> font and
>> color can be customized through CSS
>
> That would be great indeed:
>
> <h2 id="sec-1"><span class="section-number-2">1</span> Headline</h2>
>                            \------------/ ^
>                               basename    |
>                                         level
>
>> 2. Add a variable to control whether sub-sections should be  
>> indented in the
>> export, and by how much.
>
> This is possible through CSS more easy and flexible (different  
> projects,
> different designs):
>
> .outline-2 h2 {}
>
> Ahh - Carsten, would it easy to add a new class here?
>
>
> <div id="outline-container-1" class="outline-2">
> <h2 id="sec-1">1 blabla </h2>
> <div class="outline-text-2" id="text-1">
>                ^
> Here -----------'
> the
>
> We could the indent the text independently from the headline (or add
> additional indentation to the sections body).
>
>
> The appended patch does both of these. Add a class to the section
> number, and a class to the container of the sections content.

No problem, I have applied you patch, with one change, making
the level number consistent even if `org-export-html-toplevel-hlevel'
is not 1.

- Carsten


[-- Attachment #1.2: Type: text/html, Size: 3060 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-10 22:14 HTML export: feature request Wanrong Lin
2009-02-10 23:26 ` Richard Riley
2009-02-11  1:41 ` Sebastian Rose
2009-02-11 10:34   ` 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).