diff --git a/latest/index.html b/latest/index.html index 126cbf3..556e6d4 100644 --- a/latest/index.html +++ b/latest/index.html @@ -4,7 +4,7 @@ julia> t = Template(; user="myusername"); julia> generate("MyPkg", t) -INFO: Initialized git repo at /tmp/tmpHdlfLn/MyPkg +INFO: Initialized git repo at /tmp/tmpO6mUcx/MyPkg INFO: Made empty initial commit INFO: Set remote origin to https://github.com/myusername/MyPkg.jl INFO: Staged 6 files/directories: src/, test/, REQUIRE, README.md, .gitignore, LICENSE @@ -39,7 +39,7 @@ julia> t = Template(; ); julia> generate("MyPkg", t; force=true, ssh=true) -INFO: Initialized git repo at /tmp/tmps07J0G/MyPkg +INFO: Initialized git repo at /tmp/tmpMisKBi/MyPkg INFO: Applied git configuration INFO: Made empty initial commit INFO: Set remote origin to git@github.com:myusername/MyPkg.jl.git diff --git a/latest/pages/licenses.html b/latest/pages/licenses.html index 6e11bea..1516139 100644 --- a/latest/pages/licenses.html +++ b/latest/pages/licenses.html @@ -1,2 +1,2 @@ -Licenses · PkgTemplates.jl

Licenses

Licenses

Many open-source licenses are available for use with PkgTemplates, but if you see that one is missing, don't hesitate to open an issue or PR.

available_licenses([io::IO]) -> Void

Print the names of all available licenses.

source
show_license([io::IO], license::AbstractString) -> Void

Print the text of license. Errors if the license is not found.

source

Helper Functions

read_license(license::AbstractString) -> String

Returns the contents of license. Errors if the license is not found. Use available_licenses to view available licenses.

source
+Licenses · PkgTemplates.jl

Licenses

Licenses

Many open-source licenses are available for use with PkgTemplates, but if you see that one is missing, don't hesitate to open an issue or PR.

available_licenses([io::IO]) -> Void

Print the names of all available licenses.

source
show_license([io::IO], license::AbstractString) -> Void

Print the text of license. Errors if the license is not found.

source

Helper Functions

read_license(license::AbstractString) -> String

Returns the contents of license. Errors if the license is not found. Use available_licenses to view available licenses.

source
diff --git a/latest/pages/package_generation.html b/latest/pages/package_generation.html index 1348d73..e40a5ee 100644 --- a/latest/pages/package_generation.html +++ b/latest/pages/package_generation.html @@ -1,38 +1,38 @@ -Package Generation · PkgTemplates.jl

Package Generation

Package Generation

Creating new packages with PkgTemplates revolves around creating a new Template, then calling generate on it.

Template

Template(; kwargs...) -> Template

Records common information used to generate a package. If you don't wish to manually create a template, you can use interactive_template instead.

Keyword Arguments

  • user::AbstractString="": GitHub username. If left unset, it will try to take the value of a supplied git config's "github.user" key, then the global git config's value. If neither is set, an ArgumentError is thrown. This is case-sensitive for some plugins, so take care to enter it correctly.

  • host::AbstractString="github.com": URL to the code hosting service where your package will reside. Note that while hosts other than GitHub won't cause errors, they are not officially supported and they will cause certain plugins will produce incorrect output. For example, AppVeyor's badge image will point to a GitHub-specific URL, regardless of the value of host.

  • license::AbstractString="MIT": Name of the package license. If an empty string is given, no license is created. available_licenses can be used to list all available licenses, and show_license can be used to print out a particular license's text.

  • authors::Union{AbstractString, Vector{<:AbstractString}}="": Names that appear on the license. Supply a string for one author or an array for multiple. Similarly to user, it will try to take the value of a supplied git config's "user.name" key, then the global git config's value, if it is left unset.

  • years::Union{Integer, AbstractString}=Dates.year(Dates.today()): Copyright years on the license. Can be supplied by a number, or a string such as "2016 - 2017".

  • dir::AbstractString=Pkg.dir(): Directory in which the package will go. Relative paths are converted to absolute ones at template creation time.

  • precompile::Bool=true: Whether or not to enable precompilation in generated packages.

  • julia_version::VersionNumber=VERSION: Minimum allowed Julia version.

  • requirements::Vector{<:AbstractString}=String[]: Package requirements. If there are duplicate requirements with different versions, i.e. ["PkgTemplates", "PkgTemplates 0.1"], an ArgumentError is thrown. Each entry in this array will be copied into the REQUIRE file of packages generated with this template.

  • gitconfig::Dict=Dict(): Git configuration options.

  • plugins::Vector{<:Plugin}=Plugin[]: A list of Plugins that the package will include.

