emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Publishing org files : index
@ 2008-06-26 20:56 Richard G Riley
  2008-06-27  2:59 ` Manish
  2008-06-27  3:02 ` Manuel Hermenegildo
  0 siblings, 2 replies; 7+ messages in thread
From: Richard G Riley @ 2008-06-26 20:56 UTC (permalink / raw)
  To: org-mode


Should the auto generated index.org and index.html (auto-index t) not
pick up the #title property for included pages as the link text?

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

* Re: Publishing org files : index
  2008-06-26 20:56 Publishing org files : index Richard G Riley
@ 2008-06-27  2:59 ` Manish
  2008-06-27 13:51   ` Sebastian Rose
  2008-06-27  3:02 ` Manuel Hermenegildo
  1 sibling, 1 reply; 7+ messages in thread
From: Manish @ 2008-06-27  2:59 UTC (permalink / raw)
  To: Richard G Riley; +Cc: org-mode

  On Fri, Jun 27, 2008 at 2:26 AM, Richard G Riley wrote:
  >
  > Should the auto generated index.org and index.html (auto-index t) not
  > pick up the #title property for included pages as the link text?
  >

+1

-- Manish

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

* Re: Publishing org files : index
  2008-06-26 20:56 Publishing org files : index Richard G Riley
  2008-06-27  2:59 ` Manish
@ 2008-06-27  3:02 ` Manuel Hermenegildo
  2008-07-08 22:09   ` Carsten Dominik
  1 sibling, 1 reply; 7+ messages in thread
From: Manuel Hermenegildo @ 2008-06-27  3:02 UTC (permalink / raw)
  To: Richard G Riley; +Cc: org-mode


 > Should the auto generated index.org and index.html (auto-index t) not
 > pick up the #title property for included pages as the link text?

I had fixed this but I think something happened when the patch I sent
Carsten got integrated (other parts of the patch work fine). I will
look into it. --Manuel

-- 
-------------------------------------------------------------------------------
 Manuel Hermenegildo                     |              Prof., C.S. Department
 Director, IMDEA-Software and CLIP Group |                T.U. of Madrid (UPM)
 http://www.cliplab.org/herme            | +34-91-336-7435 (W) -352-4819 (Fax)
-------------------------------------------------------------------------------

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

* Re: Publishing org files : index
  2008-06-27  2:59 ` Manish
@ 2008-06-27 13:51   ` Sebastian Rose
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastian Rose @ 2008-06-27 13:51 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

I'd like to volunteer for this little snippet. But the only function I
found was 'grep' which puts all output into a buffer named *grep*.

(grep-compute-defaults)
(rgrep "\#+TITLE\:" "*org" "/home/sebastian/notes/")

gives us the result we need for this. Could someone tell me a way to
inhibit the display of the '*grep*' buffer?


Right now the index file is generated just from a list of filenames
since it is generated before all the file are read. This is to avoid
reading all the files regardless of org publishing timestamp.





Another question to this concern:

How about the directories? Now they are displayed as links. On most
servers indexes are forbidden. Should we just show the names?

dir1
  file1.1   (link)
  file1.2   (link)

instead of

dir1        (link)
  file1.1   (link)
  file1.2   (link)


??


Manish <mailtomanish.sharma@gmail.com> writes:
>   On Fri, Jun 27, 2008 at 2:26 AM, Richard G Riley wrote:
>   >
>   > Should the auto generated index.org and index.html (auto-index t) not
>   > pick up the #title property for included pages as the link text?
>   >
>
> +1
>
> -- Manish
>
>
> _______________________________________________
> 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
>

-- 
Sebastian Rose, Hanover, Germany
Phone: +49 173 83 93 417
Mail.: sebatian_rose@gmx.de, s.rose@emma-stil.de

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

