@app.route("/")
def index(*path, **data):
    #print "path:", path
    #print "data:", data
    # Construct a file name in /data from the URL path.
    # For example, path=("pages", "bio.html")
    # is mapped to "/data/pages/bio.html.txt".
    page = "/".join(path)
    page = page if page else "index.html"
    page = page.replace(" ", "-")
    page = page + ".txt"
    page = os.path.join(app.path, "data", page) # Absolute paths are safer.
    #print "page:", page
    
    # If the URL ends in "?save", update the page content.
    if "save" in data and "content" in data:
        return save(page, src=data["content"])
    # If the URL ends in "?edit", show the page editor.
    if "edit" in data:
        return edit(page)
    # If the page does not exist, show the page editor.
    if not os.path.exists(page):
        return edit(page)
    # Show the page.
    else:
        return view(page)

# The pattern.server module has a simple template() function
# that takes a file path or a string and optional parameters.
# Placeholders in the template source (e.g., "$name") 
# are replaced with the parameter values.

# Below is a template with placeholders for page name and content.
# The page content is loaded from a file stored in /data. 
# The page name is parsed from the filename,
# e.g., "/data/index.html.txt" => "index.html".
dataset/ETHPy150Open clips/pattern/examples/08-server/03-wiki/wiki.py/index/original