source
interactive_template(; fast::Bool=false) -> Template

Interactively create a Template. If fast is set, defaults will be assumed for all values except username and plugins.

source

generate

PkgTemplates.generateFunction.
generate(
+Package Generation · PkgTemplates.jl

Package Generation

Package Generation

Creating new packages with PkgTemplates revolves around creating a new Template, then calling generate on it.

Template

Template(; kwargs...) -> Template

Records common information used to generate a package. If you don't wish to manually create a template, you can use interactive_template instead.

Keyword Arguments

  • user::AbstractString="": GitHub username. If left unset, it will try to take the value of a supplied git config's "github.user" key, then the global git config's value. If neither is set, an ArgumentError is thrown. This is case-sensitive for some plugins, so take care to enter it correctly.

  • host::AbstractString="github.com": URL to the code hosting service where your package will reside. Note that while hosts other than GitHub won't cause errors, they are not officially supported and they will cause certain plugins will produce incorrect output. For example, AppVeyor's badge image will point to a GitHub-specific URL, regardless of the value of host.

  • license::AbstractString="MIT": Name of the package license. If an empty string is given, no license is created. available_licenses can be used to list all available licenses, and show_license can be used to print out a particular license's text.

  • authors::Union{AbstractString, Vector{<:AbstractString}}="": Names that appear on the license. Supply a string for one author or an array for multiple. Similarly to user, it will try to take the value of a supplied git config's "user.name" key, then the global git config's value, if it is left unset.

  • years::Union{Integer, AbstractString}=Dates.year(Dates.today()): Copyright years on the license. Can be supplied by a number, or a string such as "2016 - 2017".

  • dir::AbstractString=Pkg.dir(): Directory in which the package will go. Relative paths are converted to absolute ones at template creation time.

  • precompile::Bool=true: Whether or not to enable precompilation in generated packages.

  • julia_version::VersionNumber=VERSION: Minimum allowed Julia version.

  • requirements::Vector{<:AbstractString}=String[]: Package requirements. If there are duplicate requirements with different versions, i.e. ["PkgTemplates", "PkgTemplates 0.1"], an ArgumentError is thrown. Each entry in this array will be copied into the REQUIRE file of packages generated with this template.

  • gitconfig::Dict=Dict(): Git configuration options.

  • plugins::Vector{<:Plugin}=Plugin[]: A list of Plugins that the package will include.

source
interactive_template(; fast::Bool=false) -> Template

Interactively create a Template. If fast is set, defaults will be assumed for all values except username and plugins.

source

generate

PkgTemplates.generateFunction.
generate(
     pkg_name::AbstractString,
     t::Template;
     force::Bool=false,
     ssh::Bool=false,
     backup_dir::AbstractString="",
-) -> Void

Generate a package named pkg_name from template.

Keyword Arguments

  • force::Bool=false: Whether or not to overwrite old packages with the same name.

  • ssh::Bool=false: Whether or not to use SSH for the remote.

  • backup_dir::AbstractString="": Directory in which to store the generated package if t.dir is not a valid directory. If left unset, a temporary directory will be created (this keyword is mostly for internal usage).

Notes

The package is generated entirely in a temporary directory and only moved into joinpath(t.dir, pkg_name) at the very end. In the case of an error, the temporary directory will contain leftovers, but the destination directory will remain untouched (this is especially helpful when force=true).

source
generate_interactive(
+) -> Void

Generate a package named pkg_name from template.

Keyword Arguments

  • force::Bool=false: Whether or not to overwrite old packages with the same name.

  • ssh::Bool=false: Whether or not to use SSH for the remote.

  • backup_dir::AbstractString="": Directory in which to store the generated package if t.dir is not a valid directory. If left unset, a temporary directory will be created (this keyword is mostly for internal usage).

Notes

The package is generated entirely in a temporary directory and only moved into joinpath(t.dir, pkg_name) at the very end. In the case of an error, the temporary directory will contain leftovers, but the destination directory will remain untouched (this is especially helpful when force=true).

source
generate_interactive(
     pkg_name::AbstractString;
     force::Bool=false,
     ssh::Bool=false,
     backup_dir::AbstractString="",
     fast::Bool=false,
-) -> Void

Interactively create a template, and then generate a package with it. Arguments and keywords are used in the same way as in generate and interactive_template.

source

Helper Functions

gen_entrypoint(
+) -> Void

Interactively create a template, and then generate a package with it. Arguments and keywords are used in the same way as in generate and interactive_template.

source

Helper Functions

gen_entrypoint(
     dir::AbstractString,
     pkg_name::AbstractString,
     template::Template,
-) -> Vector{String}

Create the module entrypoint in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose entrypoint we are generating.

Returns an array of generated file/directory names.

source
gen_tests(
+) -> Vector{String}

Create the module entrypoint in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose entrypoint we are generating.

Returns an array of generated file/directory names.

source
gen_tests(
     dir::AbstractString,
     pkg_name::AbstractString,
     template::Template,
-) -> Vector{String}

Create the test directory and entrypoint in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose tests we are generating.

Returns an array of generated file/directory names.

source
gen_require(
+) -> Vector{String}

Create the test directory and entrypoint in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose tests we are generating.

Returns an array of generated file/directory names.

source
gen_require(
     dir::AbstractString,
     pkg_name::AbstractString,
     template::Template,
-) -> Vector{String}

Create the REQUIRE file in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose REQUIRE we are generating.

Returns an array of generated file/directory names.

source
gen_readme(
+) -> Vector{String}

Create the REQUIRE file in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose REQUIRE we are generating.

Returns an array of generated file/directory names.

source
gen_readme(
     dir::AbstractString,
     pkg_name::AbstractString,
     template::Template,
-) -> Vector{String}

Create a README in the temp package directory with badges for each enabled plugin.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose README we are generating.

Returns an array of generated file/directory names.

source
gen_gitignore(
+) -> Vector{String}

Create a README in the temp package directory with badges for each enabled plugin.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose README we are generating.

Returns an array of generated file/directory names.

source
gen_gitignore(
     dir::AbstractString,
     pkg_name::AbstractString,
     template::Template,
-) -> Vector{String}

Create a .gitignore in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose .gitignore we are generating.

Returns an array of generated file/directory names.

source
gen_license(
+) -> Vector{String}

Create a .gitignore in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose .gitignore we are generating.

Returns an array of generated file/directory names.

source
gen_license(
     dir::AbstractString,
     pkg_name::AbstractString,
     template::Template,
-) -> Vector{String}

Create a license in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose LICENSE we are generating.

Returns an array of generated file/directory names.

source
+) -> Vector{String}