* Re: Publishing org files : index
  2008-06-27  3:02 ` Manuel Hermenegildo
@ 2008-07-08 22:09   ` Carsten Dominik
  2008-07-09  4:54     ` Manuel Hermenegildo
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2008-07-08 22:09 UTC (permalink / raw)
  To: Manuel Hermenegildo; +Cc: org-mode, Richard G Riley

Any news on this, Manuel?

- Carsten

On Jun 26, 2008, at 8:02 PM, Manuel Hermenegildo wrote:

>
>> Should the auto generated index.org and index.html (auto-index t) not
>> pick up the #title property for included pages as the link text?
>
> I had fixed this but I think something happened when the patch I sent
> Carsten got integrated (other parts of the patch work fine). I will
> look into it. --Manuel
>
> --  
> -------------------------------------------------------------------------------
> Manuel Hermenegildo                     |              Prof., C.S.  
> Department
> Director, IMDEA-Software and CLIP Group |                T.U. of  
> Madrid (UPM)
> http://www.cliplab.org/herme            | +34-91-336-7435 (W)  
> -352-4819 (Fax)
> -------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> 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] 7+ messages in thread

* Re: Publishing org files : index
  2008-07-08 22:09   ` Carsten Dominik
@ 2008-07-09  4:54     ` Manuel Hermenegildo
  2008-07-09 16:56       ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Manuel Hermenegildo @ 2008-07-09  4:54 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: org-mode, Richard G Riley


Hi Carsten,

 > Any news on this, Manuel?

A call went missing when the patch I sent you was applied (my fault
for not using -u ;-)) but it is actually fixed in the current git
version. 

Btw, the current index includes directory information, so that if I
have in my project two files:

org/test/too/foo.org (Title: This is file foo)
org/test/simple.org  (Title: This is a simple Org-generated web page)

the index looks like:

    * org/
          o test/
                + too/
                      # This is file foo
    * org/
          o test/
                + This is a simple Org-generated web page

which can be useful if the directory names are explicit
enough. However, I think in some cases one actually wants the index to
look simply like:

    * This is file foo
    * This is a simple Org-generated web page

I send a patch that implements a new index option:

  :index-style           Can be 'list (index is just an itemized list
                         of the titles of the files involved) or 
                         'tree (the directory structure of the source
                         files is reflected in the index). Defaults to
                         'tree."

(Btw, I would actually prefer to default to 'list, but I leave that to
you Carsten, or what people prefer, since it would change the current
behavior.)

Please include the patch if you find it useful.

Cheers,

Manuel


=================================================================

--- org-publish.el	2008-07-08 22:30:49.000000000 -0600
+++ org-publish.el.git	2008-07-08 19:00:04.000000000 -0600
@@ -263,12 +263,7 @@
   :index-function        Plugin function to use for generation of index.
                          Defaults to `org-publish-org-index', which
                          generates a plain list of links to all files
-                         in the project.
-  :index-style           Can be 'list (index is just an itemized list
-                         of the titles of the files involved) or 
-                         'tree (the directory structure of the source
-                         files is reflected in the index). Defaults to
-                         'tree."
+                         in the project."
   :group 'org-publish
   :type 'alist)
 
@@ -612,8 +607,6 @@
 	 (index-filename (concat dir (or index-filename "index.org")))
 	 (index-title (or (plist-get project-plist :index-title)
 			  (concat "Index for project " (car project))))
