emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Show TODO item in table of contents
@ 2013-11-04 14:31 Rainer Stengele
  2013-11-04 21:48 ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Rainer Stengele @ 2013-11-04 14:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I couldn't find a way to show the TODO items in the table of econtents of an exported html of an org file.
I do not mean org-export-mark-todo-in-toc.
Please help me find a variable!

Thank you, Rainer

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

* Re: Show TODO item in table of contents
  2013-11-04 14:31 Show TODO item in table of contents Rainer Stengele
@ 2013-11-04 21:48 ` Bastien
  2013-11-05  8:06   ` Rainer Stengele
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2013-11-04 21:48 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Hi Rainer,

Rainer Stengele <rainer.stengele@online.de> writes:

> I couldn't find a way to show the TODO items in the table of econtents of an exported html of an org file.
> I do not mean org-export-mark-todo-in-toc.
> Please help me find a variable!

org-export-with-tasks ?

-- 
 Bastien

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

* Re: Show TODO item in table of contents
  2013-11-04 21:48 ` Bastien
@ 2013-11-05  8:06   ` Rainer Stengele
  2013-11-05 16:33     ` Bastien
  0 siblings, 1 reply; 15+ messages in thread
From: Rainer Stengele @ 2013-11-05  8:06 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Am 04.11.2013 22:48, schrieb Bastien:
> Hi Rainer,
>
> Rainer Stengele <rainer.stengele@online.de> writes:
>
>> I couldn't find a way to show the TODO items in the table of econtents of an exported html of an org file.
>> I do not mean org-export-mark-todo-in-toc.
>> Please help me find a variable!
> org-export-with-tasks ?
>
Hi Bastien,

I have that one set to t.
What I want is to see the todo state words in the table of contents.
I see them in the contents but not in the table of contents.

Thanks,
Rainer

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

* Re: Show TODO item in table of contents
  2013-11-05  8:06   ` Rainer Stengele
@ 2013-11-05 16:33     ` Bastien
  2013-11-06  8:43       ` Rainer Stengele
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2013-11-05 16:33 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Hi Rainser,

Rainer Stengele <rainer.stengele@online.de> writes:

> I have that one set to t.
> What I want is to see the todo state words in the table of contents.
> I see them in the contents but not in the table of contents.

Mhh... then I think you can't, sorry.

-- 
 Bastien

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

* Re: Show TODO item in table of contents
  2013-11-05 16:33     ` Bastien
@ 2013-11-06  8:43       ` Rainer Stengele
  2013-11-06 11:22         ` Bastien
  2013-11-06 14:29         ` Nicolas Goaziou
  0 siblings, 2 replies; 15+ messages in thread
From: Rainer Stengele @ 2013-11-06  8:43 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Am 05.11.2013 17:33, schrieb Bastien:
> Hi Rainser,
> 
> Rainer Stengele <rainer.stengele@online.de> writes:
> 
>> I have that one set to t.
>> What I want is to see the todo state words in the table of contents.
>> I see them in the contents but not in the table of contents.
> 
> Mhh... then I think you can't, sorry.
> 
Hi all,

I would propose that as an enhancement:


In html export include todo state words in table of contents.


Anybody else would find this useful?

Thank you,
Rainer

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