Create a license in the temp package directory.

Arguments

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

  • template::Template: The template whose LICENSE we are generating.

Returns an array of generated file/directory names.

source
diff --git a/latest/pages/plugin_development.html b/latest/pages/plugin_development.html index affdc39..bbb5eb6 100644 --- a/latest/pages/plugin_development.html +++ b/latest/pages/plugin_development.html @@ -1,5 +1,5 @@ -Plugin Development · PkgTemplates.jl

Plugin Development

Plugin Development

The best and easiest way to contribute to PkgTemplates is to write new plugins.

A plugin to be added to a Template, which adds some functionality or integration. New plugins should almost always extend GenericPlugin or CustomPlugin.

source

Generic Plugins

Generic plugins are plugins that add any number of patterns to the generated package's .gitignore, and have at most one associated file to generate.

Attributes

  • gitignore::Vector{AbstractString}: Array of patterns to be added to the .gitignore of generated packages that use this plugin.

  • src::Nullable{AbstractString}: Path to the file that will be copied into the generated package repository. If set to nothing, no file will be generated. When this defaults to an empty string, there should be a default file in defaults that will be copied. That file's name is usually the same as the plugin's name, except in all lowercase and with the .yml extension. If this is not the case, an interactive method needs to be implemented to call interactive(; file="file.ext").

  • dest::AbstractString: Path to the generated file, relative to the root of the generated package repository.

  • badges::Vector{Badge}: Array of Badges containing information used to create Markdown-formatted badges from the plugin. Entries will be run through substitute, so they may contain placeholder values.

  • view::Dict{String, Any}: Additional substitutions to make in both the plugin's badges and its associated file. See substitute for details.

