template-conductor

0.1.3 • Public • Published

Conductor

Simple project template manager created in node. Conductor uses a simple directory structure for a project template and allows the usage of variables to customize project specific elements. Conductor fills the gap between basic tools like bagpack which only copies a directory tree and yeoman which is very powerful but has a steep learning curve when creating simple templates.

Installation

$ npm install -g template-conductor

Usage

$ conductor --help

  Usage: conductor [options] [command]


  Commands:

    clone [templatename]  Clone one or more templates.
    list [templatename]   List available templates. If [templatename] given, template variables are displayed.
    publish [remote]      Publish the current directory as a template.
    remote                Handle remote template sources.
    help [cmd]            display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Detailed Usage

conductor-remote

$ conductor remote

  Usage: conductor-remote [options] [command]


  Commands:

    add [remotename] [path]  Add path to template files
    remove [remotename]      Remove template source path
    list                     List all remote project template sources

  Options:

    -h, --help  output usage information

Remotes are directories which hold one or more templates that can be cloned using the clone command.

Add new groups of templates with the add command. Note: [path] should be an absolute path.

$ conductor remote add mytemplates c:/Users/swyphcosmo/conductor-templates

Remove remotes with the remove command.

$ conductor remote remove mytemplates

List all the remotes and their paths with the list command.

$ conductor remote list
mytemplates  'c:/Users/swyphcosmo/conductor-templates'

conductor-clone

Templates can be cloned into any directory. It is expected that templates be managed with git so the .git directory is ignored during cloning.

Warning: conductor does not check before overwriting files.

$ mkdir mydocument
$ cd mydocument
$ conductor clone conductor-pandoc-docx

Installing conductor-pandoc-docx into 'mydocument'

? Please enter a value for 'Document Name': mydocument
Creating new file 'Makefile'
Creating new directory 'Images'
Creating new file 'reference.docx'
Creating new file 'mydocument.md'

conductor-list

List all available templates:

$ conductor list
mytemplates (c:/Users/swyphcosmo/conductor-templates):
    conductor-pandoc-docx

List all variables in a template:

$ conductor list conductor-pandoc-docx
Variables used in 'conductor-pandoc-docx':
    {{conductor.DocumentName}}

Template Format

Templates are directory based. A remote is a directory containing one or more templates (directories). Inside each template is one or more files and directories which will be used in a new project.

Variables can be used in the file contents and also in directory or file names. Variables are formated as follows:

{{conductor.<variableName>}}

Examples:

{{conductor.DocumentName}}
{{conductor.compiledLibraryName}}

During the cloning process, conductor will ask for a value for each unique variable. To make the queries more human readable, use camelCase for variable names. The variable name will be automatically broken into words before each capital letter, and the first letter will be capitalized.

Examples:

  • {{conductor.DocumentName}} => Document Name
  • {{conductor.compiledLibraryName}} => Compiled Library Name

Available Templates

License (MIT)

Copyright (c) 2015 Michael Vernier

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.

Readme

Keywords

Package Sidebar

Install

npm i template-conductor

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • swyphcosmo