Rebol Header

This code generator automates the creation of Rebol Header based on this article.

rebol-header

Rebol [
    Title: "header template"
    Author-Url: http://askcodegeneration.com/rebol
    Script-Url:  http://askcodegeneration.com/rebol/header
    Date:  19-Aug-2009
    Purpose: "Create a Header Template for a Rebol Program"
]

header-template: code-block/2

  window: layout [
      text "Header Info"

      across
      label "Title" tab
          f-field-title: field "title"
      return
      label "Author Url" tab
          f-field-author-url: field "author url"
      return
      label "Script Url" tab
          f-field-script-url: field "script url"
      return
      label "Purpose" tab
          f-field-purpose: field "purpose"
      return tab
      button "Submit" [
          Title: f-field-title/text
          Author-Url: f-field-author-url/text
          Script-Url: f-field-script-url/text
          purpose: f-field-purpose/text
          unview
      ]
      button "Cancel" [unview]
  ]
  View window

Author-html-link: rejoin ["<a href=" Author-Url ">" Author-Url "</a>"]
Script-html-link: rejoin ["<a href=" Script-Url ">" Script-Url "</a>"]
date: now/date

write clipboard:// build-markup header-template
print "copied to clipboard ..."
input

Template1:

Rebol [
    Title: "<%title%>"
    Author-Url: <%Author-html-link%>
    Script-Url:  <%Script-html-link%>
    Date:  <%date%>
    Purpose: {
            <%purpose%>
    }
]
Bookmark and Share

Comments

[...] to use it in Real World. Let’s say we want to generate a Rebol Header using the script here http://askcodegeneration.com/rebol/header/. Instead of browsing to it to copy and paste the Url to the clipboard and then launch the do [...]

Leave a comment

Spam Protection by WP-SpamFree