Example

@auto_hash_equals struct MyPlugin <: GenericPlugin
+Plugin Development · PkgTemplates.jl

Plugin Development

Plugin Development

The best and easiest way to contribute to PkgTemplates is to write new plugins.

A plugin to be added to a Template, which adds some functionality or integration. New plugins should almost always extend GenericPlugin or CustomPlugin.

source

Generic Plugins

Generic plugins are plugins that add any number of patterns to the generated package's .gitignore, and have at most one associated file to generate.

Attributes

  • gitignore::Vector{AbstractString}: Array of patterns to be added to the .gitignore of generated packages that use this plugin.

  • src::Nullable{AbstractString}: Path to the file that will be copied into the generated package repository. If set to nothing, no file will be generated. When this defaults to an empty string, there should be a default file in defaults that will be copied. That file's name is usually the same as the plugin's name, except in all lowercase and with the .yml extension. If this is not the case, an interactive method needs to be implemented to call interactive(; file="file.ext").

  • dest::AbstractString: Path to the generated file, relative to the root of the generated package repository.

  • badges::Vector{Badge}: Array of Badges containing information used to create Markdown-formatted badges from the plugin. Entries will be run through substitute, so they may contain placeholder values.

  • view::Dict{String, Any}: Additional substitutions to make in both the plugin's badges and its associated file. See substitute for details.

Example

@auto_hash_equals struct MyPlugin <: GenericPlugin
     gitignore::Vector{AbstractString}
     src::Nullable{AbstractString}
     dest::AbstractString
@@ -34,7 +34,7 @@
     end
 end
 
-interactive(plugin_type::Type{MyPlugin}) = interactive(plugin_type; file="my-plugin.toml")

The above plugin ignores files ending with .mgp, copies defaults/my-plugin.toml by default, and creates a badge that links to the project on its own site, using the default substitutions with one addition: {{YEAR}} => Dates.year(Dates.today()). Since the default config template file doesn't follow the generic naming convention, we added another interactive method to correct the assumed filename.

source

Custom Plugins

Custom plugins are plugins whose behaviour does not follow the GenericPlugin pattern. They can implement gen_plugin, badges, and interactive in any way they choose.

Attributes

  • gitignore::Vector{AbstractString}: Array of patterns to be added to the .gitignore of generated packages that use this plugin.

Example

@auto_hash_equals struct MyPlugin <: CustomPlugin
+interactive(plugin_type::Type{MyPlugin}) = interactive(plugin_type; file="my-plugin.toml")

The above plugin ignores files ending with .mgp, copies defaults/my-plugin.toml by default, and creates a badge that links to the project on its own site, using the default substitutions with one addition: {{YEAR}} => Dates.year(Dates.today()). Since the default config template file doesn't follow the generic naming convention, we added another interactive method to correct the assumed filename.

source

Custom Plugins

Custom plugins are plugins whose behaviour does not follow the GenericPlugin pattern. They can implement gen_plugin, badges, and interactive in any way they choose.

Attributes

  • gitignore::Vector{AbstractString}: Array of patterns to be added to the .gitignore of generated packages that use this plugin.

Example

@auto_hash_equals struct MyPlugin <: CustomPlugin
     gitignore::Vector{AbstractString}
     lucky::Bool
 