* Re: Show TODO item in table of contents
  2013-11-06  8:43       ` Rainer Stengele
@ 2013-11-06 11:22         ` Bastien
  2013-11-06 14:29         ` Nicolas Goaziou
  1 sibling, 0 replies; 15+ messages in thread
From: Bastien @ 2013-11-06 11:22 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Rainer Stengele <rainer.stengele@online.de> writes:

> Anybody else would find this useful?

FWIW I would!

-- 
 Bastien

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

* Re: Show TODO item in table of contents
  2013-11-06  8:43       ` Rainer Stengele
  2013-11-06 11:22         ` Bastien
@ 2013-11-06 14:29         ` Nicolas Goaziou
  2013-11-06 14:56           ` Bastien
  1 sibling, 1 reply; 15+ messages in thread
From: Nicolas Goaziou @ 2013-11-06 14:29 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: Bastien, emacs-orgmode

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

Hello,

Rainer Stengele <rainer.stengele@online.de> writes:

> In html export include todo state words in table of contents.

Would the following patch do the job?


Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html-Add-TODO-keyword-to-TOC-entries.patch --]
[-- Type: text/x-diff, Size: 3428 bytes --]

From 7b85dbbc22e73766ac92295d2b37ae692b20d289 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Wed, 6 Nov 2013 15:26:53 +0100
Subject: [PATCH] ox-html: Add TODO keyword to TOC entries

* lisp/ox-html.el (org-html--format-toc-headline): TOC entries are
  closer to regular headline formatting.
---
 lisp/ox-html.el | 54 +++++++++++++++++++++++++++++++-----------------------
 1 file changed, 31 insertions(+), 23 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index afc2437..84a3f45 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1969,34 +1969,42 @@ and value is its relative level, as an integer."
 (defun org-html--format-toc-headline (headline info)
   "Return an appropriate table of contents entry for HEADLINE.
 INFO is a plist used as a communication channel."
-  (let* ((headline-number (org-export-get-headline-number headline info))
-	 (section-number
-	  (and (not (org-export-low-level-p headline info))
-	       (org-export-numbered-headline-p headline info)
-	       (concat (mapconcat 'number-to-string headline-number ".") ". ")))
+  (let* ((level (+ (org-export-get-relative-level headline info)
+		   (1- org-html-toplevel-hlevel)))
+	 (todo (and (plist-get info :with-todo-keywords)
+		    (let ((todo (org-element-property :todo-keyword headline)))
+		      (and todo (org-export-data todo info)))))
+	 (todo-type (and todo (org-element-property :todo-type headline)))
+	 (priority (and (plist-get info :with-priority)
+			(org-element-property :priority headline)))
+	 (text (org-export-data-with-backend
+		(org-export-get-alt-title headline info)
+		;; Create an anonymous back-end that will ignore any
+		;; footnote-reference, link, radio-target and target
+		;; in table of contents.
+		(org-export-create-backend
+		 :parent 'html
+		 :transcoders '((footnote-reference . ignore)
+				(link . (lambda (object c i) c))
+				(radio-target . (lambda (object c i) c))
+				(target . ignore)))
+		info))
 	 (tags (and (eq (plist-get info :with-tags) t)
 		    (org-export-get-tags headline info))))
     (format "<a href=\"#%s\">%s</a>"
-	    ;; Label.
 	    (org-export-solidify-link-text
 	     (or (org-element-property :CUSTOM_ID headline)
-		 (concat "sec-" (mapconcat 'number-to-string
-					   headline-number "-"))))
-	    ;; Body.
-	    (concat section-number
-		    (org-export-data-with-backend
-		     (org-export-get-alt-title headline info)
-		     ;; Create an anonymous back-end that will ignore
-		     ;; any footnote-reference, link, radio-target and
-		     ;; target in table of contents.
-		     (org-export-create-backend
-		      :parent 'html
-		      :transcoders '((footnote-reference . ignore)
-				     (link . (lambda (object c i) c))
-				     (radio-target . (lambda (object c i) c))
-				     (target . ignore)))
-		     info)
-		    (and tags "&#xa0;&#xa0;&#xa0;") (org-html--tags tags)))))
+		 (concat "sec-"
+			 (mapconcat
+			  #'number-to-string
+			  (org-export-get-headline-number headline info)
+			  "-"))))
+	    (apply (if (functionp org-html-format-headline-function)
+		       (lambda (todo todo-type priority text tags &rest ignore)
+			 (funcall org-html-format-headline-function
+				  todo todo-type priority text tags))
+		     #'org-html-format-headline)
+		   todo todo-type priority text tags :section-number nil))))
 
 (defun org-html-list-of-listings (info)
   "Build a list of listings.
-- 
1.8.4.2


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

* Re: Show TODO item in table of contents
  2013-11-06 14:29         ` Nicolas Goaziou