-	 (index-style (or (plist-get project-plist :index-style)
-			  'tree))
 	 (index-buffer (find-buffer-visiting index-filename))
 	 (ifn (file-name-nondirectory index-filename))
 	 file)
@@ -628,32 +621,25 @@
 	      (oldlocal localdir))
 	  ;; index shouldn't index itself
 	  (unless (string= fn ifn)
- 	    (if (eq index-style 'list)
-		(message "Generating list-style index for %s" index-title)
-	      (message "Generating tree-style index for %s" index-title)
-	      (setq localdir (concat (file-name-as-directory dir)
-				     (file-name-directory link)))
-	      (unless (string= localdir oldlocal)
-		(if (string= localdir dir)
-		    (setq indent-str (make-string 2 ?\ ))
-		  (let ((subdirs
-			 (split-string
-			  (directory-file-name
-			   (file-name-directory
-			    (file-relative-name localdir dir))) "/"))
-			(subdir ""))
-		    (setq indent-str (make-string 2 ?\ ))
-		    (dolist (d subdirs)
-		      (setq subdir (concat subdir d "/"))
-		      (insert (concat indent-str " + [[file:" 
-				      subdir "][" d "/]]\n"))
-		      (setq indent-str (make-string 
-					(+ (length indent-str) 2) ?\ )))))))
-	    ;; This is common to 'flat and 'tree
+	    (setq localdir (concat (file-name-as-directory dir)
+				   (file-name-directory link)))
+	    (unless (string= localdir oldlocal)
+	      (if (string= localdir dir)
+		  (setq indent-str (make-string 2 ?\ ))
+		(let ((subdirs
+		       (split-string
+			(directory-file-name
+			 (file-name-directory
+			  (file-relative-name localdir dir))) "/"))
+		      (subdir ""))
+		  (setq indent-str (make-string 2 ?\ ))
+		  (dolist (d subdirs)
+		    (setq subdir (concat subdir d "/"))
+		    (insert (concat indent-str " + [[file:" subdir "][" d "/]]\n"))
+		    (setq indent-str (make-string (+ (length indent-str) 2) ?\ ))))))
 	    (insert (concat indent-str " + [[file:" link "]["
 			    (org-publish-find-title file)
-			    "]]\n"))
-	    )))
+			    "]]\n")))))
       (write-file index-filename)
       (kill-buffer (current-buffer)))))
 

-- 
-------------------------------------------------------------------------------
 Manuel Hermenegildo                     |              Prof., C.S. Department
 Director, IMDEA-Software and CLIP Group |                T.U. of Madrid (UPM)
 http://www.cliplab.org/herme            | +34-91-336-7435 (W) -352-4819 (Fax)
-------------------------------------------------------------------------------

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

* Re: Publishing org files : index
  2008-07-09  4:54     ` Manuel Hermenegildo
@ 2008-07-09 16:56       ` Carsten Dominik
  0 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2008-07-09 16:56 UTC (permalink / raw)
  To: Manuel Hermenegildo; +Cc: org-mode, Richard G Riley

Hi Manuel,

I added this change and like the idea.

However, I again had problems with your patch, so I had to apply by  
hand.
Please check that everything arrived correctly in the git repo.   
Thanks a lot.

