task.mk/search/search_index.json

1 line
12 KiB
JSON
Raw Normal View History

{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"task.mk <p> the task runner for GNU Make you've been missing </p> <p> Documentation </p> <p></p> <p>GNU make is an excellent build tool and the task runner we love to hate, but can't escape. So let's improve the UX to make it the best task runner it can be.</p> <p><code>Task.mk</code>, is a standalone <code>Makefile</code> you can deploy alongside your own to add some QOL improvements for your users and fellow maintainers.</p> <p>Current Features:</p> <ul> <li>ANSI escape code support (including NO_COLOR) </li> <li>formatted help output</li> <li>custom print function</li> <li>confirmation prompt</li> <li>goal phonifier (disabled by default)</li> </ul> <p>Depends on <code>GNU Make</code>, obviously and <code>Python &gt;=3.7</code>, and <code>bash</code> (or <code>zsh</code>).</p> <p>Wait python?!?!, I'm not <code>pip</code> installing some package just to parse my makefile. I agree, all you need is one file <code>.task.mk</code> You can automagically include it with just two additional lines to your <code>Makefile</code> (and probably one to your <code>.gitignore</code>) and you're good to go.</p>"},{"location":"#setup","title":"Setup","text":"<p>One line setup to download .task.mk and add appropriate includes to your <code>Makefile</code>. <pre><code>bash &lt;(curl -fsSL gh.dayl.in/task.mk/init) # or w/ TASKMK_VERSION=\n</code></pre></p> <p>You can include this as an optional dependency on your project by adding the below lines to the end of your <code>Makefile</code>. If someone tries to invoke <code>make help</code> it will download <code>.task.mk</code> for them.</p> <pre><code>-include .task.mk\n$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v2024.1001/task.mk -o .task.mk))\n</code></pre> <p>If you plan to use any features besides the help prompt you may want to instead commit <code>.task.mk</code> to version control or drop the <code>$(MAKECMDGOALS)</code> check so it's always downloaded once <code>make</code> is invoked.</p> <pre><code>-include .task.mk\n$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v2024.1001/task.mk -o .task.mk)\n</code></pre> <p>For more info see the documentation.</p>"},{"location":"usage/","title":"Usage","text":"<p><code>Task.mk</code> can be included in any standard <code>GNUMakefile</code>. If it's been properly sourced you will have access to the below features/recipes.</p> <p>See examples for more info.</p>"},{"location":"usage/#builtin-recipes","title":"Builtin Recipes","text":""},{"location":"usage/#help","title":"Help","text":"<p>Invoked with either <code>make help</code> or <code>make h</code>.</p> <p>Adding goals to the builtin help recipe just requires documenting your <code>Makefile</code> with comments. The format is <code>## &lt;recipe&gt; |&gt; &lt;msg&gt;</code> or <code>&lt;recipe&gt;: ## &lt;msg&gt;</code></p> <pre><code>## build |&gt; build the project\nbuild:\n ...\n\nbuild: ## build the project\n</code></pre> <p>Now when you invoke <code>make help</code> it will parse these and generate your help output. In addition you can add raw text to the help output using the format <code>### &lt;rawmsg&gt;</code>.</p> <p>Both recipe documentation and raw messages can be modified with additional arguments delimited by <code>|&gt;</code>.</p> <p>For example:</p> <pre><code>### build related recipes |&gt; --align center --divider\nbuild: ## build the project |&gt; --msg-style bold\n ...\npackage: ## package the project |&gt; -gs b_cyan\n</code></pre> <p><code>Task.mk</code> can also generate recipe specific help regardless of whether a goal is documented. This can be invoked by appending the name of a recipe to help call: <code>make help build</code>.</p> <p>All recipes prefixed with and underscore will be hidden even if documented. However, they can be viewed by invoking <code>make _help</code>.</p>"},{