PkgTemplates.jl/v0.6.2/pages/package_generation/index.html

4 lines
12 KiB
HTML
Raw Normal View History

2019-08-25 05:20:11 +00:00
<!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></
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/895f2be769970b5920aaab7bcc98de14a4de7580/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/895f2be769970b5920aaab7bcc98de14a4de7580/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/895f2be769970b5920aaab7bcc98de14a4de7580/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/895f2be769970b5920aaab7bcc98de14a4de7580/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/895f2be769970b5920aaab7bcc98de14a4d