I left the default for now at `tree'.

- Carsten

On Jul 8, 2008, at 9:54 PM, Manuel Hermenegildo wrote:

>
> Hi Carsten,
>
>> Any news on this, Manuel?
>
> A call went missing when the patch I sent you was applied (my fault
> for not using -u ;-)) but it is actually fixed in the current git
> version.
>
> Btw, the current index includes directory information, so that if I
> have in my project two files:
>
> org/test/too/foo.org (Title: This is file foo)
> org/test/simple.org  (Title: This is a simple Org-generated web page)
>
> the index looks like:
>
>    * org/
>          o test/
>                + too/
>                      # This is file foo
>    * org/
>          o test/
>                + This is a simple Org-generated web page
>
> which can be useful if the directory names are explicit
> enough. However, I think in some cases one actually wants the index to
> look simply like:
>
>    * This is file foo
>    * This is a simple Org-generated web page
>
> I send a patch that implements a new index option:
>
>  :index-style           Can be 'list (index is just an itemized list
>                         of the titles of the files involved) or
>                         'tree (the directory structure of the source
>                         files is reflected in the index). Defaults to
>                         'tree."
>
> (Btw, I would actually prefer to default to 'list, but I leave that to
> you Carsten, or what people prefer, since it would change the current
> behavior.)
>
> Please include the patch if you find it useful.
>
> Cheers,
>
> Manuel
>
>
> =================================================================
>
> --- org-publish.el	2008-07-08 22:30:49.000000000 -0600
> +++ org-publish.el.git	2008-07-08 19:00:04.000000000 -0600
> @@ -263,12 +263,7 @@
>   :index-function        Plugin function to use for generation of  
> index.
>                          Defaults to `org-publish-org-index', which
>                          generates a plain list of links to all files
> -                         in the project.
> -  :index-style           Can be 'list (index is just an itemized list
> -                         of the titles of the files involved) or
> -                         'tree (the directory structure of the source
> -                         files is reflected in the index). Defaults  
> to
> -                         'tree."
> +                         in the project."
>   :group 'org-publish
>   :type 'alist)
>
> @@ -612,8 +607,6 @@
> 	 (index-filename (concat dir (or index-filename "index.org")))
> 	 (index-title (or (plist-get project-plist :index-title)
> 			  (concat "Index for project " (car project))))
> -	 (index-style (or (plist-get project-plist :index-style)
> -			  'tree))
> 	 (index-buffer (find-buffer-visiting index-filename))
> 	 (ifn (file-name-nondirectory index-filename))
> 	 file)
> @@ -628,32 +621,25 @@
> 	      (oldlocal localdir))
> 	  ;; index shouldn't index itself
> 	  (unless (string= fn ifn)
> - 	    (if (eq index-style 'list)
> -		(message "Generating list-style index for %s" index-title)
> -	      (message "Generating tree-style index for %s" index-title)
> -	      (setq localdir (concat (file-name-as-directory dir)
> -				     (file-name-directory link)))
> -	      (unless (string= localdir oldlocal)
> -		(if (string= localdir dir)
> -		    (setq indent-str (make-string 2 ?\ ))
> -		  (let ((subdirs
> -			 (split-string
> -			  (directory-file-name
> -			   (file-name-directory
> -			    (file-relative-name localdir dir))) "/"))
> -			(subdir ""))
> -		    (setq indent-str (make-string 2 ?\ ))
> -		    (dolist (d subdirs)
> -		      (setq subdir (concat subdir d "/"))
> -		      (insert (concat indent-str " + [[file:"
> -				      subdir "][" d "/]]\n"))
> -		      (setq indent-str (make-string
> -					(+ (length indent-str) 2) ?\ )))))))
> -	    ;; This is common to 'flat and 'tree
> +	    (setq localdir (concat (file-name-as-directory dir)
> +				   (file-name-directory link)))
> +	    (unless (string= localdir oldlocal)
> +	      (if (string= localdir dir)
> +		  (setq indent-str (make-string 2 ?\ ))
> +		(let ((subdirs
> +		       (split-string
> +			(directory-file-name
> +			 (file-name-directory
> +			  (file-relative-name localdir dir))) "/"))
> +		      (subdir ""))
> +		  (setq indent-str (make-string 2 ?\ ))
> +		  (dolist (d subdirs)
> +		    (setq subdir (concat subdir d "/"))
> +		    (insert (concat indent-str " + [[file:" subdir "][" d "/]]\n"))
> +		    (setq indent-str (make-string (+ (length indent-str) 2) ? 
> \ ))))))
> 	    (insert (concat indent-str " + [[file:" link "]["
> 			    (org-publish-find-title file)
> -			    "]]\n"))
> -	    )))
> +			    "]]\n")))))
>       (write-file index-filename)
>       (kill-buffer (current-buffer)))))
>
>
> -- 
> -------------------------------------------------------------------------------
> Manuel Hermenegildo                     |              Prof., C.S.  
> Department
> Director, IMDEA-Software and CLIP Group |                T.U. of  
> Madrid (UPM)
> http://www.cliplab.org/herme            | +34-91-336-7435 (W)  
> -352-4819 (Fax)
> -------------------------------------------------------------------------------
>

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

end of thread, other threads:[~2008-07-09 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-26 20:56 Publishing org files : index Richard G Riley
2008-06-27  2:59 ` Manish
2008-06-27 13:51   ` Sebastian Rose
2008-06-27  3:02 ` Manuel Hermenegildo
2008-07-08 22:09   ` Carsten Dominik
2008-07-09  4:54     ` Manuel Hermenegildo
2008-07-09 16:56       ` 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).