Giter Club home page Giter Club logo

parboil's People

Contributors

jneug avatar

Watchers

 avatar  avatar

parboil's Issues

Make -m the default for install

Make -m the default for boil install (merge template in existing directory) and replace -f with a --hard option, that deletes the target dir first.

Sub-templates

It would be nice if projects could include other project templates during compilation. For example a "java-project" template could run a "license" template, the adds a license file to the project. The "python-project" template could reference the same "sub-template" to include a license.

At some point this would probably require some kind of dependency management? But for now the compilation process could just display a warning and continue on.

Advanced field definitions

Allow fields to have more complex logic. String values are normal default values, while a dict defines an advanced field. The dict should at least have a type key to determine the field type and usually a value key.

The default value could than also be defined as an advanced field with

{
	"fields": {
		"FieldName": {
			"type": "default-value",
			"value": "my default"
		}
	}
}

This would allow for more complex types of inputs. e.g a file select type.

Allow updates for repo installs

Installs with boil install -r can only be updated from the local filesystem, not from GitHub. This is due to the fact, that the template can't be simply pulled for an update.

Similar to repo installs, the update could clone the original repository to a temp folder and only copy the template to update to the local repository.

Location of config files

Config files and the default local repository are stored in ~\.config\parboil. On Windows this is not correct.

Where is the best location for these files on each system?

See appdir for a package dealing with this.

Namespaces for prefilled values

To avoid conflicts with different templates, it should be possible to attach profiled values to specific project templates.

E.g. the following config file would profile the Author key with the value Jonas Neugebauer. But for the license template the value will be J. Neugebauer and for the git template it will be jneug.

{
	"prefilled": {
		"Author": "Jonas Neugebauer",

		"license": {
			"Author": "J. Neugebauer"
		},

		"git": {
			"Author": "jneug"
		}
	}
}

Make TEMPLATE argument for install optional

The second argument to the install command could be made optional. The default should use the folder or repository name as a template name.

boil install my/tpl/dir

would than be used with the name dir:

boil use dir

The template argument could be moved to a -t option.

Allow config settings from cli

boil should create and populate a click context object that gets passed on to subsequent commands.

The config object is constructed as follows and o duplicate config keys in each step:

  1. Load some defaults,
  2. load the default config file,
  3. load the config file supplied via cli (-c option),
  4. set TPL_DIR to the -tpldir option,
  5. set TPL_DIR to the BOIL_TPL_DIR environment var.

Refactor template flow

The flow for using a template with boil use need to be reworked to allow for dynamic alterations to the template compilation (e.g. adding or removing template files to parse). This would allow for more complex field types (see #5).

All relevant project data should be held in a Project class that gets through the flow and can be altered at different points. The class should encapsulate everything about the project template. This would also allow for multiple templates to be used at once or "sub-templates" (See #7).

Test on Windows

Does it work on windows?

Especially the subprocess call to git needs to be tested.

Also see #14

Allow file naming via project.json

Jinjas syntax might cause problems on some filesystems that don't permit the required special characters.

A possible solution would be to allow renaming via a special field in project.json.

For example:

{
    "filename.txt": {
        "type": "rename",
        "value": "{{ time '%Y' }}.md"
    }
}

Install source directly into template repository

For a folder structure like this

root
    tpl1
    tpl2
    tpl3

it should be possible to install all templates in root into t he local template repository.

For example with

boil install -r root

wirh -r indicating that root is a directory of templates.

Afterward the templates tpl1, tpl2 and tpl3 should be available for use.

Problems:

  • boil install currently requires a template name as second argument. Either this argument needs to be optional (also see #1), it is ignored (not recommended) or is used as a subfolder in the local repo (with boil install -r root repo the templates would ne used with boil use repo/tpl1).

Setting of prefilled values

Currently prefilled values can be loaded from config.json. To allow better integration in custom workflows it would be nice to be able to set prefilled values from the command line to allow runs without user interaction.

Ideas:

  • An option to set values (-v key=value or -vKey value).
  • An option to pass in a json string.
  • Read json from stdin.

Advanced field: File select

This advanced field (see #5) could allow for the selection of a file from a list to be included in the template. The other files from the list would be ignored. The files would be loaded by the Jinja loader and therefore allow for the "includes:" prefix to be used. A license template could store several license files in the includes folder and copy the user selected file to the project.

Some options for this field could be:

  • value: List of filenames (["file-one.txt", "include:file-two.md", "includes:dir/file-three.py"])
  • filename: Rename the file to this ({% time '%Y' %}_file.txt)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.