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

[REBOL] Re: First attempt at Rebol - 16 hours later

From: anton::wilddsl::net::au at: 24-Sep-2007 13:43

Hi Greg, Here is a mock GUI layout. window: layout [ across map-face: area 220x600 wrap font-name font-fixed ;(map) scroller 16x600 main-face: area 400x600 ;(read %emma11.txt) scroller 16x600 panel [ button "Load..." button "title" button "<div>" button "<br>" ] ] edit-book: func ["Opens a window to edit and markup text" 'text [file! string! word! paren! any-type!] ; any-type! to allow unset! (ie. no arg specified in command line) ][ ; handle 'text argument text: either value? 'text [:text][copy ""] ; convert unset to empty string if word? :text [text: any [all [string? get :text get :text] copy ""]] ; a word which evaluates to a string if file? text [text: read text] if paren? text [text: do text] if not string? text [text: copy ""] ; convert any other type to empty string main-face/text: text main-face/line-list: none ; Open window ;view/new layout [across map-face: area 200x600 area 400x600 (text)] view/new window ;<- Process text here, generate map etc. map-face/text: "-----------2-1---^/---- etc..." ; <-- mockup placeholder map for now... show map-face do-events ] ; Usage example
>> edit-book
You wrote:
> Anto, that was more than I was expecting from anyone and very kind of you > .
No worries, mate.
> I will need to study the changes this afternoon to get my REBOL much impr > oved. > > I know the script aims are very simple, and only useful for a very restri > ctive need.
The simpler the better.
> In the end I will make it publically available (if it is up to scratch), > so at least teachers can convert HTML and plain text literature into more > useful forms. > > "1) Insert page break > Replace selected <bnn> with <br/>" > > "2) Make title > Enclose selected text in <title> </title>" > > And yes this is primary objective, just give the text structural shape so > that it can be more easily handled (<div> being most important - chapter > s having beginings and ends etc).
Any others?
> The problems with all XMLeditrors I have used is that they assume you are > inputing the text into tags, when in fact for such things you need to st > ructure the text with tags. They just don't work for large works - unles > s cutting and pasting hundreds of pages is seen as a good productive time > (it isn't).
I am the most important program in the world!
> Greg Schofield
Regards, Anton.