Skip to content

Instantly share code, notes, and snippets.

@arieh
Created February 12, 2010 12:24
Show Gist options
  • Save arieh/302519 to your computer and use it in GitHub Desktop.
Save arieh/302519 to your computer and use it in GitHub Desktop.
#!/bin/sh
#==========
# Settings
#==========
# Is this shell runing in cygwin (1/0)
cygwin=0;
# Drive containing www folder (only needed for cygwin users)
www_drive="c:";
# WWW folder (or any othre target folder you might want to use)
www_folder="wamp/www";
# Forge user name
forge_name="";
$Github user name
github_name="";
#Full name (used for the yml headers)
full_name="";
#Any license you might want to add to JS file. default is MIT license
lincense="Copyright (c) 2010 ${full_name}
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the \"Software\"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE";
echo "Enter Project Name:"
read name
#=================
# Project Folder
#=================
if [ $cygwin -eq 1 ]; then
cd ${www_drive}
fi
cd ${www_folder}
mkdir ${name}
cd ${name}
echo "${name}
========
![Screenshot]()
How to use
----------
Options
---------
Events
-------
">> README.md
mkdir Source
echo "/*
---
description:
license: MIT-style
authors:
- ${full_name}
requires:
- core/1.2.4 : [Class, Class.Extras, Element]
provides: [${name}]
...
*/
/*!
${lincense}
*/
var ${name} = new Class({
Implements : [Options],
options : {
},
initialize : function(options){
}
})" >> Source/${name}.js
mkdir Docs
touch Docs/${name}.md
echo "Class: ${name} {#${name}}
==========================================
The Tree-Acordion takes a tree structured HTML element and adds the effects needed to make it use an accordion effect on its branches.
the class also provides keybard accessible interface.
${name} Method: constructor {#${name}:constructor}
---------------------------------
### Syntax:
var some_var = new ${name}(options);
### Arguments:
1. options - (`object`: optional) See below:
### Options:
${name} Method : {#${name}:}
----------------
### Syntax:
### Arguments:
${name} : Events {#${name}:Events}
---------------
*
" >> Docs/${name}.md
touch package.yml
echo "name: ${name}
author: ${forge_name}
current: 0.1
category:
tags: []
demo: http://${github_name}.github.com/${name}
docs: http://moodocs.net/${github_name}/${name}/${name}" >> package.yml;
mkdir Demo
touch Demo/index.html
echo "<!DOCTYPE html
PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html>
<head>
<title>${name} Demo</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset='UTF-8'\" />
<style type='text/css'>
</style>
</head>
<body>
<h1>${name} Demo</h1>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js'></script>
<script type='text/javascript' src='../Source/${name}.js'></script>
<script type='text/javascript'>
var some_var = new ${name}();
</script>
</body>
</html>" >> Demo/index.html
git init
git add *
git commit -m "pre-commit"
git remote add origin git@github.com:${name}.git
#===========
# GH-Pages
#===========
cd ..
mkdir ${name}-ghp
cd ${name}-ghp
git init
git symbolic-ref HEAD refs/heads/gh-pages
touch index.html
echo "<!DOCTYPE html
PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html>
<head>
<title>${name} Demo</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset='UTF-8'\" />
<style type='text/css'>
</style>
</head>
<body>
<h1>${name} Demo</h1>
</body>
</html>" >> index.html
git add index.html
git commit -m "pre-commit"
git remote add origin git@github.com:${name}.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment