Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

index.r file in View

 [1/7] from: athiele::abraxis::com at: 11-Mar-2002 11:35


How do y`all handle the index.r file? I find it annoying to have to manually edit the file to show new additions. I wrote a little script to do it automatically. Has anyone else addressed this ? Does anyone really care? Adrian

 [2/7] from: chris:ross-gill at: 11-Mar-2002 12:28


Hi Adrian,
> How do y`all handle the index.r file? I find it annoying to have to > manually edit the file to show new additions. I wrote a little script to > do it automatically. Has anyone else addressed this ?
I hand edit the %index.r, but I'd be interested in any automatic way to do edit it. Does it have a gui? How does it handle sub-index files?
> Does anyone really care?
I care. - Chris

 [3/7] from: gchiu:compkarori at: 12-Mar-2002 14:57


On Mon, 11 Mar 2002 11:35:17 -0500 "Adrian" <[athiele--abraxis--com]> wrote:
> How do y`all handle the index.r file? I find it annoying > to have to manually
<<quoted lines omitted: 3>>
> Does anyone really care? > Adrian
I was writing a small CGI script to create my index.r dynamically last night, and to create a visitor counter. Trouble is, although it comes up, none of the file links work. Haven't had time to see why but the paths are correct. My usual index.r is at http://www.compkarori.co.nz/index.r and the test one is at: http://www.compkarori.com/cgi-local/index.r The other point of the dynamic index.r is that the cgi script automatically appends the file size and date information after file entries so that the viewer's cache can be updated. -- Graham Chiu

 [4/7] from: ronald:free at: 12-Mar-2002 9:35


Hi Adrian, Searching in the list, I've found this : Message transmis From: Joanna Kurki <[belymt--saunalahti--fi]> To: [rebol-list--rebol--com] Date: Wednesday, May 02, 2001, 1:03:46 AM Subject: [REBOL] Re: REB Editor ===8<==============Texte du message original===============
>I haven't used it alot, but haven't noticed anything bad in it yet.
Hmm.. It could be OS/version dependant issue.. I'll install Amiga Emulator and Linux (dualboot) to this machine some day.. While I'm here.. Is there archive of this mailing list somewere on the web? Joanna PS: Something I did. (my first attempt ) Now I only need to make this and index.r reloading happen automatically :-) REBOL [ Title: "Local index refresher" File: %redir.r Author: "Joanna Kurki" Date: 1-May-2001 Purpose: { To automatically regenerate local %index.r file... My first Rebol program, and far from finished } TODO: { Add support for directories (recurse) and set their type right Clean up code.. fix bugs (there are allways bugs) } ] dir: read %. if exists? %index.old [delete %index.old] rename %index.r %index.old write %index.r read %index-orig.r write/append %index.r now write/append %index.r newline foreach file dir [ write/append %index.r reduce rejoin [{file "} :file {" }] write/append %index.r remold file write/append %index.r newline ] -- To unsubscribe from this list, please send an email to [rebol-request--rebol--com] with "unsubscribe" in the subject, without the quotes. ===8<===========Fin du texte du message original=========== Hope It'll help Cheers -- Ronald

 [5/7] from: rebol:optushome:au at: 13-Mar-2002 6:57


I do it by hand too, only takes a second to edit, (not worth writing a script to do it for me). But you can use/modify the make-index.r script from the rebs tools directory. http://www.rebol.com/view/tools/make-index.r Cheers, Allen K

 [6/7] from: vdemong:club-internet at: 12-Mar-2002 23:19


I write this script, when i learn REBOL, to update my local directory: REBOL [ Title: "local index" Author: "Vincent" Email: [vdemong--club-internet--fr] Version: 0.1 Date: 24-May-2001/15:30 Type: 'utility Info: "Scan local folders and subfolders, update/create all %index.r" Purpose: { scan local folders and sub folders search rebol files: .r html files: .html .htm pdf files: .pdf images files: .png .jpg .gif text files: .txt create index files (index.r) for each folder and its subfolders. create thumbnail images of all images, use them as icons. } ] make-line: function [ "Build a line for an index file." file [file!] "File to index" /html "File type is html" /text "file type is text" /image "file type is image" img-file "Complete path of image file" /pdf "file type is pdf" ] [line thumb-file thumb-lay] [ line: copy "file " append line reduce [ {"} copy/part file find file "." {" %} file " icon " ] if html [append line "html"] if text [append line "text"] if image [ ;Create thumbnail icon thumb-file: append copy tn-dir copy/part file find file "." append thumb-file %.png thumb-lay: layout [ size 75x50 backdrop img-file effect [aspect] at 0x0 vtext bold "IMAGE" ] save/png thumb-file to-image thumb-lay ;Make transparent where is black append line compose ["%" (thumb-file) " effect [key 0.0.0]" ] ] if pdf [append line "pdf"] line ] index-folder: function [ "Create index for a directory and sub-diretories." folder [file!] "Directory to index." ] [ line info-file inf file f hdr src img-blk html-blk tn-dir] [ ;Delete info file info-file: append copy folder %index.r error? try [delete info-file] ;create index.r and Write minimal header write/append info-file "REBOL [type: 'index]" write/append/direct info-file newline fold: read folder foreach f fold [ file: append copy folder f inf: info? file either inf/type = 'directory [ line: copy "folder" append line reduce [ { "} f {" %} f ] write/append info-file line write/append info-file newline ;Recursive index index-folder file ][ switch find f "." [ %.r [ ;Don't index index files... if f <> %index.r [ line: copy "file " hdr: src: none if script? file [ ;Read header fields of script (use Title and Info fields) either error? try [set [hdr src] load/header/next file ] [ append line reduce [ {" } copy/part f find f "." {" } f ] ][ either ((find first hdr 'Title) <> none) and (hdr/Title <> Untitled ) [ append line reduce [ {"} hdr/Title {" %} f ] ][ append line reduce [ {" } copy/part f find f "." {" %} f ] ] if find first hdr 'Info [ append line reduce [ { info "} hdr/Info {"} ] ] ] ] ] ] %.htm [ line: make-line/html f] %.html [ line: make-line/html f] %.pdf [ line: make-line/pdf f] %.png [ line: make-line/image f file] %.jpg [ line: make-line/image f file] %.gif [ line: make-line/image f file] %.txt [ line: make-line/text f] ] write/append info-file line write/append info-file newline ] ] ] msg: { This script scan the local directory. Erase all index.r files, and rebuild them. Are you sure that you want that? } if request/confirm msg [ ;Create a directory for thumbnail images of images files tn-dir: append copy system/options/home %thumbnail/ error? try [make-dir tn-dir] ;index local folder local-dir: append copy system/options/home %local/ index-folder local-dir ]

 [7/7] from: athiele:abraxis at: 12-Mar-2002 22:54


Thanks Vincent that gives me a bit more to work with.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted