stunningly simple & stupid language agnostic project generator
With stub, you can create new projects instantly and have the most essential parts renamed and substituted.
Likewise, you can use stub to create new classes inside existsing projects in a second.
-
Stub-template example:
https://github.com/xdbr/stub-template-typesetting
-
Project generated / substitutions made:
. .--------[ main.pandoc ] --------------.
|-- README.md | % {{head1}} <-- these will |
|-- Rakefile | % {{head2}} <-- be stubstituted |
|-- bibliography.bib | % {{head3}} <-- by stub |
|-- chapters | |
| |-- 100-Introduction.pandoc | <#include resources/gpp-defines.gpp> |
| |-- 200-Examples.pandoc | |
| `-- 900-End.pandoc | <#part Part I> |
|-- main.pandoc ---D E T A I L V I E W--->| |
|-- project.json | # Introduction |
`-- resources | |
|-- ditaa | [...] |
| `-- typesetting-process.ditaa | |
`-- gpp-defines.gpp '--------------------------------------'
-
Command used
stub template:new template=https://github.com/xdbr/stub-template-typesetting to=destinaton-dir head1=foobar
Run
curl --silent https://raw.github.com/xdbr/stub/master/install.sh | $SHELL
...and follow the instructions
stub template:new template=TEMPLATE-NAME to=DESTINATION_DIR variable1=value1 variable2=value2 ...
stub template:new template=http://path/to/repo.git to=DESTINATION_DIR variable1=value1 variable2=value2 ...
stub template:info template=TEMPLATE-NAME-or-path-to-repo
Creating a project stub to be reused is straightforward and simple. Here's a quick rundown:
- Generate your skeleton of how you want your files and folders to be layed out
- substitute all variables with mustaches that you liked to be filled in, e.g.
class {{classname}}
. This will be set by usingstub project new template=yourtemplatename classname=foo
- write a file
project.json
, put it in the top directory of your skeleton. - Use the following layout for your
project.json
:
{
"requires": {
"name" : "string",
"version": "versionstring"
},
"optional": {
"author": "Quux"
}
}
Note that:
a) in this example, the variables name
and version
will be required upon using this stub
b) the optional variables can be set (name="me") or their default values will be used ("Quux")
c) the definitions string
and versionstring
only carry an informative value, but will not be validated
stub -T
stub --tasks
stub template:list
Daniel dbrx@crux.uberspace.de
WTFPL