pusparajm / gopages Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/gopages
Automatically exported from code.google.com/p/gopages
// Copyright 2010 Abiola Ibrahim <[email protected]>. 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 <?go ?> 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 ------- <html> <body> <?go print("<h1>Hello World</h1>") ?> </body> </html> ------- 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 <?go ?> e.g. "<p> <?go print(i) ?>" -FRAGMENTS <go:include page="path/to/fragment" /> e.g. <go:include page="fragments/login.ghtml" /> <go:include page="fragments/footer.html" /> 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"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.