Delete old docs, update build
This commit is contained in:
parent
5adde3ad7c
commit
e7a51c909a
@ -1,10 +1,10 @@
|
|||||||
using {{PKG}}
|
using {{PKG}}
|
||||||
using Documenter
|
using Documenter
|
||||||
|
|
||||||
makedocs(
|
makedocs(;
|
||||||
modules=[{{PKG}}],
|
modules=[{{PKG}}],
|
||||||
authors="{{AUTHORS}}",
|
authors="{{AUTHORS}}",
|
||||||
repo="{{REPO}}",
|
repo="https://{{REPO}}/blob/{commit}{path}#L{line}",
|
||||||
sitename="{{PKG}}.jl",
|
sitename="{{PKG}}.jl",
|
||||||
format=Documenter.HTML(;
|
format=Documenter.HTML(;
|
||||||
canonical="{{CANONICAL}}",
|
canonical="{{CANONICAL}}",
|
||||||
|
22
docs/make.jl
22
docs/make.jl
@ -1,20 +1,18 @@
|
|||||||
using Documenter, PkgTemplates
|
using Documenter
|
||||||
|
using PkgTemplates
|
||||||
|
|
||||||
makedocs(;
|
makedocs(;
|
||||||
modules=[PkgTemplates],
|
modules=[PkgTemplates],
|
||||||
format=Documenter.HTML(),
|
authors="Chris de Graaf, Invenia Technical Computing Corporation",
|
||||||
pages=[
|
|
||||||
"Home" => "index.md",
|
|
||||||
"Package Generation" => "pages/package_generation.md",
|
|
||||||
"Plugins" => "pages/plugins.md",
|
|
||||||
"Plugin Development" => "pages/plugin_development.md",
|
|
||||||
"Licenses" => "pages/licenses.md",
|
|
||||||
"Index" => "pages/index.md",
|
|
||||||
],
|
|
||||||
repo="https://github.com/invenia/PkgTemplates.jl/blob/{commit}{path}#L{line}",
|
repo="https://github.com/invenia/PkgTemplates.jl/blob/{commit}{path}#L{line}",
|
||||||
sitename="PkgTemplates.jl",
|
sitename="PkgTemplates.jl",
|
||||||
authors="Chris de Graaf, Invenia Technical Computing Corporation",
|
format=Documenter.HTML(;
|
||||||
assets=[],
|
canonical="https://invenia.github.io/PkgTemplates.jl",
|
||||||
|
assets=String[],
|
||||||
|
),
|
||||||
|
pages=[
|
||||||
|
"Home" => "index.md",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
deploydocs(;
|
deploydocs(;
|
||||||
|
@ -1,105 +1,8 @@
|
|||||||
# PkgTemplates
|
# PkgTemplates
|
||||||
|
|
||||||
[](https://invenia.github.io/PkgTemplates.jl/stable)
|
```@index
|
||||||
[](https://invenia.github.io/PkgTemplates.jl/latest)
|
|
||||||
[](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)
|
|
||||||
|
|
||||||
**PkgTemplates is a Julia package for creating new Julia packages in an easy,
|
|
||||||
repeatable, and customizable way.**
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```julia
|
|
||||||
pkg> add PkgTemplates
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Plugins
|
```@autodocs
|
||||||
|
Modules = [PkgTemplates]
|
||||||
`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
|
|
||||||
|
|
||||||
```@setup usage
|
|
||||||
using LibGit2: getconfig
|
|
||||||
isempty(getconfig("user.name", "")) && run(`git config --global user.name "Travis"`)
|
|
||||||
isempty(getconfig("user.email", "")) && run(`git config --global user.email "travis@c.i"`)
|
|
||||||
isempty(getconfig("github.user", "")) && run(`git config --global github.user "travis"`)
|
|
||||||
using Pkg
|
|
||||||
Pkg.activate(mktempdir())
|
|
||||||
# This code gets run in docs/build/, so this path evaluates to the repo root.
|
|
||||||
Pkg.add(PackageSpec(path=dirname(dirname(pwd()))))
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
|
|
||||||
```@repl usage
|
|
||||||
using PkgTemplates
|
|
||||||
t = Template()
|
|
||||||
generate("MyPkg", t)
|
|
||||||
run(`git -C $(joinpath(t.dir, "MyPkg")) ls-files`);
|
|
||||||
```
|
|
||||||
|
|
||||||
However, we can also configure a number of keyword arguments to
|
|
||||||
[`Template`](@ref):
|
|
||||||
|
|
||||||
```@repl usage
|
|
||||||
using PkgTemplates
|
|
||||||
t = Template(;
|
|
||||||
user="myusername",
|
|
||||||
license="MIT",
|
|
||||||
authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
|
|
||||||
dir="~/code",
|
|
||||||
julia_version=v"0.7",
|
|
||||||
ssh=true,
|
|
||||||
plugins=[
|
|
||||||
TravisCI(),
|
|
||||||
Codecov(),
|
|
||||||
Coveralls(),
|
|
||||||
AppVeyor(),
|
|
||||||
Documenter{TravisCI}(),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
generate("MyPkg2", t)
|
|
||||||
run(`git -C $(joinpath(t.dir, "MyPkg2")) ls-files`);
|
|
||||||
```
|
|
||||||
|
|
||||||
If that looks like a lot of work, you can also create templates interactively
|
|
||||||
with [`interactive_template`](@ref):
|
|
||||||
|
|
||||||
[](https://asciinema.org/a/31bZqW9u8h5RHpd7gtsemioRV)
|
|
||||||
|
|
||||||
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`](@ref) 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`](https://github.com/JuliaLang/PkgDev.jl)'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](https://github.com/apps/attobot) instead.
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
It's extremely easy to extend `PkgTemplates` with new plugins. To get started,
|
|
||||||
check out [Plugin Development](@ref).
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
# Index
|
|
||||||
|
|
||||||
```@index
|
|
||||||
```
|
|
@ -1,14 +0,0 @@
|
|||||||
```@meta
|
|
||||||
CurrentModule = PkgTemplates
|
|
||||||
```
|
|
||||||
|
|
||||||
# Licenses
|
|
||||||
|
|
||||||
[Many open-source licenses](https://github.com/invenia/PkgTemplates.jl/tree/master/licenses)
|
|
||||||
are available for use with `PkgTemplates`, but if you see that one is missing, don't
|
|
||||||
hesitate to open an issue or PR.
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
available_licenses
|
|
||||||
show_license
|
|
||||||
```
|
|
@ -1,15 +0,0 @@
|
|||||||
```@meta
|
|
||||||
CurrentModule = PkgTemplates
|
|
||||||
```
|
|
||||||
|
|
||||||
# Package Generation
|
|
||||||
|
|
||||||
Creating new packages with `PkgTemplates` revolves around creating a new
|
|
||||||
[`Template`](@ref), then calling [`generate`](@ref) on it.
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
Template
|
|
||||||
interactive_template
|
|
||||||
generate
|
|
||||||
generate_interactive
|
|
||||||
```
|
|
@ -1,72 +0,0 @@
|
|||||||
```@meta
|
|
||||||
CurrentModule = PkgTemplates
|
|
||||||
```
|
|
||||||
|
|
||||||
# Plugin Development
|
|
||||||
|
|
||||||
The best and easiest way to contribute to `PkgTemplates` is to write new plugins.
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
Plugin
|
|
||||||
```
|
|
||||||
|
|
||||||
## "Generic" Plugins
|
|
||||||
|
|
||||||
Many plugins fall into the category of managing some configuration file.
|
|
||||||
Think Travis CI's `.travis.yml`, and so on for every CI service ever.
|
|
||||||
For these one-file plugins, a shortcut macro is available to define a plugin in one line.
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
GeneratedPlugin
|
|
||||||
@plugin
|
|
||||||
```
|
|
||||||
|
|
||||||
### `GeneratedPlugin` Customization
|
|
||||||
|
|
||||||
When you generate a plugin type with [`@plugin`](@ref), all required methods are
|
|
||||||
implemented for you. However, you're still allowed to override behaviour if you so desire.
|
|
||||||
These are the relevant methods:
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
source
|
|
||||||
destination
|
|
||||||
gitignore
|
|
||||||
badges
|
|
||||||
view
|
|
||||||
```
|
|
||||||
|
|
||||||
For some examples, see
|
|
||||||
[`generated.jl`](https://github.com/invenia/PkgTemplates.jl/tree/master/src/plugins/generated.jl).
|
|
||||||
|
|
||||||
## Custom Plugins
|
|
||||||
|
|
||||||
When a plugin is too complicated to be expressed with [`GeneratedPlugin`](@ref), we only
|
|
||||||
need to implement a few methods to create something fully custom.
|
|
||||||
|
|
||||||
### Required Methods
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
gen_plugin
|
|
||||||
```
|
|
||||||
|
|
||||||
### Optional Methods
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
interactive
|
|
||||||
```
|
|
||||||
|
|
||||||
Additionally, [`gitignore`](@ref), [`badges`](@ref), and [`view`](@ref) can also be
|
|
||||||
implemented in the same way as for [`GeneratedPlugin`](@ref)s (they have empty default
|
|
||||||
implementations). [`source`](@ref) and [`destination`](@ref) have no meaning for custom
|
|
||||||
plugins.
|
|
||||||
|
|
||||||
### Helpers
|
|
||||||
|
|
||||||
These types and functions will make implementing the above methods much easier.
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
Badge
|
|
||||||
gen_file
|
|
||||||
substitute
|
|
||||||
version_floor
|
|
||||||
```
|
|
@ -1,31 +0,0 @@
|
|||||||
```@meta
|
|
||||||
CurrentModule = PkgTemplates
|
|
||||||
```
|
|
||||||
|
|
||||||
# Plugins
|
|
||||||
|
|
||||||
Plugins are the secret sauce behind `PkgTemplates`'s customization and extension. This page
|
|
||||||
describes plugins that already exist; for information on writing your own plugins, see
|
|
||||||
[Plugin Development](@ref).
|
|
||||||
|
|
||||||
## Continuous Integration (CI)
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
TravisCI
|
|
||||||
AppVeyor
|
|
||||||
GitLabCI
|
|
||||||
CirrusCI
|
|
||||||
```
|
|
||||||
|
|
||||||
## Code Coverage
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
Codecov
|
|
||||||
Coveralls
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
```@docs
|
|
||||||
Documenter
|
|
||||||
```
|
|
@ -73,7 +73,7 @@ view(p::Documenter, t::Template, pkg::AbstractString) = Dict(
|
|||||||
"HAS_ASSETS" => !isempty(p.assets),
|
"HAS_ASSETS" => !isempty(p.assets),
|
||||||
"MAKEDOCS_KWARGS" => map((k, v) -> k => repr(v), collect(p.makedocs_kwargs)),
|
"MAKEDOCS_KWARGS" => map((k, v) -> k => repr(v), collect(p.makedocs_kwargs)),
|
||||||
"PKG" => pkg,
|
"PKG" => pkg,
|
||||||
"REPO" => "https://$(t.host)/$(t.user)/$pkg.jl",
|
"REPO" => "$(t.host)/$(t.user)/$pkg.jl",
|
||||||
"USER" => t.user,
|
"USER" => t.user,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user