Changeset 18118 in project


Ignore:
Timestamp:
05/19/10 21:02:56 (9 years ago)
Author:
Mario Domenech Goulart
Message:

Changes applied for mario (189.114.111.55) through svnwiki:

Added tip about how to create page definers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/awful

    r18090 r18118  
    970970
    971971
     972==== Create custom page definers when {{page-template}} and/or plain {{define-page}} are not enough
     973
     974You can define your own page definers when {{page-template}} or the plain {{define-page}} is not enough for what you need.  Here's an example:
     975
     976<enscript highlight=scheme>
     977#!/usr/bin/awful
     978
     979(use awful html-tags)
     980
     981(define (define-custom-page path contents)
     982  (define-page path
     983    (lambda ()
     984      (<html> (<body> (contents))))
     985    no-template: #t))
     986
     987(define-custom-page (main-page-path)
     988  (lambda ()
     989    "Hey!"))
     990</enscript>
     991
     992If you access {{http://localhost:8080}} you'll get the following HTML code:
     993
     994  <html><body>Hey!</body></html>
    972995=== The name
    973996
Note: See TracChangeset for help on using the changeset viewer.