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
- Host: GitHub
- URL: https://github.com/abiosoft/gopages
- Owner: abiosoft
- Created: 2015-03-13T08:23:32.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-13T13:08:43.000Z (over 11 years ago)
- Last Synced: 2025-01-23T14:49:47.671Z (over 1 year ago)
- Language: Go
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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"