Trim the readme, hopefully fix another Windows test bug
This commit is contained in:
parent
9b68d22aad
commit
f61253b010
142
README.md
142
README.md
@ -1,146 +1,42 @@
|
|||||||
# PkgTemplates
|
# PkgTemplates
|
||||||
|
|
||||||
[](https://invenia.github.io/PkgTemplates.jl/stable)
|
[](https://invenia.github.io/PkgTemplates.jl/stable)
|
||||||
[](https://invenia.github.io/PkgTemplates.jl/latest)
|
[](https://invenia.github.io/PkgTemplates.jl/dev)
|
||||||
[](https://travis-ci.org/invenia/PkgTemplates.jl)
|
[](https://travis-ci.org/invenia/PkgTemplates.jl)
|
||||||
[](https://ci.appveyor.com/project/christopher-dG/pkgtemplates-jl/branch/master)
|
|
||||||
[](https://codecov.io/gh/invenia/PkgTemplates.jl)
|
[](https://codecov.io/gh/invenia/PkgTemplates.jl)
|
||||||
|
|
||||||
**PkgTemplates is a Julia package for creating new Julia packages in an easy,
|
**PkgTemplates creates new Julia packages in an easy, repeatable, and customizable way.**
|
||||||
repeatable, and customizable way.**
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```julia
|
|
||||||
pkg> add PkgTemplates
|
|
||||||
```
|
|
||||||
|
|
||||||
## Plugins
|
|
||||||
|
|
||||||
`PkgTemplates` is based on plugins which handle the setup of individual package components.
|
|
||||||
The available plugins are:
|
|
||||||
|
|
||||||
* Continuous Integration (CI)
|
|
||||||
* [Travis CI](https://travis-ci.com) (Linux, MacOS)
|
|
||||||
* [AppVeyor](https://appveyor.com) (Windows)
|
|
||||||
* [GitLabCI](https://gitlab.com) (Linux)
|
|
||||||
* [CirrusCI](https://cirrus-ci.org) (FreeBSD)
|
|
||||||
* Code Coverage
|
|
||||||
* [Codecov](https://codecov.io)
|
|
||||||
* [Coveralls](https://coveralls.io)
|
|
||||||
* Documentation
|
|
||||||
* [GitHubPages](https://pages.github.com)
|
|
||||||
* Citation
|
|
||||||
|
|
||||||
## Usage
|
## 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:
|
Assuming you have the relatively standard Git options `user.name`, `user.email` and `github.user` set up globally with `git config --global`, creating a `Template` is as simple as:
|
||||||
|
|
||||||
```julia
|
```jl
|
||||||
julia> using PkgTemplates
|
using PkgTemplates
|
||||||
|
t = Template()
|
||||||
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`:
|
However, it's probably desirable to customize the template to your liking with various options and plugins:
|
||||||
|
|
||||||
```julia
|
```jl
|
||||||
julia> t = Template(;
|
t = Template(;
|
||||||
user="myusername",
|
|
||||||
license="ISC",
|
|
||||||
authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
|
|
||||||
dir="~/code",
|
dir="~/code",
|
||||||
julia_version=v"0.7",
|
ssh=true,
|
||||||
|
manifest=true,
|
||||||
plugins=[
|
plugins=[
|
||||||
TravisCI(),
|
|
||||||
Codecov(),
|
Codecov(),
|
||||||
Coveralls(),
|
TravisCI(; x86=true),
|
||||||
AppVeyor(),
|
Documenter{TravisCI}(),
|
||||||
GitHubPages(),
|
|
||||||
CirrusCI(),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
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
|
Once you have a `Template`, yoy can createa packages with ease:
|
||||||
[documentation](https://invenia.github.io/PkgTemplates.jl/stable).
|
|
||||||
|
|
||||||
If that looks like a lot of work, you can also create templates interactively
|
```jl
|
||||||
with `interactive_template`:
|
t("MyPkg")
|
||||||
|
```
|
||||||
|
|
||||||
[](https://asciinema.org/a/31bZqW9u8h5RHpd7gtsemioRV)
|
---
|
||||||
|
|
||||||
And if that's **still** too much work for you, you can call
|
For a much more detailled overview, please see the documentation.
|
||||||
`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.
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
It's extremely easy to extend `PkgTemplates` with new plugins. To get started,
|
|
||||||
check out the
|
|
||||||
[plugin development guide](https://invenia.github.io/PkgTemplates.jl/stable/pages/plugin_development.html).
|
|
||||||
|
@ -21,6 +21,9 @@ PT.user_view(::BasicTest, ::Template, ::AbstractString) = Dict("X" => 1, "Z" =>
|
|||||||
pkg_dir = joinpath(t.dir, pkg)
|
pkg_dir = joinpath(t.dir, pkg)
|
||||||
badge = string(PT.Badge("1", "2", "3"))
|
badge = string(PT.Badge("1", "2", "3"))
|
||||||
@test occursin(badge, read(joinpath(pkg_dir, "README.md"), String))
|
@test occursin(badge, read(joinpath(pkg_dir, "README.md"), String))
|
||||||
@test read(joinpath(pkg_dir, "foo.txt"), String) == s
|
observed = read(joinpath(pkg_dir, "foo.txt"), String)
|
||||||
|
# On Travis, everything works with CRLF.
|
||||||
|
Sys.iswindows() && (observed = replace(observed, "\r\n" => "\n"))
|
||||||
|
@test observed == s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user