An open API service indexing awesome lists of open source software.

https://github.com/abiosoft/gopages

Automatically exported from code.google.com/p/gopages
https://github.com/abiosoft/gopages

Last synced: over 1 year ago
JSON representation

Automatically exported from code.google.com/p/gopages

Awesome Lists containing this project

README

          

// Copyright 2010 Abiola Ibrahim . All rights reserved.
// Use of this source code is governed by New BSD License
// http://www.opensource.org/licenses/bsd-license.php
// The content and logo is governed by Creative Commons Attribution 3.0
// The mascott is a property of Go governed by Creative Commons Attribution 3.0
// http://creativecommons.org/licenses/by/3.0/

gopages - http://code.google.com/p/gopages
======

A simple web framework that allows embedding pages in tags.

INSTALL
============
-Command
$ go get code.google.com/p/gopages
-Package
$ go get code.google.com/p/gopages/pkg

EXAMPLES
========
$ go get code.google.com/p/gopages/examples
-Run
$ $GOPATH/bin/examples

HELLO WORLD

create a folder 'hello'

create an index.ghtml
-------


Hello World") ?>


-------
then create hello.go
-------
package main

import (
_ "code.google.com/p/gopages/examples/pages"
"code.google.com/p/gopages/pkg"
"net/http"
)

func main(){
http.HandleFunc("/", gopages.Handler("hello.ghtml"))
http.ListenAndServe(":9999", nil)
}
-------

open terminal

$ cd path/to/project
$ gopages get
$ $GOPATH/bin/hello

finally, point your browser to localhost:9999

HOW IT WORKS
============
gopages generates go source codes to "pages" directory in your project folder.
It is REQUIRED to run 'gopages' before 'go get' to build the whole project
Or run 'gopages get' to build with 'go get' after generating pages

INBUILT FUNCTIONS
- print(...interface{})
- formValue(string) - retrieve formValue

VARIABLES
writer http.ResponseWriter
request *http.Request

TAGS
=====
-CODE

e.g. "

"
-FRAGMENTS

e.g.


ADDING SETTINGS
===============
create a pages.json file in project root with the format below.

{
"extensions" : "ghtml",
"folders" : "src"
}

extensions - files to generate gopages for [optional][default is "ghtml"]
folders - folders to look for gopages files [optional][default is project root]
-separate multiple values with space. e.g. "extensions": "ghtml ghtm"