Code Monkey home page Code Monkey logo

pkgtemplates.jl's Introduction

PkgTemplates

Stable Latest Build Status Build Status Codecov

PkgTemplates is a Julia package for creating new Julia packages in an easy, repeatable, and customizable way.

Installation

pkg> add PkgTemplates

Usage

Assuming you have the relatively standard Git options user.name, user.email and github.user set up globally with git config --global, the simplest template requires no arguments:

julia> using PkgTemplates

julia> t = Template()
Template:
   User: christopher-dG
   Host: github.com
   License: MIT (Chris de Graaf 2018)
   Package directory: ~/.julia/dev
   Minimum Julia version: v1.0
   SSH remote: No
   Commit Manifest.toml: No
   Plugins: None

julia> generate("MyPkg", t)

julia> run(`git -C $(joinpath(t.dir, "MyPkg")) ls-files`);
.gitignore
LICENSE
Manifest.toml
Project.toml
README.md
REQUIRE
src/MyPkg.jl
test/runtests.jl

However, we can also configure a number of keyword arguments to Template:

julia> t = Template(;
           user="myusername",
           license="ISC",
           authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
           dir="~/code",
           julia_version=v"0.7",
           plugins=[
               TravisCI(),
               Codecov(),
               Coveralls(),
               AppVeyor(),
               GitHubPages(),
           ],
       )
Template:
   User: myusername
   Host: github.com
   License: ISC (Chris de Graaf, Invenia Technical Computing Corporation 2018)
   Package directory: ~/code
   Minimum Julia version: v0.7
   SSH remote: No
   Commit Manifest.toml: No
   Plugins:
    • AppVeyor:
       Config file: Default
       0 gitignore entries
    • Codecov:
       Config file: None
       3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
    • Coveralls:
       Config file: None
       3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
    • GitHubPages:
       0 asset files
       2 gitignore entries: "/docs/build/", "/docs/site/"
    • TravisCI:
       Config file: Default
       0 gitignore entries

julia> generate(t, "MyPkg2")

julia> run(`git -C $(joinpath(t.dir, "MyPkg2")) ls-files`);
.appveyor.yml
.gitignore
.travis.yml
LICENSE
Project.toml
README.md
REQUIRE
docs/Manifest.toml
docs/Project.toml
docs/make.jl
docs/src/index.md
src/MyPkg2.jl
test/runtests.jl

Information on each keyword as well as plugin types can be found in the documentation.

If that looks like a lot of work, you can also create templates interactively with interactive_template:

asciicast

And if that's still too much work for you, you can call interactive_template with fast=true to use default values for everything but username and plugin selection.

You can also use generate_interactive to interactively generate a template and then immediately use it to create a new package.

Comparison to PkgDev

PkgTemplates is similar in functionality to PkgDev's generate function. However, PkgTemplates offers more customizability in templates and more extensibility via plugins. For the package registration and release management features that PkgTemplates doesn't include, you are encouraged to use AttoBot instead.

Contributing

It's extremely easy to extend PkgTemplates with new plugins. To get started, check out the plugin development guide.

pkgtemplates.jl's People

Contributors

christopher-dg avatar iamed2 avatar juliohm avatar mortenpi avatar omus avatar saschamann avatar tkf avatar

Watchers

 avatar  avatar  avatar

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.