PkgTemplates.jl/v0.6.3/pages/package_generation/index.html
2019-10-07 08:42:39 +00:00

4 lines
12 KiB
HTML

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Package Generation · PkgTemplates.jl</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link href="../../assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>PkgTemplates.jl</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="../../search/"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="../../">Home</a></li><li class="current"><a class="toctext" href>Package Generation</a><ul class="internal"><li><a class="toctext" href="#Template-1"><code>Template</code></a></li><li><a class="toctext" href="#generate-1"><code>generate</code></a></li></ul></li><li><a class="toctext" href="../plugins/">Plugins</a></li><li><a class="toctext" href="../plugin_development/">Plugin Development</a></li><li><a class="toctext" href="../licenses/">Licenses</a></li><li><a class="toctext" href="../">Index</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href>Package Generation</a></li></ul><a class="edit-page" href="https://github.com/invenia/PkgTemplates.jl/blob/master/docs/src/pages/package_generation.md#L"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Package Generation</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="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 <a href="#PkgTemplates.Template"><code>Template</code></a>, then calling <a href="#PkgTemplates.generate"><code>generate</code></a> on it.</p><h2><a class="nav-anchor" id="Template-1" href="#Template-1"><code>Template</code></a></h2><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.Template" href="#PkgTemplates.Template"><code>PkgTemplates.Template</code></a><span class="docstring-category">Type</span>.</div><div><div><pre><code class="language-none">Template(; kwargs...) -&gt; Template</code></pre><p>Records common information used to generate a package. If you don&#39;t wish to manually create a template, you can use <a href="#PkgTemplates.interactive_template"><code>interactive_template</code></a> instead.</p><p><strong>Keyword Arguments</strong></p><ul><li><code>user::AbstractString=&quot;&quot;</code>: GitHub (or other code hosting service) username. If left unset, it will take the the global git config&#39;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=&quot;github.com&quot;</code>: URL to the code hosting service where your package will reside. Note that while hosts other than GitHub won&#39;t cause errors, they are not officially supported and they will cause certain plugins will produce incorrect output.</li><li><code>license::AbstractString=&quot;MIT&quot;</code>: Name of the package license. If an empty string is given, no license is created. <a href="../licenses/#PkgTemplates.available_licenses"><code>available_licenses</code></a> can be used to list all available licenses, and <a href="../licenses/#PkgTemplates.show_license"><code>show_license</code></a> can be used to print out a particular license&#39;s text.</li><li><code>authors::Union{AbstractString, Vector{&lt;:AbstractString}}=&quot;&quot;</code>: Names that appear on the license. Supply a string for one author or an array for multiple. Similarly to <code>user</code>, it will take the value of of the global git config&#39;s value if it is left unset.</li><li><code>dir::AbstractString=~/.julia/dev</code>: Directory in which the package will go. Relative paths are converted to absolute ones at template creation time.</li><li><code>julia_version::VersionNumber=1.0.0</code>: Minimum allowed Julia version.</li><li><code>ssh::Bool=false</code>: Whether or not to use SSH for the git remote. If <code>false</code> HTTPS will be used.</li><li><code>dev::Bool=true</code>: Whether or not to <code>Pkg.develop</code> generated packages.</li><li><code>manifest::Bool=false</code>: Whether or not to commit the <code>Manifest.toml</code>.</li><li><code>plugins::Vector{&lt;:Plugin}=Plugin[]</code>: A list of <code>Plugin</code>s that the package will include.</li></ul></div></div><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/template.jl#LL3-L31">source</a></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.interactive_template" href="#PkgTemplates.interactive_template"><code>PkgTemplates.interactive_template</code></a><span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">interactive_template(; fast::Bool=false) -&gt; Template</code></pre><p>Interactively create a <a href="#PkgTemplates.Template"><code>Template</code></a>. If <code>fast</code> is set, defaults will be assumed for all values except username and plugins.</p></div></div><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/template.jl#LL132-L137">source</a></section><h2><a class="nav-anchor" id="generate-1" href="#generate-1"><code>generate</code></a></h2><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.generate" href="#PkgTemplates.generate"><code>PkgTemplates.generate</code></a><span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">generate(pkg::AbstractString, t::Template) -&gt; Nothing
generate(t::Template, pkg::AbstractString) -&gt; Nothing</code></pre><p>Generate a package named <code>pkg</code> from <code>t</code>. If <code>git</code> is <code>false</code>, no Git repository is created.</p></div></div><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/generate.jl#LL1-L6">source</a></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.generate_interactive" href="#PkgTemplates.generate_interactive"><code>PkgTemplates.generate_interactive</code></a><span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">generate_interactive(pkg::AbstractString; fast::Bool=false, git::Bool=true) -&gt; 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 <a href="#PkgTemplates.generate"><code>generate</code></a> and <a href="#PkgTemplates.interactive_template"><code>interactive_template</code></a>.</p></div></div><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/generate.jl#LL109-L115">source</a></section><h3><a class="nav-anchor" id="Helper-Functions-1" href="#Helper-Functions-1">Helper Functions</a></h3><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.gen_tests" href="#PkgTemplates.gen_tests"><code>PkgTemplates.gen_tests</code></a><span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">gen_tests(pkg_dir::AbstractString, t::Template) -&gt; 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><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/generate.jl#LL127-L137">source</a></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.gen_readme" href="#PkgTemplates.gen_readme"><code>PkgTemplates.gen_readme</code></a><span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">gen_readme(pkg_dir::AbstractString, t::Template) -&gt; 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><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/generate.jl#LL178-L188">source</a></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.gen_gitignore" href="#PkgTemplates.gen_gitignore"><code>PkgTemplates.gen_gitignore</code></a><span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">gen_gitignore(pkg_dir::AbstractString, t::Template) -&gt; Vector{String}</code></pre><p>Create a <code>.gitignore</code> 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 .gitignore we are generating.</li></ul><p>Returns an array of generated file/directory names.</p></div></div><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/generate.jl#LL220-L230">source</a></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="PkgTemplates.gen_license" href="#PkgTemplates.gen_license"><code>PkgTemplates.gen_license</code></a><span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">gen_license(pkg_dir::AbstractString, t::Template) -&gt; Vector{String}</code></pre><p>Create a license 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 LICENSE we are generating.</li></ul><p>Returns an array of generated file/directory names.</p></div></div><a class="source-link" target="_blank" href="https://github.com/invenia/PkgTemplates.jl/blob/26a494410a5617af35acd8097ed3bcf303d71543/src/generate.jl#LL247-L257">source</a></section><footer><hr/><a class="previous" href="../../"><span class="direction">Previous</span><span class="title">Home</span></a><a class="next" href="../plugins/"><span class="direction">Next</span><span class="title">Plugins</span></a></footer></article></body></html>