@ 2013-11-06 14:56           ` Bastien
  2013-11-06 15:13             ` Nicolas Goaziou
  0 siblings, 1 reply; 15+ messages in thread
From: Bastien @ 2013-11-06 14:56 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Rainer Stengele, emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> In html export include todo state words in table of contents.
>
> Would the following patch do the job?

It does for me!  Thanks

-- 
 Bastien

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

* Re: Show TODO item in table of contents
  2013-11-06 14:56           ` Bastien
@ 2013-11-06 15:13             ` Nicolas Goaziou
  2013-11-06 16:00               ` Rainer Stengele
  2013-11-22  4:26               ` Bernt Hansen
  0 siblings, 2 replies; 15+ messages in thread
From: Nicolas Goaziou @ 2013-11-06 15:13 UTC (permalink / raw)
  To: Bastien; +Cc: Rainer Stengele, emacs-orgmode

Hello,

Bastien <bzg@gnu.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>>> In html export include todo state words in table of contents.
>>
>> Would the following patch do the job?
>
> It does for me!  Thanks

Applied then.


Regards,

-- 
Nicolas Goaziou

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

* Re: Show TODO item in table of contents
  2013-11-06 15:13             ` Nicolas Goaziou
@ 2013-11-06 16:00               ` Rainer Stengele
  2013-11-22  4:26               ` Bernt Hansen
  1 sibling, 0 replies; 15+ messages in thread
From: Rainer Stengele @ 2013-11-06 16:00 UTC (permalink / raw)
  Cc: emacs-orgmode

Am 06.11.2013 16:13, schrieb Nicolas Goaziou:
> Hello,
> 
> Bastien <bzg@gnu.org> writes:
> 
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>
>>>> In html export include todo state words in table of contents.
>>>
>>> Would the following patch do the job?
>>
>> It does for me!  Thanks
> 
> Applied then.
> 
> 
> Regards,
> 
Wonderful! Works!

I love you guys ..

Regards, Rainer

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

* Re: Show TODO item in table of contents
  2013-11-06 15:13             ` Nicolas Goaziou
  2013-11-06 16:00               ` Rainer Stengele
@ 2013-11-22  4:26               ` Bernt Hansen
  2013-11-22  8:50                 ` Nicolas Goaziou
  1 sibling, 1 reply; 15+ messages in thread
From: Bernt Hansen @ 2013-11-22  4:26 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien, Rainer Stengele, emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Bastien <bzg@gnu.org> writes:
>
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>
>>>> In html export include todo state words in table of contents.
>>>
>>> Would the following patch do the job?
>>
>> It does for me!  Thanks
>
> Applied then.
>
>
> Regards,

Hi Nicolas,

This patch 
4c94c4d (ox-html: Add TODO keyword to TOC entries, 2013-11-06)

changes the behaviour of HTML TOCs.  I noticed that when I export my
org-mode document (http://doc.norang.ca/org-mode.html) with this patch
the TOC no longer has numbering on the items - and it is just displayed
as a plain list.

Was this intended?  I prefer the old behaviour with numbered TOC entries
matching the numbered headlines (esp since my TOC in this document is
long)

Can this be fixed?

Thanks and regards,
Bernt

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

* Re: Show TODO item in table of contents
  2013-11-22  4:26               ` Bernt Hansen
@ 2013-11-22  8:50                 ` Nicolas Goaziou
  2013-11-22 22:48                   ` Bernt Hansen
  0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Goaziou @ 2013-11-22  8:50 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Bastien, Rainer Stengele, emacs-orgmode

Hello,

Bernt Hansen <bernt@norang.ca> writes:

> This patch 
> 4c94c4d (ox-html: Add TODO keyword to TOC entries, 2013-11-06)
>
> changes the behaviour of HTML TOCs.  I noticed that when I export my
> org-mode document (http://doc.norang.ca/org-mode.html) with this patch
> the TOC no longer has numbering on the items - and it is just displayed
> as a plain list.
>
> Was this intended?  

Not really. This is a good ole regression.

> Can this be fixed?

I pushed a fix. Is it better now?


Thanks,

-- 
Nicolas Goaziou

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

* Re: Show TODO item in table of contents
  2013-11-22  8:50                 ` Nicolas Goaziou
@ 2013-11-22 22:48                   ` Bernt Hansen
  2013-11-23 19:38                     ` Rainer Stengele
  0 siblings, 1 reply; 15+ messages in thread
From: Bernt Hansen @ 2013-11-22 22:48 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien, Rainer Stengele, emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Bernt Hansen <bernt@norang.ca> writes:
>
>> This patch 
>> 4c94c4d (ox-html: Add TODO keyword to TOC entries, 2013-11-06)
>>
>> changes the behaviour of HTML TOCs.  I noticed that when I export my
>> org-mode document (http://doc.norang.ca/org-mode.html) with this patch
>> the TOC no longer has numbering on the items - and it is just displayed
>> as a plain list.
>>
>> Was this intended?  
>
> Not really. This is a good ole regression.
>
>> Can this be fixed?
>
> I pushed a fix. Is it better now?

Much better!  Thanks for the quick fix! :)

Regards,
Bernt

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

* Re: Show TODO item in table of contents
  2013-11-22 22:48                   ` Bernt Hansen
@ 2013-11-23 19:38                     ` Rainer Stengele
  2013-11-24  9:11                       ` Nicolas Goaziou
  0 siblings, 1 reply; 15+ messages in thread
From: Rainer Stengele @ 2013-11-23 19:38 UTC (permalink / raw)
  Cc: Bastien, emacs-orgmode

Am 22.11.2013 23:48, schrieb Bernt Hansen:
> Nicolas Goaziou <n.goaziou@gmail.com> writes:
> 
>> Bernt Hansen <bernt@norang.ca> writes:
>>
>>> This patch 
>>> 4c94c4d (ox-html: Add TODO keyword to TOC entries, 2013-11-06)
>>>
>>> changes the behaviour of HTML TOCs.  I noticed that when I export my
>>> org-mode document (http://doc.norang.ca/org-mode.html) with this patch
>>> the TOC no longer has numbering on the items - and it is just displayed
>>> as a plain list.
>>>
>>> Was this intended?  
>>
>> Not really. This is a good ole regression.
>>
>>> Can this be fixed?
>>
>> I pushed a fix. Is it better now?
> 
> Much better!  Thanks for the quick fix! :)
> 
> Regards,
> Bernt
> 
> 
I just tried out. The TOC includes the todo items.
I just can't remember if before the todo items were also colored in the TOC.
Could it be that the patch removed that colorizing?
I find it much more appealing to see the todos in the TOC in the same color as in the headlines.

Thanks, Rainer

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

* Re: Show TODO item in table of contents
  2013-11-23 19:38                     ` Rainer Stengele
@ 2013-11-24  9:11                       ` Nicolas Goaziou
  0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Goaziou @ 2013-11-24  9:11 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: Bastien, emacs-orgmode

Hello,

Rainer Stengele <rainer.stengele@online.de> writes:

> I just tried out. The TOC includes the todo items.
> I just can't remember if before the todo items were also colored in the TOC.
> Could it be that the patch removed that colorizing?

I cannot reproduce it, i.e. TODO are still colored.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2013-11-24  9:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-04 14:31 Show TODO item in table of contents Rainer Stengele
2013-11-04 21:48 ` Bastien
2013-11-05  8:06   ` Rainer Stengele
2013-11-05 16:33     ` Bastien
2013-11-06  8:43       ` Rainer Stengele
2013-11-06 11:22         ` Bastien
2013-11-06 14:29         ` Nicolas Goaziou
2013-11-06 14:56           ` Bastien
2013-11-06 15:13             ` Nicolas Goaziou
2013-11-06 16:00               ` Rainer Stengele
2013-11-22  4:26               ` Bernt Hansen
2013-11-22  8:50                 ` Nicolas Goaziou
2013-11-22 22:48                   ` Bernt Hansen
2013-11-23 19:38                     ` Rainer Stengele
2013-11-24  9:11                       ` Nicolas Goaziou

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).