@@ -76,16 +76,17 @@ interactive(plugin_type::Type{MyPlugin}) = interactive(plugin_type; file="m
     end
 end
 
-interactive(plugin_type::Type{MyPlugin}) = MyPlugin()

This plugin doesn't do much, but it demonstrates how gen_plugin, badges and interactive can be implemented using substitute, gen_file, Badge, and format.

Defining Template Files

Often, the contents of the config file that your plugin generates depends on variables like the package name, the user's username, etc. Template files (which are stored in defaults) can use here's syntax to define replacements.

Note: Due to a bug in Mustache, conditionals can insert undesired newlines (more detail here).

source

CustomPlugin Required Methods

gen_plugin

gen_plugin(
+interactive(plugin_type::Type{MyPlugin}) = MyPlugin()

This plugin doesn't do much, but it demonstrates how gen_plugin, badges and interactive can be implemented using substitute, gen_file, Badge, and format.

Defining Template Files

Often, the contents of the config file that your plugin generates depends on variables like the package name, the user's username, etc. Template files (which are stored in defaults) can use here's syntax to define replacements.

Note: Due to a bug in Mustache, conditionals can insert undesired newlines (more detail here).

source

CustomPlugin Required Methods

gen_plugin

gen_plugin(
     plugin::Plugin,
     template::Template,
     dir::AbstractString,
     pkg_name::AbstractString
-) -> Vector{String}

Generate any files associated with a plugin.

Arguments

  • plugin::Plugin: Plugin whose files are being generated.

  • template::Template: Template configuration.

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

Returns an array of generated file/directory names.

source
interactive(
+) -> Vector{String}

Generate any files associated with a plugin.

Arguments

  • plugin::Plugin: Plugin whose files are being generated.

  • template::Template: Template configuration.

  • dir::AbstractString: The directory in which the files will be generated. Note that this will be joined to pkg_name.

  • pkg_name::AbstractString: Name of the package.

Returns an array of generated file/directory names.

source
interactive(
     plugin_type::Type{<:Plugin};
     file::Union{AbstractString, Void}="",
-) -> Plugin

Interactively create a plugin of type plugin_type, where file is the plugin type's default config template with a non-standard name (for MyPlugin, this is anything but "myplugin.yml").

source

Note: interactive is not strictly required, however without it, your custom plugin will not be available when creating templates with interactive_template.

badges

PkgTemplates.badgesFunction.
badges(plugin::Plugin, user::AbstractString, pkg_name::AbstractString) -> Vector{String}

Generate Markdown badges for the plugin.

Arguments

  • plugin::Plugin: Plugin whose badges we are generating.

  • user::AbstractString: Username of the package creator.

  • pkg_name::AbstractString: Name of the package.

Returns an array of Markdown badges.

source

Helper Types/Functions

gen_file

PkgTemplates.gen_fileFunction.
gen_file(file_path::AbstractString, text::AbstractString) -> Int

Create a new file containing some given text. Always ends the file with a newline.

Arguments

  • file::AbstractString: Path to the file to be created.

  • text::AbstractString: Text to write to the file.

Returns the number of bytes written to the file.

source

substitute

substitute(template::AbstractString, view::Dict{String, Any}) -> String

Replace placeholders in template with values in view via Mustache. template is not modified.

For information on how to structure template, see "Defining Template Files" section in Custom Plugins.

Note: Conditionals in template without a corresponding key in view won't error, but will simply be evaluated as false.

source
substitute(
+) -> Plugin

Interactively create a plugin of type plugin_type, where file is the plugin type's default config template with a non-standard name (for MyPlugin, this is anything but "myplugin.yml").

source

Note: interactive is not strictly required, however without it, your custom plugin will not be available when creating templates with interactive_template.

badges

PkgTemplates.badgesFunction.
badges(plugin::Plugin, user::AbstractString, pkg_name::AbstractString) -> Vector{String}

Generate Markdown badges for the plugin.

Arguments

  • plugin::Plugin: Plugin whose badges we are generating.

  • user::AbstractString: Username of the package creator.

  • pkg_name::AbstractString: Name of the package.

Returns an array of Markdown badges.

source

Helper Types/Functions

gen_file

PkgTemplates.gen_fileFunction.
gen_file(file_path::AbstractString, text::AbstractString) -> Int

Create a new file containing some given text. Always ends the file with a newline.

Arguments

  • file::AbstractString: Path to the file to be created.

  • text::AbstractString: Text to write to the file.

Returns the number of bytes written to the file.

source

substitute

substitute(template::AbstractString, view::Dict{String, Any}) -> String
+substitute(
     template::AbstractString,
     pkg_template::Template;
     view::Dict{String, Any}=Dict{String, Any}(),
-) -> String

Replace placeholders in template, using some default replacements based on the pkg_template and additional ones in view. template is not modified.

source

Badge

Badge(hover::AbstractString, image::AbstractString, link::AbstractString) -> Badge

A Badge contains the data necessary to generate a Markdown badge.

Arguments

  • hover::AbstractString: Text to appear when the mouse is hovered over the badge.

  • image::AbstractString: URL to the image to display.

  • link::AbstractString: URL to go to upon clicking the badge.

source

format

PkgTemplates.formatFunction.
format(b::Badge)

Return badge's data formatted as a Markdown string.

source

version_floor

version_floor(v::VersionNumber=VERSION) -> String

Format the given Julia version.

Keyword arguments

  • v::VersionNumber=VERSION: Version to floor.

Returns "major.minor" for the most recent release version relative to v. For prereleases with v.minor == v.patch == 0, returns "major.minor-".

source
+) -> String

Replace placeholders in template with values in view via Mustache. template is not modified. If pkg_template is supplied, some default replacements are also performed.

For information on how to structure template, see "Defining Template Files" section in Custom Plugins.

Note: Conditionals in template without a corresponding key in view won't error, but will simply be evaluated as false.

source

Badge

Badge(hover::AbstractString, image::AbstractString, link::AbstractString) -> Badge

A Badge contains the data necessary to generate a Markdown badge.

Arguments

  • hover::AbstractString: Text to appear when the mouse is hovered over the badge.

  • image::AbstractString: URL to the image to display.

  • link::AbstractString: URL to go to upon clicking the badge.

source

format

PkgTemplates.formatFunction.
format(b::Badge)

Return badge's data formatted as a Markdown string.

source

version_floor

version_floor(v::VersionNumber=VERSION) -> String

Format the given Julia version.

Keyword arguments

  • v::VersionNumber=VERSION: Version to floor.

Returns "major.minor" for the most recent release version relative to v. For prereleases with v.minor == v.patch == 0, returns "major.minor-".

source
diff --git a/latest/pages/plugins.html b/latest/pages/plugins.html index 984acf2..e80aac4 100644 --- a/latest/pages/plugins.html +++ b/latest/pages/plugins.html @@ -1,2 +1,2 @@ -Plugins · PkgTemplates.jl

Plugins

Plugins

Plugins are the secret sauce behing PkgTemplates's customization and extension. This page describes plugins that already exist; for information on writing your own plugins, see Plugin Development.

Continuous Integration (CI)

TravisCI(; config_file::Union{AbstractString, Void}="") -> TravisCI

Add TravisCI to a template's plugins to add a .travis.yml configuration file to generated repositories, and an appropriate badge to the README.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}="": Path to a custom .travis.yml. If nothing is supplied, no file will be generated.

source
AppVeyor(; config_file::Union{AbstractString, Void}="") -> AppVeyor

Add AppVeyor to a template's plugins to add a .appveyor.yml configuration file to generated repositories, and an appropriate badge to the README.

Keyword Arguments

  • config_file::Union{AbstractString, Void}="": Path to a custom .appveyor.yml. If nothing is supplied, no file will be generated.

source
GitLabCI(; config_file::Union{AbstractString, Void}="", coverage::Bool=true) -> GitLabCI

Add GitLabCI to a template's plugins to add a .gitlab-ci.yml configuration file to generated repositories, and appropriate badge(s) to the README.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}="": Path to a custom .gitlab-ci.yml. If nothing is supplied, no file will be generated.

  • coverage::Bool=true: Whether or not GitLab CI's built-in code coverage analysis should be enabled.

source

Code Coverage

CodeCov(; config_file::Union{AbstractString, Void}=nothing) -> CodeCov

Add CodeCov to a template's plugins to optionally add a .codecov.yml configuration file to generated repositories, and an appropriate badge to the README. Also updates the .gitignore accordingly.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}=nothing: Path to a custom .codecov.yml. If left unset, no file will be generated.

source
Coveralls(; config_file::Union{AbstractString, Void}=nothing) -> Coveralls

Add Coveralls to a template's plugins to optionally add a .coveralls.yml configuration file to generated repositories, and an appropriate badge to the README. Also updates the .gitignore accordingly.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}=nothing: Path to a custom .coveralls.yml. If left unset, no file will be generated.

source

Documentation

Add a Documenter subtype to a template's plugins to add support for documentation generation via Documenter.jl.

source
GitHubPages(; assets::Vector{<:AbstractString}=String[]) -> GitHubPages

Add GitHubPages to a template's plugins to add Documenter support via GitHub Pages, including automatic uploading of documentation from TravisCI. Also adds appropriate badges to the README, and updates the .gitignore accordingly.

Keyword Arguments

  • assets::Vector{<:AbstractString}=String[]: Array of paths to Documenter asset files.

source
+Plugins · PkgTemplates.jl

Plugins

Plugins

Plugins are the secret sauce behing PkgTemplates's customization and extension. This page describes plugins that already exist; for information on writing your own plugins, see Plugin Development.

Continuous Integration (CI)

TravisCI(; config_file::Union{AbstractString, Void}="") -> TravisCI

Add TravisCI to a template's plugins to add a .travis.yml configuration file to generated repositories, and an appropriate badge to the README.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}="": Path to a custom .travis.yml. If nothing is supplied, no file will be generated.

source
AppVeyor(; config_file::Union{AbstractString, Void}="") -> AppVeyor

Add AppVeyor to a template's plugins to add a .appveyor.yml configuration file to generated repositories, and an appropriate badge to the README.

Keyword Arguments

  • config_file::Union{AbstractString, Void}="": Path to a custom .appveyor.yml. If nothing is supplied, no file will be generated.

source
GitLabCI(; config_file::Union{AbstractString, Void}="", coverage::Bool=true) -> GitLabCI

Add GitLabCI to a template's plugins to add a .gitlab-ci.yml configuration file to generated repositories, and appropriate badge(s) to the README.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}="": Path to a custom .gitlab-ci.yml. If nothing is supplied, no file will be generated.

  • coverage::Bool=true: Whether or not GitLab CI's built-in code coverage analysis should be enabled.

source

Code Coverage

CodeCov(; config_file::Union{AbstractString, Void}=nothing) -> CodeCov

Add CodeCov to a template's plugins to optionally add a .codecov.yml configuration file to generated repositories, and an appropriate badge to the README. Also updates the .gitignore accordingly.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}=nothing: Path to a custom .codecov.yml. If left unset, no file will be generated.

source
Coveralls(; config_file::Union{AbstractString, Void}=nothing) -> Coveralls

Add Coveralls to a template's plugins to optionally add a .coveralls.yml configuration file to generated repositories, and an appropriate badge to the README. Also updates the .gitignore accordingly.

Keyword Arguments:

  • config_file::Union{AbstractString, Void}=nothing: Path to a custom .coveralls.yml. If left unset, no file will be generated.

source

Documentation

Add a Documenter subtype to a template's plugins to add support for documentation generation via Documenter.jl.

source
GitHubPages(; assets::Vector{<:AbstractString}=String[]) -> GitHubPages

Add GitHubPages to a template's plugins to add Documenter support via GitHub Pages, including automatic uploading of documentation from TravisCI. Also adds appropriate badges to the README, and updates the .gitignore accordingly.

Keyword Arguments

  • assets::Vector{<:AbstractString}=String[]: Array of paths to Documenter asset files.

source
diff --git a/latest/search_index.js b/latest/search_index.js index 790ea2d..75fd35a 100644 --- a/latest/search_index.js +++ b/latest/search_index.js @@ -389,7 +389,7 @@ var documenterSearchIndex = {"docs": [ "page": "Plugin Development", "title": "PkgTemplates.substitute", "category": "Function", - "text": "substitute(template::AbstractString, view::Dict{String, Any}) -> String\n\nReplace placeholders in template with values in view via Mustache. template is not modified.\n\nFor information on how to structure template, see \"Defining Template Files\" section in Custom Plugins.\n\nNote: Conditionals in template without a corresponding key in view won't error, but will simply be evaluated as false.\n\n\n\nsubstitute(\n template::AbstractString,\n pkg_template::Template;\n view::Dict{String, Any}=Dict{String, Any}(),\n) -> String\n\nReplace placeholders in template, using some default replacements based on the pkg_template and additional ones in view. template is not modified.\n\n\n\n" + "text": "substitute(template::AbstractString, view::Dict{String, Any}) -> String\nsubstitute(\n template::AbstractString,\n pkg_template::Template;\n view::Dict{String, Any}=Dict{String, Any}(),\n) -> String\n\nReplace placeholders in template with values in view via Mustache. template is not modified. If pkg_template is supplied, some default replacements are also performed.\n\nFor information on how to structure template, see \"Defining Template Files\" section in Custom Plugins.\n\nNote: Conditionals in template without a corresponding key in view won't error, but will simply be evaluated as false.\n\n\n\n" }, {