<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Package Generation · PkgTemplates.jl</title><linkhref="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css"rel="stylesheet"type="text/css"/><linkhref="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"data-main="../assets/documenter.js"></script><scriptsrc="../siteinfo.js"></script><scriptsrc="../../versions.js"></script><linkhref="../assets/documenter.css"rel="stylesheet"type="text/css"/></head><body><navclass="toc"><h1>PkgTemplates.jl</h1><selectid="version-selector"onChange="window.location.href=this.value"style="visibility: hidden"></select><formclass="search"id="search-form"action="../search.html"><inputid="search-query"name="q"type="text"placeholder="Search docs"/></form><ul><li><aclass="toctext"href="../index.html">Home</a></li><liclass="current"><aclass="toctext"href="package_generation.html">Package Generation</a><ulclass="internal"><li><aclass="toctext"href="#Template-1"><code>Template</code></a></li><li><aclass="toctext"href="#generate-1"><code>generate</code></a></li></ul></li><li><aclass="toctext"href="plugins.html">Plugins</a></li><li><aclass="toctext"href="plugin_development.html">Plugin Development</a></li><li><aclass="toctext"href="licenses.html">Licenses</a></li><li><aclass="toctext"href="index.html">Index</a></li></ul></nav><articleid="docs"><header><nav><ul><li><ahref="package_generation.html">Package Generation</a></li></ul><aclass="edit-page"href="https://github.com/invenia/PkgTemplates.jl/blob/master/docs/src/pages/package_generation.md#L"><spanclass="fa"></span> Edit on GitHub</a></nav><hr/><divid="topbar"><span>Package Generation</span><aclass="fa fa-bars"href="#"></a></div></header><h1><aclass="nav-anchor"id="Package-Generation-1"href="#Package-Generation-1">Package Generation</a></h1><p>Creating new packages with <code>PkgTemplates</code> revolves around creating a new <ahref="package_generation.html#PkgTemplates.Template"><code>Template</code></a>, then calling <ahref="package_generation.html#PkgTemplates.generate"><code>generate</code></a> on it.</p><h2><aclass="nav-anchor"id="Template-1"href="#Template-1"><code>Template</code></a></h2><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="PkgTemplates.Template"href="#PkgTemplates.Template"><code>PkgTemplates.Template</code></a> — <spanclass="docstring-category">Type</span>.</div><div><div><pre><codeclass="language-none">Template(; kwargs...) -> Template</code></pre><p>Records common information used to generate a package. If you don't wish to manually create a template, you can use <ahref="package_generation.html#PkgTemplates.interactive_template"><code>interactive_template</code></a> instead.</p><p><strong>Keyword Arguments</strong></p><ul><li><code>user::AbstractString=""</code>: GitHub (or other code hosting service) username. If left unset, it will take the the global git config's value (<code>github.user</code>). If that is not set, an <code>ArgumentError</code> is thrown. <strong>This is case-sensitive for some plugins, so take care to enter it correctly.</strong></li><li><code>host::AbstractString="github.com"</code>: 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.</li><li><code>license::AbstractString="MIT"</code>: Name of the package license. If an empty stri
generate(t::Template, pkg::AbstractString) -> Nothing</code></pre><p>Generate a package named <code>pkg</code> from <code>t</code>.</p></div></div><aclass="source-link"target="_blank"href="https://github.com/invenia/PkgTemplates.jl/blob/aa3758476a185404434420a49b966952630dc32d/src/generate.jl#LL1-L6">source</a></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="PkgTemplates.generate_interactive"href="#PkgTemplates.generate_interactive"><code>PkgTemplates.generate_interactive</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">generate_interactive(pkg::AbstractString; fast::Bool=false) -> Template</code></pre><p>Interactively create a template, and then generate a package with it. Arguments and keywords are used in the same way as in <ahref="package_generation.html#PkgTemplates.generate"><code>generate</code></a> and <ahref="package_generation.html#PkgTemplates.interactive_template"><code>interactive_template</code></a>.</p></div></div><aclass="source-link"target="_blank"href="https://github.com/invenia/PkgTemplates.jl/blob/aa3758476a185404434420a49b966952630dc32d/src/generate.jl#LL83-L89">source</a></section><h3><aclass="nav-anchor"id="Helper-Functions-1"href="#Helper-Functions-1">Helper Functions</a></h3><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="PkgTemplates.gen_tests"href="#PkgTemplates.gen_tests"><code>PkgTemplates.gen_tests</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">gen_tests(pkg_dir::AbstractString, t::Template) -> Vector{String}</code></pre><p>Create the test entrypoint in <code>pkg_dir</code>.</p><p><strong>Arguments</strong></p><ul><li><code>pkg_dir::AbstractString</code>: The package directory in which the files will be generated</li><li><code>t::Template</code>: The template whose tests we are generating.</li></ul><p>Returns an array of generated file/directory names.</p></div></div><aclass="source-link"target="_blank"href="https://github.com/invenia/PkgTemplates.jl/blob/aa3758476a185404434420a49b966952630dc32d/src/generate.jl#LL100-L110">source</a></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="PkgTemplates.gen_require"href="#PkgTemplates.gen_require"><code>PkgTemplates.gen_require</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">gen_require(pkg_dir::AbstractString, t::Template) -> Vector{String}</code></pre><p>Create the <code>REQUIRE</code> file in <code>pkg_dir</code>.</p><p><strong>Arguments</strong></p><ul><li><code>pkg_dir::AbstractString</code>: The directory in which the files will be generated.</li><li><code>t::Template</code>: The template whose REQUIRE we are generating.</li></ul><p>Returns an array of generated file/directory names.</p></div></div><aclass="source-link"target="_blank"href="https://github.com/invenia/PkgTemplates.jl/blob/aa3758476a185404434420a49b966952630dc32d/src/generate.jl#LL151-L161">source</a></section><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="PkgTemplates.gen_readme"href="#PkgTemplates.gen_readme"><code>PkgTemplates.gen_readme</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">gen_readme(pkg_dir::AbstractString, t::Template) -> Vector{String}</code></pre><p>Create a README in <code>pkg_dir</code> with badges for each enabled plugin.</p><p><strong>Arguments</strong></p><ul><li><code>pkg_dir::AbstractString</code>: The directory in which the files will be generated.</li><li><code>t::Template</code>: The template whose README we are generating.</li></ul><p>Returns an array of generated file/directory names.</p></div></div><aclass="source-link"target="_blank"href="https://github.com/invenia/PkgTemplates.jl/blob/aa3758476a185404434420a49b966952630dc32d/src/generate.jl#LL168-L178">source</a></sectio