#!/bin/sh #| -*- Hen -*- exec csi -I "$1" -s "$0" |# ;; Evaluation of this file yields a shell script that generates HTML ;; documents (require-extension srfi-1 ) (define nl (list->string (list #\newline))) (define Header '(Header (style "site.css") (print-style "print.css") (title "My SXML Web Page") (Date-Revision-yyyymmdd "20081210") (Date-Creation-yyyymmdd "20081210") (keywords "SXML, Scheme") (AuthorAddress (img (@ src "images/address.png"))) (Revision "1.0") (Links (Main "index.html" ) (Application "application.html" ) (Home "http://myhost/" ) ))) (define index `(html:begin ,Header (body (page-title) (navbar) (TOC) (page-content (Section* 2 "My First SXML Page") "Era inevitable: el olor de las almendras amargas le recordaba siempre el destino de los amores contrariados. El doctor Juvenal Urbino lo percibió desde que entró en la casa todavía en penumbras, adonde había acudido de urgencia a ocuparse de un caso que para él había dejado de ser urgente desde hacía muchos años. El refugiado antillano Jeremiah de Saint Amour, inválido de guerra, fotógrafo de niños y su adversario de ajedrez más compasivo, se había puesto a salvo de los tormentos de la memoria con un sahumerio de cianuro de oro." (Section 2 "Schedule") ;;(p "A list of lecture topics can be found at the " (url "program.html" "program") " page.") (schedule (brief) (event (date "January 5:") (desc "Application process opens")) (event (date "February 19:") (desc "Application process closes")) (event (date "Mid March:") (desc "Notification of acceptance")) (event (date "End March:") (desc "Confirmation of acceptance")) (event (date "June 14:") (desc "Arrival")) (event (date "June 15-20:") (desc "Methods")) (event (date "June 22-27:") (desc "Neurons, Networks and Behaviors I")) (event (date "June 29-July 2:") (desc "Neurons, Networks and Behaviors II")) (event (date "July 3:") (desc "Departure"))) (footer) )))) (define Country-List `("Japan" "Afghanistan" "Albania" "Algeria" "American Samoa" "Andorra" "Angola" "Anguilla" "Antarctica" "Antigua and Barbuda" "Argentina" "Armenia" "Aruba" "Australia" "Austria" "Azerbaijan" "Bahamas" "Bahrain" "Bangladesh" "Barbados" "Belarus" "Belgium" "Belize" "Benin" "Bermuda" "Bhutan" "Bolivia" "Bosnia and Herzegovina" "Botswana" "Bouvet Island" "Brazil" "British Indian Ocean Territory" "Brunei Darussalam" "Bulgaria" "Burkina Faso" "Burundi" "Cambodia" "Cameroon" "Canada" "Cape Verde" "Cayman Islands" "Central African Republic" "Chad" "Chile" "China" "Christmas Island" "Cocos (Keeling) Islands" "Colombia" "Comoros" "Congo" "Congo, Democratic Republic" "Cook Islands" "Costa Rica" "Cote D'ivoire" "Croatia" "Cuba" "Cyprus" "Czech Republic" "Denmark" "Djibouti" "Dominica" "Dominican Republic" "Ecuador" "Egypt" "El Salvador" "Equatorial Guinea" "Eritrea" "Estonia" "Ethiopia" "Falkland Islands (Malvinas)" "Faroe Islands" "Fiji" "Finland" "France" "French Guiana" "French Polynesia" "French Southern Territories" "Gabon" "Gambia" "Georgia" "Germany" "Ghana" "Gibraltar" "Greece" "Greenland" "Grenada" "Guadeloupe" "Guam" "Guatemala" "Guinea" "Guinea-bissau" "Guyana" "Haiti" "Heard Island and Mcdonald Islands" "Holy See (Vatican City State)" "Honduras" "Hong Kong" "Hungary" "Iceland" "India" "Indonesia" "Iran, Islamic Republic of" "Iraq" "Ireland" "Israel" "Italy" "Jamaica" "Japan" "Jordan" "Kazakhstan" "Kenya" "Kiribati" "Korea, Democratic People's Republic" "Korea, Republic of" "Kuwait" "Kyrgyzstan" "Lao People's Democratic Republic" "Latvia" "Lebanon" "Lesotho" "Liberia" "Libyan Arab Jamahiriya" "Liechtenstein" "Lithuania" "Luxembourg" "Macao" "Macedonia, Republic of" "Madagascar" "Malawi" "Malaysia" "Maldives" "Mali" "Malta" "Marshall Islands" "Martinique" "Mauritania" "Mauritius" "Mayotte" "Mexico" "Micronesia, Federated States of" "Moldova, Republic of" "Monaco" "Mongolia" "Montserrat" "Morocco" "Mozambique" "Myanmar" "Namibia" "Nauru" "Nepal" "Netherlands" "Netherlands Antilles" "New Caledonia" "New Zealand" "Nicaragua" "Niger" "Nigeria" "Niue" "Norfolk Island" "Northern Mariana Islands" "Norway" "Oman" "Pakistan" "Palau" "Palestinian Territory, Occupied" "Panama" "Papua New Guinea" "Paraguay" "Peru" "Philippines" "Pitcairn" "Poland" "Portugal" "Puerto Rico" "Qatar" "Reunion" "Romania" "Russian Federation" "Rwanda" "Saint Helena" "Saint Kitts and Nevis" "Saint Lucia" "Saint Pierre and Miquelon" "Saint Vincent and The Grenadines" "Samoa" "San Marino" "Sao Tome and Principe" "Saudi Arabia" "Senegal" "Serbia and Montenegro" "Seychelles" "Sierra Leone" "Singapore" "Slovakia" "Slovenia" "Solomon Islands" "Somalia" "South Africa" "Spain" "Sri Lanka" "Sudan" "Suriname" "Svalbard and Jan Mayen" "Swaziland" "Sweden" "Switzerland" "Syrian Arab Republic" "Taiwan, Province of China" "Tajikistan" "Tanzania, United Republic of" "Thailand" "Timor-leste" "Togo" "Tokelau" "Tonga" "Trinidad and Tobago" "Tunisia" "Turkey" "Turkmenistan" "Turks and Caicos Islands" "Tuvalu" "Uganda" "Ukraine" "United Arab Emirates" "United Kingdom" "United States" "United States Minor Outlying Islands" "Uruguay" "Uzbekistan" "Vanuatu" "Venezuela" "Viet Nam" "Virgin Islands, British" "Virgin Islands, U.S." "Wallis and Futuna" "Western Sahara" "Yemen" "Zambia" "Zimbabwe")) ;; ;; A list of variables to be included in the application HTML form. ;; The format is (name default-value [...] [(label ...) (type ...)] [children ...]) ;; ;; The default label is the name of the variable. ;; If the type is not specified, default is text. ;; (define application-form-variables `( (form-group Personal-Data (label "Personal Data") (children (First-Name "" (label "First Name * ")) (Last-Name "" (label "Last Name * ")) (email "" (label "Email address * ")) (Nationality "" (label "Nationality *") (select ,Country-List)) (Birth-Year "" (label "Year of birth *") (select ,(list-tabulate 50 (lambda (i) (number->string (+ 1940 i)))))) (Gender "" (label "Gender *") (select ("Female" "Male"))) (Visa-Required "" (label "Do you need a visa to enter Japan? *") (select ("Yes" "No"))) (Travel-Support "" (label "Do you request travel support? *") (select ( "No" "Yes"))) (Airport "" (label "The airport you will depart from and return to if accepted for the course *")) )) (form-group Affiliation (children (Organization "" (label "University or Institute *")) (Department "") (Laboratory "") (Street "" (label "Street *")) (City "" (label "City *")) (Postal-Code "" (label "Postal code *")) (Country "" (label "Country *") (select ,Country-List)) (Fax "" (label "Fax (include country code) ")) (Phone "" (label "Phone * (include country code)")) (Website "" (label "The web site URL of your laboratory or institute ")) )) (form-group Education (label "Education & professional background") (children (Degree "" (label "Last degree obtained ") (select ("Bachelor of Science" "Master of Science" "Ph.D." "Current undergraduate student"))) (Major "" (label "Academic major ") (select ("Artificial Intelligence" "Biochemistry" "Biology" "Biomedicine" "Biophysics" "Biotechnology" "Chemistry" "Cognitive science" "Computational Biology" "Computational Neuroscience" "Computer Science" "Engineering" "Genetics" "Mathematics" "Medicine" "Neural Networks" "Neuroinformatics" "Neuroscience" "Physics" "Psychology" "Systems Biology" "Other"))) (Degree-Other "" (label "Degree obtained if other ")) (Education-History "" (label "Education history") (hint "Please list year, institution, and highest degree obtained. " "Start with most recent (max 40 words): ") (textarea (rows 10) (cols 60))) (Advisor-Last-Name "" (label "Advisor's last name ")) (Advisor-First-Name "" (label "Advisor's first name ")) (Advisor-email "" (label "Advisor's email address ")) (CNS-Education "" (label "Have you participated in a CNS course " "(e.g. Arcachon, FIAS, Obidos, OCNC, Woods Hole, ...) " "in the preceding years? If so please list place and date.")) (Professional-Status "" (label "Professional status ") (select ("Bachelor Student" "Master Student" "Graduate Student" "Postdoctoral Fellow" "Junior Faculty (Non-Tenured)" "Senior Faculty (Tenured)" "Industry (Junior Level)" "Industry (Senior Level)" "Management" "Other"))) (Professional-Status-Other "" (label "Professional status, if other ")) (Professional-Experience "" (label "Professional experience (max 100 words) ") (textarea (rows 20) (cols 72))) (Publications "" (label "List 5 most relevant publications you have (max 100 words) ") (hint "Please include full bibliographic information for each publication. " "If possible, include URL to abstract. " "Please no submitted papers or dissertations. ") (textarea (rows 20) (cols 72))) (Experimental-Neuroscience-Experience "" (label "Experience in experimental neuroscience (max 40 words) ") (hint "Please specify field, experimental preparation, laboratory, etc.") (textarea (rows 10) (cols 72))) (Computational-Neuroscience-Experience "" (label "Experience in computational neuroscience (max 40 words) ") (hint "Have you ever used a neural simulation program, if so which? " "Have you attended other schools or taken courses on this subject?") (textarea (rows 10) (cols 72))) (Applied-Math-Experience "" (label "Experience in applied mathematics (max 40 words) ") (hint "E.g. differential equations, linear algebra, Fourier transforms, " "dynamical systems, probability and statistics. ") (textarea (rows 10) (cols 72))) (Additional-Information "" (label "Any information which is not evident from the above (max 100 words) ") (textarea (rows 20) (cols 72))) )) (form-group Course (label "About the course") (children (How-did-you-discover "" (label "How did you discover the course?") (select ("Ad in Nature" "Ad on a mailing list" "Through a previous participant" "Through my advisor" "Through a search on the web" "Other"))) (How-did-you-discover-Other "" (label "How did you discover the course if other?")) (Research-Interest "" (label "Describe your personal research interest(s) " "and how they relate to OCNC and its faculty (max 150 words) ") (textarea (rows 25) (cols 72))) (Personal-Motivation "" (label "Why do you want to apply? (max 150 words) ") (hint "Your personal reasons and motivations.") (textarea (rows 25) (cols 72))) )) (form-group Project (label "Your course project") (children (Project-Title "" (label "Title ")) (Project-Type "" (label "Type of project ") (select ("Subcellular Model" "Single Cell Model" "Network Model" "System Level Model" "Data Analysis" "Behavioral Experiment" "Don't know yet"))) (Project-Type "" (label "Project software") (hint "Principal software to be used in your project.") (select ("Don't know yet" "MATLAB" "NEURON" "NEXT" "Other (specify in project description)" ))) (Project-Description "" (label "Project description (max 150 words) ") (textarea (rows 25) (cols 72))) )) )) (define application `(html:begin ,Header (body (page-title) (navbar) ;; (TOC) (page-content (Section* 2 "Example Form") (p "If you make multiple submissions, only the most recent one will be considered. " "Fields marked with * are required.") (form (@ (action "FormMail.cgi") (method "POST")) (formvar . ,application-form-variables) ,nl (input (@ (type "hidden") (name "subject") (value "Application"))) ,nl (input (@ (type "hidden") (name "recipient") (value "registration"))) ,nl (input (@ (type "hidden") (name "required") (value ,(string-intersperse (map symbol->string `(email First-Name Last-Name Nationality Birth-Year Gender Visa-Required Travel-Support Airport Organization Street City Postal-Code Country Phone)) ",")))) ,nl (input (@ (type "hidden") (name "print_config") (value "email,FirstName,LastName"))) ,nl (input (@ (type "hidden") (name "return_link_url") (value "http://myhost/"))) ,nl (input (@ (type "hidden") (name "return_link_title") (value "Back to home page"))) ,nl (div (@ (class actions)) (input (@ (type submit) (class primaryAction) (id submit) (value "Send")))) ) ) (footer) ))) (include "template.scm") (define site `((index ,index) (application ,application) )) (define operand (and (> (length (command-line-arguments)) 1) (string->symbol (second (command-line-arguments))))) (for-each (lambda (x) (let ((name (car x)) (content (cadr x))) (print "/bin/cat > " name ".html" " <