This commit is contained in:
daylinmorgan 2023-01-30 16:02:33 +00:00
parent 8dd19ebab1
commit 4e3f48e7f3
47 changed files with 1545 additions and 3416 deletions

View file

@ -11,7 +11,7 @@
<link rel="icon" href="/task.mk/assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
@ -19,7 +19,7 @@
<link rel="stylesheet" href="/task.mk/assets/stylesheets/main.558e4712.min.css">
<link rel="stylesheet" href="/task.mk/assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="/task.mk/assets/stylesheets/palette.2505c338.min.css">
@ -40,8 +40,6 @@
<link rel="stylesheet" href="/task.mk/stylesheets/extra.css">
<link rel="stylesheet" href="/task.mk/stylesheets/asciinema-player.css">
<script>__md_scope=new URL("/task.mk/",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
@ -252,7 +250,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
@ -266,6 +264,8 @@
@ -279,7 +279,7 @@
</div>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
@ -299,7 +299,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_2" type="checkbox" id="__nav_3_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" >
@ -316,7 +316,7 @@
</div>
<nav class="md-nav" aria-label="Check" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
@ -343,7 +343,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_3" type="checkbox" id="__nav_3_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
@ -360,7 +360,7 @@
</div>
<nav class="md-nav" aria-label="Embedded" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
@ -387,7 +387,51 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_4" type="checkbox" id="__nav_3_4" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" >
<div class="md-nav__link md-nav__link--index ">
<a href="/task.mk/examples/phonify/">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
@ -404,8 +448,8 @@
</div>
<nav class="md-nav" aria-label="Recipe help" data-md-level="2">
<label class="md-nav__title" for="__nav_3_4">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
@ -487,20 +531,11 @@
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "/task.mk/", "features": ["navigation.indexes"], "search": "/task.mk/assets/javascripts/workers/search.e5c33ebb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script id="__config" type="application/json">{"base": "/task.mk/", "features": ["navigation.indexes"], "search": "/task.mk/assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="/task.mk/assets/javascripts/bundle.51d95adb.min.js"></script>
<script src="/task.mk/javascripts/asciinema-player.min.js"></script>
<script src="/task.mk/assets/javascripts/bundle.a00a7c5e.min.js"></script>
</body>
</html>

View file

@ -1,4 +1,4 @@
<svg class="rich-terminal shadow" viewBox="0 0 720.3333333333334 716.7333333333333" xmlns="http://www.w3.org/2000/svg">
<svg class="rich-terminal shadow" viewBox="0 0 573.3333333333334 521.5333333333333" xmlns="http://www.w3.org/2000/svg">
<!-- Generated with Rich https://www.textualize.io -->
<style>
@font-face {
@ -16,14 +16,14 @@
font-weight: 700;
}
.terminal-1053897658-matrix {
.terminal-3478059149-matrix {
font-family: Fira Code, monospace;
font-size: 20px;
line-height: 24.4px;
font-variant-east-asian: full-width;
}
.terminal-1053897658-title {
.terminal-3478059149-title {
font-size: 18px;
font-weight: bold;
font-family: arial;
@ -33,133 +33,100 @@
-webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
}
.terminal-1053897658-r1 { fill: #94e2d5;font-weight: bold }
.terminal-1053897658-r2 { fill: #c6d0f5 }
.terminal-1053897658-r3 { fill: #f5c2e7;font-weight: bold }
.terminal-1053897658-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
.terminal-1053897658-r5 { fill: #a6e3a1;font-weight: bold }
.terminal-1053897658-r6 { fill: #f9e2af;font-weight: bold }
.terminal-1053897658-r7 { fill: #8288a5 }
.terminal-1053897658-r8 { fill: #f38ba8;font-weight: bold }
.terminal-3478059149-r1 { fill: #94e2d5;font-weight: bold }
.terminal-3478059149-r2 { fill: #c6d0f5 }
.terminal-3478059149-r3 { fill: #f5c2e7;font-weight: bold }
.terminal-3478059149-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
.terminal-3478059149-r5 { fill: #a6e3a1;font-weight: bold }
.terminal-3478059149-r6 { fill: #f9e2af;font-weight: bold }
.terminal-3478059149-r7 { fill: #8288a5 }
</style>
<defs>
<clipPath id="terminal-1053897658-clip-terminal">
<rect x="0" y="0" width="682.1999999999999" height="633.4" />
<clipPath id="terminal-3478059149-clip-terminal">
<rect x="0" y="0" width="535.8" height="438.2" />
</clipPath>
<clipPath id="terminal-1053897658-line-0">
<rect x="0" y="1.5" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-0">
<rect x="0" y="1.5" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-1">
<rect x="0" y="25.9" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-1">
<rect x="0" y="25.9" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-2">
<rect x="0" y="50.3" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-2">
<rect x="0" y="50.3" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-3">
<rect x="0" y="74.7" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-3">
<rect x="0" y="74.7" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-4">
<rect x="0" y="99.1" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-4">
<rect x="0" y="99.1" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-5">
<rect x="0" y="123.5" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-5">
<rect x="0" y="123.5" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-6">
<rect x="0" y="147.9" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-6">
<rect x="0" y="147.9" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-7">
<rect x="0" y="172.3" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-7">
<rect x="0" y="172.3" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-8">
<rect x="0" y="196.7" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-8">
<rect x="0" y="196.7" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-9">
<rect x="0" y="221.1" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-9">
<rect x="0" y="221.1" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-10">
<rect x="0" y="245.5" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-10">
<rect x="0" y="245.5" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-11">
<rect x="0" y="269.9" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-11">
<rect x="0" y="269.9" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-12">
<rect x="0" y="294.3" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-12">
<rect x="0" y="294.3" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-13">
<rect x="0" y="318.7" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-13">
<rect x="0" y="318.7" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-14">
<rect x="0" y="343.1" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-14">
<rect x="0" y="343.1" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-15">
<rect x="0" y="367.5" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-15">
<rect x="0" y="367.5" width="536.8" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-16">
<rect x="0" y="391.9" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-17">
<rect x="0" y="416.3" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-18">
<rect x="0" y="440.7" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-19">
<rect x="0" y="465.1" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-20">
<rect x="0" y="489.5" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-21">
<rect x="0" y="513.9" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-22">
<rect x="0" y="538.3" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-23">
<rect x="0" y="562.7" width="683.2" height="24.65"/>
</clipPath>
<clipPath id="terminal-1053897658-line-24">
<rect x="0" y="587.1" width="683.2" height="24.65"/>
<clipPath id="terminal-3478059149-line-16">
<rect x="0" y="391.9" width="536.8" height="24.65"/>
</clipPath>
</defs>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="700" height="682.4" rx="8"/><text class="terminal-1053897658-title" fill="#c6d0f5" text-anchor="middle" x="350" y="27">make&#160;help</text>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="553" height="487.2" rx="8"/><text class="terminal-3478059149-title" fill="#c6d0f5" text-anchor="middle" x="276" y="27">make&#160;help</text>
<g transform="translate(32,22)">
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
<circle cx="44" cy="0" r="7" fill="#28c840"/>
</g>
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-1053897658-clip-terminal)">
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-3478059149-clip-terminal)">
<g class="terminal-1053897658-matrix">
<text class="terminal-1053897658-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-1053897658-line-0)">usage:</text><text class="terminal-1053897658-r2" x="683.2" y="20" textLength="12.2" clip-path="url(#terminal-1053897658-line-0)">
</text><text class="terminal-1053897658-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-1053897658-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-1053897658-r2" x="683.2" y="44.4" textLength="12.2" clip-path="url(#terminal-1053897658-line-1)">
</text><text class="terminal-1053897658-r2" x="683.2" y="68.8" textLength="12.2" clip-path="url(#terminal-1053897658-line-2)">
</text><text class="terminal-1053897658-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-1053897658-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-1053897658-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-1053897658-line-3)">`Makefile`</text><text class="terminal-1053897658-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-1053897658-line-3)">&#160;into</text><text class="terminal-1053897658-r2" x="683.2" y="93.2" textLength="12.2" clip-path="url(#terminal-1053897658-line-3)">
</text><text class="terminal-1053897658-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-1053897658-line-4)">&#160;&#160;the&#160;</text><text class="terminal-1053897658-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-1053897658-line-4)">task&#160;runner</text><text class="terminal-1053897658-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-1053897658-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-1053897658-r2" x="683.2" y="117.6" textLength="12.2" clip-path="url(#terminal-1053897658-line-4)">
</text><text class="terminal-1053897658-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-1053897658-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-1053897658-r2" x="683.2" y="142" textLength="12.2" clip-path="url(#terminal-1053897658-line-5)">
</text><text class="terminal-1053897658-r2" x="683.2" y="166.4" textLength="12.2" clip-path="url(#terminal-1053897658-line-6)">
</text><text class="terminal-1053897658-r5" x="24.4" y="190.8" textLength="475.8" clip-path="url(#terminal-1053897658-line-7)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;task.mk&#160;development&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</text><text class="terminal-1053897658-r2" x="683.2" y="190.8" textLength="12.2" clip-path="url(#terminal-1053897658-line-7)">
</text><text class="terminal-1053897658-r2" x="0" y="215.2" textLength="536.8" clip-path="url(#terminal-1053897658-line-8)">&#160;&#160;──────────────────────────────────────────</text><text class="terminal-1053897658-r2" x="683.2" y="215.2" textLength="12.2" clip-path="url(#terminal-1053897658-line-8)">
</text><text class="terminal-1053897658-r6" x="0" y="239.6" textLength="134.2" clip-path="url(#terminal-1053897658-line-9)">&#160;&#160;bootstrap</text><text class="terminal-1053897658-r2" x="134.2" y="239.6" textLength="36.6" clip-path="url(#terminal-1053897658-line-9)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="239.6" textLength="366" clip-path="url(#terminal-1053897658-line-9)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-1053897658-r2" x="683.2" y="239.6" textLength="12.2" clip-path="url(#terminal-1053897658-line-9)">
</text><text class="terminal-1053897658-r6" x="0" y="264" textLength="134.2" clip-path="url(#terminal-1053897658-line-10)">&#160;&#160;&#160;&#160;l,&#160;lint</text><text class="terminal-1053897658-r2" x="134.2" y="264" textLength="36.6" clip-path="url(#terminal-1053897658-line-10)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="264" textLength="183" clip-path="url(#terminal-1053897658-line-10)">lint&#160;the&#160;python</text><text class="terminal-1053897658-r2" x="683.2" y="264" textLength="12.2" clip-path="url(#terminal-1053897658-line-10)">
</text><text class="terminal-1053897658-r6" x="0" y="288.4" textLength="134.2" clip-path="url(#terminal-1053897658-line-11)">&#160;&#160;&#160;&#160;&#160;assets</text><text class="terminal-1053897658-r2" x="134.2" y="288.4" textLength="36.6" clip-path="url(#terminal-1053897658-line-11)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="288.4" textLength="183" clip-path="url(#terminal-1053897658-line-11)">generate&#160;assets</text><text class="terminal-1053897658-r2" x="683.2" y="288.4" textLength="12.2" clip-path="url(#terminal-1053897658-line-11)">
</text><text class="terminal-1053897658-r6" x="0" y="312.8" textLength="134.2" clip-path="url(#terminal-1053897658-line-12)">&#160;&#160;&#160;&#160;release</text><text class="terminal-1053897658-r2" x="134.2" y="312.8" textLength="36.6" clip-path="url(#terminal-1053897658-line-12)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="312.8" textLength="366" clip-path="url(#terminal-1053897658-line-12)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-1053897658-r2" x="683.2" y="312.8" textLength="12.2" clip-path="url(#terminal-1053897658-line-12)">
</text><text class="terminal-1053897658-r6" x="0" y="337.2" textLength="134.2" clip-path="url(#terminal-1053897658-line-13)">&#160;&#160;&#160;c,&#160;clean</text><text class="terminal-1053897658-r2" x="134.2" y="337.2" textLength="36.6" clip-path="url(#terminal-1053897658-line-13)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="337.2" textLength="317.2" clip-path="url(#terminal-1053897658-line-13)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-1053897658-r2" x="683.2" y="337.2" textLength="12.2" clip-path="url(#terminal-1053897658-line-13)">
</text><text class="terminal-1053897658-r2" x="0" y="361.6" textLength="536.8" clip-path="url(#terminal-1053897658-line-14)">&#160;&#160;──────────────────────────────────────────</text><text class="terminal-1053897658-r2" x="683.2" y="361.6" textLength="12.2" clip-path="url(#terminal-1053897658-line-14)">
</text><text class="terminal-1053897658-r2" x="683.2" y="386" textLength="12.2" clip-path="url(#terminal-1053897658-line-15)">
</text><text class="terminal-1053897658-r8" x="24.4" y="410.4" textLength="475.8" clip-path="url(#terminal-1053897658-line-16)">&#160;&#160;&#160;&#160;&#160;&#160;examples&#160;of&#160;task.mk&#160;features&#160;&#160;&#160;&#160;&#160;</text><text class="terminal-1053897658-r2" x="683.2" y="410.4" textLength="12.2" clip-path="url(#terminal-1053897658-line-16)">
</text><text class="terminal-1053897658-r2" x="0" y="434.8" textLength="536.8" clip-path="url(#terminal-1053897658-line-17)">&#160;&#160;──────────────────────────────────────────</text><text class="terminal-1053897658-r2" x="683.2" y="434.8" textLength="12.2" clip-path="url(#terminal-1053897658-line-17)">
</text><text class="terminal-1053897658-r6" x="0" y="459.2" textLength="134.2" clip-path="url(#terminal-1053897658-line-18)">&#160;&#160;&#160;&#160;&#160;list-%</text><text class="terminal-1053897658-r2" x="134.2" y="459.2" textLength="36.6" clip-path="url(#terminal-1053897658-line-18)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="459.2" textLength="366" clip-path="url(#terminal-1053897658-line-18)">use&#160;pathlib.Path&#160;to&#160;list&#160;files</text><text class="terminal-1053897658-r2" x="683.2" y="459.2" textLength="12.2" clip-path="url(#terminal-1053897658-line-18)">
</text><text class="terminal-1053897658-r7" x="170.8" y="483.6" textLength="512.4" clip-path="url(#terminal-1053897658-line-19)">name&#160;the&#160;directory&#160;in&#160;rule&#160;(make&#160;list-src)</text><text class="terminal-1053897658-r2" x="683.2" y="483.6" textLength="12.2" clip-path="url(#terminal-1053897658-line-19)">
</text><text class="terminal-1053897658-r6" x="0" y="508" textLength="134.2" clip-path="url(#terminal-1053897658-line-20)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-1053897658-r2" x="134.2" y="508" textLength="36.6" clip-path="url(#terminal-1053897658-line-20)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="508" textLength="329.4" clip-path="url(#terminal-1053897658-line-20)">demonstrate&#160;usage&#160;of&#160;tprint</text><text class="terminal-1053897658-r2" x="683.2" y="508" textLength="12.2" clip-path="url(#terminal-1053897658-line-20)">
</text><text class="terminal-1053897658-r6" x="0" y="532.4" textLength="134.2" clip-path="url(#terminal-1053897658-line-21)">&#160;&#160;&#160;&#160;&#160;&#160;check</text><text class="terminal-1053897658-r2" x="134.2" y="532.4" textLength="36.6" clip-path="url(#terminal-1053897658-line-21)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="532.4" textLength="353.8" clip-path="url(#terminal-1053897658-line-21)">get&#160;user&#160;confirmation&#160;or&#160;exit</text><text class="terminal-1053897658-r2" x="683.2" y="532.4" textLength="12.2" clip-path="url(#terminal-1053897658-line-21)">
</text><text class="terminal-1053897658-r2" x="0" y="556.8" textLength="536.8" clip-path="url(#terminal-1053897658-line-22)">&#160;&#160;──────────────────────────────────────────</text><text class="terminal-1053897658-r2" x="683.2" y="556.8" textLength="12.2" clip-path="url(#terminal-1053897658-line-22)">
</text><text class="terminal-1053897658-r6" x="0" y="581.2" textLength="134.2" clip-path="url(#terminal-1053897658-line-23)">&#160;&#160;&#160;&#160;h,&#160;help</text><text class="terminal-1053897658-r2" x="134.2" y="581.2" textLength="36.6" clip-path="url(#terminal-1053897658-line-23)">&#160;&#160;</text><text class="terminal-1053897658-r7" x="170.8" y="581.2" textLength="170.8" clip-path="url(#terminal-1053897658-line-23)">show&#160;this&#160;help</text><text class="terminal-1053897658-r2" x="683.2" y="581.2" textLength="12.2" clip-path="url(#terminal-1053897658-line-23)">
</text><text class="terminal-1053897658-r2" x="683.2" y="605.6" textLength="12.2" clip-path="url(#terminal-1053897658-line-24)">
</text><text class="terminal-1053897658-r2" x="0" y="630" textLength="561.2" clip-path="url(#terminal-1053897658-line-25)">for&#160;more&#160;info:&#160;github.com/daylinmorgan/task.mk</text><text class="terminal-1053897658-r2" x="683.2" y="630" textLength="12.2" clip-path="url(#terminal-1053897658-line-25)">
<g class="terminal-3478059149-matrix">
<text class="terminal-3478059149-r1" x="0" y="20" textLength="61" clip-path="url(#terminal-3478059149-line-0)">usage</text><text class="terminal-3478059149-r2" x="61" y="20" textLength="12.2" clip-path="url(#terminal-3478059149-line-0)">:</text><text class="terminal-3478059149-r2" x="536.8" y="20" textLength="12.2" clip-path="url(#terminal-3478059149-line-0)">
</text><text class="terminal-3478059149-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-3478059149-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-3478059149-r2" x="536.8" y="44.4" textLength="12.2" clip-path="url(#terminal-3478059149-line-1)">
</text><text class="terminal-3478059149-r2" x="536.8" y="68.8" textLength="12.2" clip-path="url(#terminal-3478059149-line-2)">
</text><text class="terminal-3478059149-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-3478059149-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-3478059149-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-3478059149-line-3)">`Makefile`</text><text class="terminal-3478059149-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-3478059149-line-3)">&#160;into</text><text class="terminal-3478059149-r2" x="536.8" y="93.2" textLength="12.2" clip-path="url(#terminal-3478059149-line-3)">
</text><text class="terminal-3478059149-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-3478059149-line-4)">&#160;&#160;the&#160;</text><text class="terminal-3478059149-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-3478059149-line-4)">task&#160;runner</text><text class="terminal-3478059149-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-3478059149-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-3478059149-r2" x="536.8" y="117.6" textLength="12.2" clip-path="url(#terminal-3478059149-line-4)">
</text><text class="terminal-3478059149-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-3478059149-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-3478059149-r2" x="536.8" y="142" textLength="12.2" clip-path="url(#terminal-3478059149-line-5)">
</text><text class="terminal-3478059149-r2" x="536.8" y="166.4" textLength="12.2" clip-path="url(#terminal-3478059149-line-6)">
</text><text class="terminal-3478059149-r5" x="24.4" y="190.8" textLength="475.8" clip-path="url(#terminal-3478059149-line-7)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;task.mk&#160;development&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</text><text class="terminal-3478059149-r2" x="536.8" y="190.8" textLength="12.2" clip-path="url(#terminal-3478059149-line-7)">
</text><text class="terminal-3478059149-r2" x="0" y="215.2" textLength="536.8" clip-path="url(#terminal-3478059149-line-8)">&#160;&#160;──────────────────────────────────────────</text><text class="terminal-3478059149-r2" x="536.8" y="215.2" textLength="12.2" clip-path="url(#terminal-3478059149-line-8)">
</text><text class="terminal-3478059149-r1" x="0" y="239.6" textLength="134.2" clip-path="url(#terminal-3478059149-line-9)">&#160;&#160;bootstrap</text><text class="terminal-3478059149-r2" x="134.2" y="239.6" textLength="36.6" clip-path="url(#terminal-3478059149-line-9)">&#160;&#160;</text><text class="terminal-3478059149-r3" x="170.8" y="239.6" textLength="366" clip-path="url(#terminal-3478059149-line-9)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-3478059149-r2" x="536.8" y="239.6" textLength="12.2" clip-path="url(#terminal-3478059149-line-9)">
</text><text class="terminal-3478059149-r6" x="0" y="264" textLength="134.2" clip-path="url(#terminal-3478059149-line-10)">&#160;&#160;&#160;&#160;&#160;l&#160;lint</text><text class="terminal-3478059149-r2" x="134.2" y="264" textLength="36.6" clip-path="url(#terminal-3478059149-line-10)">&#160;&#160;</text><text class="terminal-3478059149-r7" x="170.8" y="264" textLength="183" clip-path="url(#terminal-3478059149-line-10)">lint&#160;the&#160;python</text><text class="terminal-3478059149-r2" x="536.8" y="264" textLength="12.2" clip-path="url(#terminal-3478059149-line-10)">
</text><text class="terminal-3478059149-r6" x="0" y="288.4" textLength="134.2" clip-path="url(#terminal-3478059149-line-11)">&#160;&#160;&#160;&#160;&#160;assets</text><text class="terminal-3478059149-r2" x="134.2" y="288.4" textLength="36.6" clip-path="url(#terminal-3478059149-line-11)">&#160;&#160;</text><text class="terminal-3478059149-r7" x="170.8" y="288.4" textLength="183" clip-path="url(#terminal-3478059149-line-11)">generate&#160;assets</text><text class="terminal-3478059149-r2" x="536.8" y="288.4" textLength="12.2" clip-path="url(#terminal-3478059149-line-11)">
</text><text class="terminal-3478059149-r6" x="0" y="312.8" textLength="134.2" clip-path="url(#terminal-3478059149-line-12)">&#160;&#160;&#160;&#160;release</text><text class="terminal-3478059149-r2" x="134.2" y="312.8" textLength="36.6" clip-path="url(#terminal-3478059149-line-12)">&#160;&#160;</text><text class="terminal-3478059149-r7" x="170.8" y="312.8" textLength="366" clip-path="url(#terminal-3478059149-line-12)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-3478059149-r2" x="536.8" y="312.8" textLength="12.2" clip-path="url(#terminal-3478059149-line-12)">
</text><text class="terminal-3478059149-r6" x="0" y="337.2" textLength="134.2" clip-path="url(#terminal-3478059149-line-13)">&#160;&#160;&#160;&#160;c&#160;clean</text><text class="terminal-3478059149-r2" x="134.2" y="337.2" textLength="36.6" clip-path="url(#terminal-3478059149-line-13)">&#160;&#160;</text><text class="terminal-3478059149-r7" x="170.8" y="337.2" textLength="317.2" clip-path="url(#terminal-3478059149-line-13)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-3478059149-r2" x="536.8" y="337.2" textLength="12.2" clip-path="url(#terminal-3478059149-line-13)">
</text><text class="terminal-3478059149-r6" x="0" y="361.6" textLength="134.2" clip-path="url(#terminal-3478059149-line-14)">&#160;&#160;&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-3478059149-r2" x="134.2" y="361.6" textLength="36.6" clip-path="url(#terminal-3478059149-line-14)">&#160;&#160;</text><text class="terminal-3478059149-r7" x="170.8" y="361.6" textLength="329.4" clip-path="url(#terminal-3478059149-line-14)">demonstrate&#160;usage&#160;of&#160;tprint</text><text class="terminal-3478059149-r2" x="536.8" y="361.6" textLength="12.2" clip-path="url(#terminal-3478059149-line-14)">
</text><text class="terminal-3478059149-r6" x="0" y="386" textLength="134.2" clip-path="url(#terminal-3478059149-line-15)">&#160;&#160;&#160;&#160;&#160;h&#160;help</text><text class="terminal-3478059149-r2" x="134.2" y="386" textLength="36.6" clip-path="url(#terminal-3478059149-line-15)">&#160;&#160;</text><text class="terminal-3478059149-r7" x="170.8" y="386" textLength="170.8" clip-path="url(#terminal-3478059149-line-15)">show&#160;this&#160;help</text><text class="terminal-3478059149-r2" x="536.8" y="386" textLength="12.2" clip-path="url(#terminal-3478059149-line-15)">
</text><text class="terminal-3478059149-r2" x="536.8" y="410.4" textLength="12.2" clip-path="url(#terminal-3478059149-line-16)">
</text><text class="terminal-3478059149-r2" x="0" y="434.8" textLength="402.6" clip-path="url(#terminal-3478059149-line-17)">for&#160;more&#160;info:&#160;gh.dayl.in/task.mk</text><text class="terminal-3478059149-r2" x="536.8" y="434.8" textLength="12.2" clip-path="url(#terminal-3478059149-line-17)">
</text>
</g>
</g>

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,18 +1,13 @@
MAKEFLAGS += --no-print-directory
COLS ?= 60
ROWS ?= 20
EXAMPLES := check embedded recipe-help
CASTS := $(addsuffix /demo.cast, $(EXAMPLES))
EXAMPLES := check embedded recipe-help phonify
GIFS := $(addsuffix /demo.gif, $(EXAMPLES))
all: $(CASTS)
all: $(GIFS)
%/demo.cast: %/record.sh
asciinema rec --cols $(COLS) --rows $(ROWS) --overwrite -c $< $@
check/demo.cast: COLS = 48
check/demo.cast: ROWS = 12
%/demo.gif: %/demo.tape %/Makefile
cd $* && vhs < demo.tape
clean:
rm -rf $(CASTS)
rm -rf $(GIFS)
.PHONY:all clean
.PHONY: all clean

11
examples/check/Makefile Normal file
View file

@ -0,0 +1,11 @@
.PHONY: check
check: ## get user confirmation or exit
$(call tconfirm,Would you like to proceed?)
@echo "you said yes!"
define USAGE
{a.$(HEADER_STYLE)}usage:{a.end}\n make <recipe>\n\n interactivity w/ task.mk\n
endef
.DEFAULT_GOAL = help
include .task.mk

View file

@ -1,16 +0,0 @@
## check | get user confirmation or exit
.PHONY: check
check:
$(call tconfirm,Would you like to proceed?)
@echo "you said yes!"
define USAGE
{a.$(HEADER_STYLE)}usage:{a.end}
make <recipe>
interactivity w/ task.mk\n
endef
.DEFAULT_GOAL = help
include $(shell git rev-parse --show-toplevel)/task.mk

BIN
examples/check/demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

15
examples/check/demo.tape Normal file
View file

@ -0,0 +1,15 @@
Output demo.gif
Set FontSize 32
Set Width 1600
Set Height 800
Set Theme "Catppuccin Mocha"
Type "make help" Sleep 1s Enter Sleep 2s
Type "make check" Sleep 1s Enter Sleep 2s
Type "y" Sleep 1s Enter Sleep 2s
Type "# Let's try again but instead say no this time" Sleep 1s Enter
Type "make check" Sleep 1s Enter Sleep 2s
Type "n" Sleep 1s Enter Sleep 2s
Sleep 2s

View file

@ -17,7 +17,7 @@
<link rel="next" href="../embedded/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
@ -25,7 +25,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/main.558e4712.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.2505c338.min.css">
@ -46,8 +46,6 @@
<link rel="stylesheet" href="../../stylesheets/extra.css">
<link rel="stylesheet" href="../../stylesheets/asciinema-player.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
@ -265,7 +263,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3" type="checkbox" id="__nav_3" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
@ -279,6 +277,8 @@
@ -292,7 +292,7 @@
</div>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
@ -314,7 +314,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_2" type="checkbox" id="__nav_3_2" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" checked>
@ -331,7 +331,7 @@
</div>
<nav class="md-nav" aria-label="Check" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
@ -358,7 +358,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_3" type="checkbox" id="__nav_3_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
@ -375,7 +375,7 @@
</div>
<nav class="md-nav" aria-label="Embedded" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
@ -402,7 +402,51 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_4" type="checkbox" id="__nav_3_4" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" >
<div class="md-nav__link md-nav__link--index ">
<a href="../phonify/">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
@ -419,8 +463,8 @@
</div>
<nav class="md-nav" aria-label="Recipe help" data-md-level="2">
<label class="md-nav__title" for="__nav_3_4">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
@ -479,23 +523,18 @@
<h1 id="check">Check</h1>
<div id="demo-cast"></div>
<div class="highlight"><span class="filename">check.mk</span><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c">## check | get user confirmation or exit</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">check</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="nf">check</span><span class="o">:</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tconfirm,Would<span class="w"> </span>you<span class="w"> </span>like<span class="w"> </span>to<span class="w"> </span>proceed?<span class="k">)</span>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="w"> </span>@echo<span class="w"> </span><span class="s2">&quot;you said yes!&quot;</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="cp">define USAGE</span>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="nf">{a.$(HEADER_STYLE)}usage</span><span class="o">:</span>{<span class="n">a</span>.<span class="n">end</span>}
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="w"> </span>make<span class="w"> </span>&lt;recipe&gt;
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a>
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="w"> </span>interactivity<span class="w"> </span>w/<span class="w"> </span>task.mk<span class="se">\n</span>
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="cp">endef</span>
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a>
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a><span class="nv">.DEFAULT_GOAL</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">help</span>
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="cp">include $(shell git rev-parse --show-toplevel)/task.mk</span>
<p><img alt="demo" src="demo.gif" /></p>
<div class="highlight"><span class="filename">Makefile (check)</span><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">check</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nf">check</span><span class="o">:</span><span class="w"> </span><span class="c">## get user confirmation or exit</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tconfirm,Would<span class="w"> </span>you<span class="w"> </span>like<span class="w"> </span>to<span class="w"> </span>proceed?<span class="k">)</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span>@echo<span class="w"> </span><span class="s2">&quot;you said yes!&quot;</span>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="cp">define USAGE</span>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="nf">{a.$(HEADER_STYLE)}usage</span><span class="o">:</span>{<span class="n">a</span>.<span class="n">end</span>}\<span class="n">n</span> <span class="n">make</span> &lt;<span class="n">recipe</span>&gt;\<span class="n">n</span>\<span class="n">n</span> <span class="n">interactivity</span> <span class="n">w</span>/ <span class="n">task</span>.<span class="n">mk</span>\<span class="n">n</span>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="cp">endef</span>
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a>
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="nv">.DEFAULT_GOAL</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">help</span>
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="cp">include .task.mk</span>
</code></pre></div>
<hr>
@ -503,7 +542,7 @@
<small>
Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">September 19, 2022</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2023</span>
<br>
Created:
@ -549,26 +588,11 @@
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.indexes"], "search": "../../assets/javascripts/workers/search.e5c33ebb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.indexes"], "search": "../../assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.51d95adb.min.js"></script>
<script src="../../javascripts/asciinema-player.min.js"></script>
<script src="../../assets/javascripts/bundle.a00a7c5e.min.js"></script>
<script async>
AsciinemaPlayer.create('./demo.cast', document.getElementById('demo-cast'),{loop: true});
</script>
</body>
</html>

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
source "$(dirname "${BASH_SOURCE[0]}")/../functions.sh"
cmd 'make -f check/check.mk help'
cmd 'make -f check/check.mk check'
msg "# Let's try again but instead say no this time"
cmd 'make -f check/check.mk check'
sleep 1

View file

@ -0,0 +1,35 @@
### examples of task.mk features |> --divider --align center --msg-style b_red
define list_files_py
from pathlib import Path
print("files in $(2)")
print([f.name for f in (Path("$(2)").iterdir())])
endef
## list-% |> use pathlib.Path to list files
### name the directory in rule (make list-src) |> --align sep
list-%:
$(call py,list_files_py,$*)
# dollar signs will always be a problem :|
define bash_script
echo "Is the process running bash? We can check with ps"
ps -o args= -p $$$$ | grep -E -m 1 -o '\w{0,5}sh'
echo "Get input at runtime"
printf "type input now! "
read -r name
echo "you typed -> $$name"
echo "the argument below as given in the makefile itself"
echo "it's expanded before the script is passed to bash"
printf "%s\n" "$(2)"
endef
.PHONY: embedded-bash
embedded-bash: ## bash script with pipes and make input
$(call tbash,bash_script,bash multiline is working 🤞)
define USAGE
{a.$(HEADER_STYLE)}usage:{a.end}\n make <recipe>\n\n examples of embedded scripts in `{a.magenta}Makefile{a.end}`\n
endef
.DEFAULT_GOAL = help
include .task.mk

View file

@ -1,83 +0,0 @@
{"version": 2, "width": 60, "height": 20, "timestamp": 1664060088, "env": {"SHELL": "/usr/bin/zsh", "TERM": "xterm-256color"}}
[0.008131, "o", "\u001b[H\u001b[2J\u001b[3J"]
[0.008522, "o", "bash >> "]
[0.008683, "o", "ma"]
[0.189166, "o", "ke"]
[0.279481, "o", " -"]
[0.369776, "o", "f "]
[0.460021, "o", "em"]
[0.550229, "o", "be"]
[0.640359, "o", "dd"]
[0.730591, "o", "ed"]
[0.820572, "o", "/e"]
[0.910745, "o", "mb"]
[1.091087, "o", "ed"]
[1.181312, "o", "de"]
[1.271441, "o", "d."]
[1.361501, "o", "mk"]
[1.451615, "o", " h"]
[1.541783, "o", "el"]
[1.63204, "o", "p\r\n"]
[2.664242, "o", "\u001b[1;36musage:\u001b[0m\r\n\tmake <recipe>\r\n\t\r\n\texamples of embedded scripts in `\u001b[35mMakefile\u001b[0m`\r\n\r\n \u001b[1;31m examples of task.mk features \u001b[0m\r\n\u001b[38m ─────────────────────────────────────────────────────\u001b[0m\r\n\u001b[1;33m list-%\u001b[0m │ \u001b[2muse pathlib.Path to list files\u001b[0m\r\n \u001b[2mname the directory in rule (make list-src)\u001b[0m\r\n\u001b[1;33m embedded-bash\u001b[0m │ \u001b[2mbash script with pipes and make input\u001b[0m\r\n\u001b[1;33m h, help\u001b[0m │ \u001b[2mshow this help\u001b[0m\r\n\r\n"]
[4.671801, "o", "\u001b[H\u001b[2J\u001b[3Jbash >> "]
[4.67392, "o", "ma"]
[4.854455, "o", "ke"]
[4.944728, "o", " -"]
[5.034921, "o", "f "]
[5.124982, "o", "em"]
[5.215103, "o", "be"]
[5.305188, "o", "dd"]
[5.395353, "o", "ed"]
[5.485457, "o", "/e"]
[5.576246, "o", "mb"]
[5.75589, "o", "ed"]
[5.846014, "o", "de"]
[5.93612, "o", "d."]
[6.026298, "o", "mk"]
[6.11644, "o", " l"]
[6.206464, "o", "is"]
[6.296631, "o", "t-"]
[6.386781, "o", "em"]
[6.477052, "o", "be"]
[6.657201, "o", "dd"]
[6.747412, "o", "ed"]
[6.837566, "o", "\r\n"]
[7.867599, "o", "files in embedded\r\n['embedded.mk', 'demo.cast', 'record.sh', 'index.md']\r\n"]
[9.872436, "o", "\u001b[H\u001b[2J\u001b[3J"]
[9.872754, "o", "bash >> "]
[9.874651, "o", "ma"]
[10.055031, "o", "ke"]
[10.145171, "o", " -"]
[10.235256, "o", "f "]
[10.325347, "o", "em"]
[10.415525, "o", "be"]
[10.505721, "o", "dd"]
[10.595814, "o", "ed"]
[10.685931, "o", "/e"]
[10.776068, "o", "mb"]
[10.956362, "o", "ed"]
[11.046547, "o", "de"]
[11.136692, "o", "d."]
[11.226851, "o", "mk"]
[11.316894, "o", " e"]
[11.406996, "o", "mb"]
[11.497205, "o", "ed"]
[11.58725, "o", "de"]
[11.677471, "o", "d-"]
[11.85761, "o", "ba"]
[11.947917, "o", "sh"]
[12.038071, "o", "\r\n"]
[13.045213, "o", "Is the process running bash? We can check with ps\r\n"]
[13.051057, "o", "bash\r\n"]
[13.051385, "o", "What text to figlet? \r\n"]
[14.434504, "o", "t"]
[14.503239, "o", "a"]
[14.605384, "o", "s"]
[14.745978, "o", "k"]
[14.946139, "o", "."]
[15.080651, "o", "m"]
[15.228545, "o", "k"]
[15.617669, "o", "\r\n"]
[15.618495, "o", " _ _ _ \r\n| |_ __ _ ___| | __ _ __ ___ | | __\r\n| __/ _` / __| |/ / | '_ ` _ \\| |/ /\r\n| || (_| \\__ \\ < _| | | | | | < \r\n \\__\\__,_|___/_|\\_(_)_| |_| |_|_|\\_\\\r\n \r\n"]
[15.618636, "o", "the argument below as given in the makefile itself\r\n"]
[15.618695, "o", "it's expanded before the script is passed to bash\r\nbash multiline is probably working\r\n"]

BIN
examples/embedded/demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

View file

@ -0,0 +1,13 @@
Output demo.gif
Set FontSize 32
Set Width 1600
Set Height 800
Set Theme "Catppuccin Mocha"
Type "make help" Sleep 1s Enter Sleep 2s
Type "make list-'.'" Sleep 1s Enter Sleep 2s
Type "make embedded-bash" Sleep 1s Enter Sleep 2s
Type "input!!" Sleep 500ms Enter Sleep 2s
Sleep 2s

View file

@ -1,43 +0,0 @@
### examples of task.mk features | args: --divider --align center --msg-style b_red
define list_files_py
from pathlib import Path
print("files in $(2)")
print([f.name for f in (Path("$(2)").iterdir())])
endef
## list-% | use pathlib.Path to list files
### name the directory in rule (make list-src) | args: --align sep
list-%:
$(call py,list_files_py,$*)
# dollar signs will always be a problem
define bash_script
echo "Is the process running bash? We can check with ps"
ps -o args= -p $$$$ | grep -E -m 1 -o '\w{0,5}sh'
if [ -x "$(command -v figlet)" ]; then
echo 'no figlet :('
else
echo "What text to figlet? "
read name
figlet $$name
fi
echo "the argument below as given in the makefile itself"
echo "it's expanded before the script is passed to bash"
printf "%s\n" "$(2)"
endef
## embedded-bash | bash script with pipes and make input
.PHONY: embedded-bash
embedded-bash:
$(call tbash,bash_script,bash multiline is probably working)
define USAGE
{a.$(HEADER_STYLE)}usage:{a.end}
make <recipe>
examples of embedded scripts in `{a.magenta}Makefile{a.end}`
endef
.DEFAULT_GOAL = help
include $(shell git rev-parse --show-toplevel)/task.mk

View file

@ -14,10 +14,10 @@
<link rel="prev" href="../check/">
<link rel="next" href="../recipe-help/">
<link rel="next" href="../phonify/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
@ -25,7 +25,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/main.558e4712.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.2505c338.min.css">
@ -46,8 +46,6 @@
<link rel="stylesheet" href="../../stylesheets/extra.css">
<link rel="stylesheet" href="../../stylesheets/asciinema-player.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
@ -265,7 +263,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3" type="checkbox" id="__nav_3" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
@ -279,6 +277,8 @@
@ -292,7 +292,7 @@
</div>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
@ -312,7 +312,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_2" type="checkbox" id="__nav_3_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" >
@ -329,7 +329,7 @@
</div>
<nav class="md-nav" aria-label="Check" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
@ -358,7 +358,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_3" type="checkbox" id="__nav_3_3" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" checked>
@ -375,7 +375,7 @@
</div>
<nav class="md-nav" aria-label="Embedded" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
@ -402,7 +402,51 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_4" type="checkbox" id="__nav_3_4" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" >
<div class="md-nav__link md-nav__link--index ">
<a href="../phonify/">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
@ -419,8 +463,8 @@
</div>
<nav class="md-nav" aria-label="Recipe help" data-md-level="2">
<label class="md-nav__title" for="__nav_3_4">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
@ -479,50 +523,42 @@
<h1 id="embedded">Embedded</h1>
<div id="demo-cast"></div>
<div class="highlight"><span class="filename">embedded.mk</span><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c">### examples of task.mk features | args: --divider --align center --msg-style b_red</span>
<p><img alt="demo" src="demo.gif" /></p>
<div class="highlight"><span class="filename">Makefile (embedded)</span><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c">### examples of task.mk features |&gt; --divider --align center --msg-style b_red</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="cp">define list_files_py</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="err">from</span><span class="w"> </span><span class="err">pathlib</span><span class="w"> </span><span class="err">import</span><span class="w"> </span><span class="err">Path</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="err">print(</span><span class="s2">&quot;files in $(2)&quot;</span><span class="err">)</span>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="err">print([f.name</span><span class="w"> </span><span class="err">for</span><span class="w"> </span><span class="err">f</span><span class="w"> </span><span class="err">in</span><span class="w"> </span><span class="err">(Path(</span><span class="s2">&quot;$(2)&quot;</span><span class="err">).iterdir())])</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="cp">endef</span>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="c">## list-% | use pathlib.Path to list files</span>
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="c">### name the directory in rule (make list-src) | args: --align sep</span>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="c">## list-% |&gt; use pathlib.Path to list files</span>
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="c">### name the directory in rule (make list-src) |&gt; --align sep</span>
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="nf">list-%</span><span class="o">:</span>
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>py,list_files_py,<span class="nv">$*</span><span class="k">)</span>
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a>
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a><span class="c"># dollar signs will always be a problem</span>
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a><span class="c"># dollar signs will always be a problem :|</span>
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a><span class="cp">define bash_script</span>
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;Is the process running bash? We can check with ps&quot;</span>
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a><span class="err">ps</span><span class="w"> </span><span class="err">-o</span><span class="w"> </span><span class="nv">args</span><span class="o">=</span><span class="w"> </span>-p<span class="w"> </span><span class="nv">$$$$</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>-E<span class="w"> </span>-m<span class="w"> </span><span class="m">1</span><span class="w"> </span>-o<span class="w"> </span><span class="s1">&#39;\w{0,5}sh&#39;</span>
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a><span class="cp">if [ -x &quot;$(command -v figlet)&quot; ]; then</span>
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a><span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s1">&#39;no figlet :(&#39;</span>
<a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a><span class="cp">else</span>
<a id="__codelineno-0-20" name="__codelineno-0-20" href="#__codelineno-0-20"></a><span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;What text to figlet? &quot;</span>
<a id="__codelineno-0-21" name="__codelineno-0-21" href="#__codelineno-0-21"></a><span class="w"> </span><span class="nb">read</span><span class="w"> </span>name
<a id="__codelineno-0-22" name="__codelineno-0-22" href="#__codelineno-0-22"></a><span class="w"> </span>figlet<span class="w"> </span><span class="nv">$$</span>name
<a id="__codelineno-0-23" name="__codelineno-0-23" href="#__codelineno-0-23"></a><span class="err">fi</span>
<a id="__codelineno-0-24" name="__codelineno-0-24" href="#__codelineno-0-24"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;the argument below as given in the makefile itself&quot;</span>
<a id="__codelineno-0-25" name="__codelineno-0-25" href="#__codelineno-0-25"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;it&#39;s expanded before the script is passed to bash&quot;</span>
<a id="__codelineno-0-26" name="__codelineno-0-26" href="#__codelineno-0-26"></a><span class="err">printf</span><span class="w"> </span><span class="s2">&quot;%s\n&quot;</span><span class="w"> </span><span class="s2">&quot;$(2)&quot;</span>
<a id="__codelineno-0-27" name="__codelineno-0-27" href="#__codelineno-0-27"></a><span class="cp">endef</span>
<a id="__codelineno-0-28" name="__codelineno-0-28" href="#__codelineno-0-28"></a>
<a id="__codelineno-0-29" name="__codelineno-0-29" href="#__codelineno-0-29"></a><span class="c">## embedded-bash | bash script with pipes and make input</span>
<a id="__codelineno-0-30" name="__codelineno-0-30" href="#__codelineno-0-30"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">embedded</span>-<span class="n">bash</span>
<a id="__codelineno-0-31" name="__codelineno-0-31" href="#__codelineno-0-31"></a><span class="nf">embedded-bash</span><span class="o">:</span>
<a id="__codelineno-0-32" name="__codelineno-0-32" href="#__codelineno-0-32"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tbash,bash_script,bash<span class="w"> </span>multiline<span class="w"> </span>is<span class="w"> </span>probably<span class="w"> </span>working<span class="k">)</span>
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;Get input at runtime&quot;</span>
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a><span class="err">printf</span><span class="w"> </span><span class="s2">&quot;type input now! &quot;</span>
<a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a><span class="err">read</span><span class="w"> </span><span class="err">-r</span><span class="w"> </span><span class="err">name</span>
<a id="__codelineno-0-20" name="__codelineno-0-20" href="#__codelineno-0-20"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;you typed -&gt; $$name&quot;</span>
<a id="__codelineno-0-21" name="__codelineno-0-21" href="#__codelineno-0-21"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;the argument below as given in the makefile itself&quot;</span>
<a id="__codelineno-0-22" name="__codelineno-0-22" href="#__codelineno-0-22"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;it&#39;s expanded before the script is passed to bash&quot;</span>
<a id="__codelineno-0-23" name="__codelineno-0-23" href="#__codelineno-0-23"></a><span class="err">printf</span><span class="w"> </span><span class="s2">&quot;%s\n&quot;</span><span class="w"> </span><span class="s2">&quot;$(2)&quot;</span>
<a id="__codelineno-0-24" name="__codelineno-0-24" href="#__codelineno-0-24"></a><span class="cp">endef</span>
<a id="__codelineno-0-25" name="__codelineno-0-25" href="#__codelineno-0-25"></a>
<a id="__codelineno-0-26" name="__codelineno-0-26" href="#__codelineno-0-26"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">embedded</span>-<span class="n">bash</span>
<a id="__codelineno-0-27" name="__codelineno-0-27" href="#__codelineno-0-27"></a><span class="nf">embedded-bash</span><span class="o">:</span><span class="w"> </span><span class="c">## bash script with pipes and make input</span>
<a id="__codelineno-0-28" name="__codelineno-0-28" href="#__codelineno-0-28"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tbash,bash_script,bash<span class="w"> </span>multiline<span class="w"> </span>is<span class="w"> </span>working<span class="w"> </span>🤞<span class="k">)</span>
<a id="__codelineno-0-29" name="__codelineno-0-29" href="#__codelineno-0-29"></a>
<a id="__codelineno-0-30" name="__codelineno-0-30" href="#__codelineno-0-30"></a><span class="cp">define USAGE</span>
<a id="__codelineno-0-31" name="__codelineno-0-31" href="#__codelineno-0-31"></a><span class="nf">{a.$(HEADER_STYLE)}usage</span><span class="o">:</span>{<span class="n">a</span>.<span class="n">end</span>}\<span class="n">n</span> <span class="n">make</span> &lt;<span class="n">recipe</span>&gt;\<span class="n">n</span>\<span class="n">n</span> <span class="n">examples</span> <span class="n">of</span> <span class="n">embedded</span> <span class="n">scripts</span> <span class="n">in</span> `{<span class="n">a</span>.<span class="n">magenta</span>}<span class="n">Makefile</span>{<span class="n">a</span>.<span class="n">end</span>}`\<span class="n">n</span>
<a id="__codelineno-0-32" name="__codelineno-0-32" href="#__codelineno-0-32"></a><span class="cp">endef</span>
<a id="__codelineno-0-33" name="__codelineno-0-33" href="#__codelineno-0-33"></a>
<a id="__codelineno-0-34" name="__codelineno-0-34" href="#__codelineno-0-34"></a><span class="cp">define USAGE</span>
<a id="__codelineno-0-35" name="__codelineno-0-35" href="#__codelineno-0-35"></a><span class="nf">{a.$(HEADER_STYLE)}usage</span><span class="o">:</span>{<span class="n">a</span>.<span class="n">end</span>}
<a id="__codelineno-0-36" name="__codelineno-0-36" href="#__codelineno-0-36"></a><span class="w"> </span>make<span class="w"> </span>&lt;recipe&gt;
<a id="__codelineno-0-37" name="__codelineno-0-37" href="#__codelineno-0-37"></a>
<a id="__codelineno-0-38" name="__codelineno-0-38" href="#__codelineno-0-38"></a><span class="w"> </span>examples<span class="w"> </span>of<span class="w"> </span>embedded<span class="w"> </span>scripts<span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="sb">`</span><span class="o">{</span>a.magenta<span class="o">}</span>Makefile<span class="o">{</span>a.end<span class="o">}</span><span class="sb">`</span>
<a id="__codelineno-0-39" name="__codelineno-0-39" href="#__codelineno-0-39"></a>
<a id="__codelineno-0-40" name="__codelineno-0-40" href="#__codelineno-0-40"></a><span class="cp">endef</span>
<a id="__codelineno-0-41" name="__codelineno-0-41" href="#__codelineno-0-41"></a><span class="nv">.DEFAULT_GOAL</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">help</span>
<a id="__codelineno-0-42" name="__codelineno-0-42" href="#__codelineno-0-42"></a><span class="cp">include $(shell git rev-parse --show-toplevel)/task.mk</span>
<a id="__codelineno-0-34" name="__codelineno-0-34" href="#__codelineno-0-34"></a><span class="nv">.DEFAULT_GOAL</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">help</span>
<a id="__codelineno-0-35" name="__codelineno-0-35" href="#__codelineno-0-35"></a><span class="cp">include .task.mk</span>
</code></pre></div>
<hr>
@ -530,7 +566,7 @@
<small>
Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">September 19, 2022</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2023</span>
<br>
Created:
@ -576,26 +612,11 @@
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.indexes"], "search": "../../assets/javascripts/workers/search.e5c33ebb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.indexes"], "search": "../../assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.51d95adb.min.js"></script>
<script src="../../javascripts/asciinema-player.min.js"></script>
<script src="../../assets/javascripts/bundle.a00a7c5e.min.js"></script>
<script async>
AsciinemaPlayer.create('./demo.cast', document.getElementById('demo-cast'),{loop: true});
</script>
</body>
</html>

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
source "$(dirname "${BASH_SOURCE[0]}")/../functions.sh"
cmd 'make -f embedded/embedded.mk help'
cmd 'make -f embedded/embedded.mk list-embedded'
cmd 'make -f embedded/embedded.mk embedded-bash'
sleep 1

View file

@ -1,15 +0,0 @@
#!/usr/bin/env bash
msg() {
printf '%s\n' "$1" | pv -qL 20
sleep 1
}
cmd (){
clear
printf 'bash >> '
msg "$1"
$1
sleep 2
}

View file

@ -17,7 +17,7 @@
<link rel="next" href="check/">
<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
@ -25,7 +25,7 @@
<link rel="stylesheet" href="../assets/stylesheets/main.558e4712.min.css">
<link rel="stylesheet" href="../assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.2505c338.min.css">
@ -46,8 +46,6 @@
<link rel="stylesheet" href="../stylesheets/extra.css">
<link rel="stylesheet" href="../stylesheets/asciinema-player.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
@ -265,7 +263,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3" type="checkbox" id="__nav_3" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
@ -279,6 +277,8 @@
@ -292,7 +292,7 @@
</div>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
@ -312,7 +312,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_2" type="checkbox" id="__nav_3_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" >
@ -329,7 +329,7 @@
</div>
<nav class="md-nav" aria-label="Check" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
@ -356,7 +356,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_3" type="checkbox" id="__nav_3_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
@ -373,7 +373,7 @@
</div>
<nav class="md-nav" aria-label="Embedded" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
@ -400,7 +400,51 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_4" type="checkbox" id="__nav_3_4" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" >
<div class="md-nav__link md-nav__link--index ">
<a href="phonify/">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
@ -417,8 +461,8 @@
</div>
<nav class="md-nav" aria-label="Recipe help" data-md-level="2">
<label class="md-nav__title" for="__nav_3_4">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
@ -490,6 +534,10 @@
<dd>
<p>Display the target, docstring and recipe for a given target then exit.</p>
</dd>
<dt><a href="./phonify">Phonify</a></dt>
<dd>
<p>Automatically generate the phony call for any documented tasks.</p>
</dd>
</dl>
<hr>
@ -497,7 +545,7 @@
<small>
Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">September 24, 2022</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2023</span>
<br>
Created:
@ -543,22 +591,11 @@
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.indexes"], "search": "../assets/javascripts/workers/search.e5c33ebb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.indexes"], "search": "../assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../assets/javascripts/bundle.51d95adb.min.js"></script>
<script src="../javascripts/asciinema-player.min.js"></script>
<script src="../assets/javascripts/bundle.a00a7c5e.min.js"></script>
</body>
</html>

22
examples/phonify/Makefile Normal file
View file

@ -0,0 +1,22 @@
a-task: ## will be marked phony
@echo a-task executed
b-task: ## wont be marked phony |> --not-phony
@echo b-task executed
c-task:
@echo c-task executed
.PHONY: gen-task-files
gen-task-files:
touch a-task b-task c-task
define USAGE
{a.$(HEADER_STYLE)}usage:{a.end}\n make <recipe>\n
phonifying tasks
{a.faint}hint: there is also a c-task...{a.end}\n
endef
PHONIFY = true
.DEFAULT_GOAL = help
include .task.mk

0
examples/phonify/a-task Normal file
View file

0
examples/phonify/b-task Normal file
View file

0
examples/phonify/c-task Normal file
View file

BIN
examples/phonify/demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

View file

@ -0,0 +1,14 @@
Output demo.gif
Set FontSize 32
Set Width 1600
Set Height 800
Set Theme "Catppuccin Mocha"
Type "make help" Sleep 1s Enter Sleep 2s
Type "ls" Sleep 1s Enter Sleep 2s
Type "make a-task" Sleep 1s Enter Sleep 2s
Type "make b-task" Sleep 1s Enter Sleep 2s
Type "make c-task" Sleep 1s Enter Sleep 2s
Sleep 2s

609
examples/phonify/index.html Normal file
View file

@ -0,0 +1,609 @@
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="https://gh.dayl.in/task.mk/examples/phonify/">
<link rel="prev" href="../embedded/">
<link rel="next" href="../recipe-help/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
<title>Phonify - task.mk</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.2505c338.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../../stylesheets/extra.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="" data-md-color-accent="">
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#phonify" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="task.mk" class="md-header__button md-logo" aria-label="task.mk" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
task.mk
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Phonify
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="" data-md-color-accent="" aria-hidden="true" type="radio" name="__palette" id="__palette_1">
</form>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/daylinmorgan/task.mk" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
daylinmorgan/task.mk
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="task.mk" class="md-nav__button md-logo" aria-label="task.mk" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
task.mk
</label>
<div class="md-nav__source">
<a href="https://github.com/daylinmorgan/task.mk" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
daylinmorgan/task.mk
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item">
<a href="../../usage/" class="md-nav__link">
Usage
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
<div class="md-nav__link md-nav__link--index ">
<a href="../">Examples</a>
<label for="__nav_3">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" >
<div class="md-nav__link md-nav__link--index ">
<a href="../check/">Check</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
<div class="md-nav__link md-nav__link--index ">
<a href="../embedded/">Embedded</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" checked>
<div class="md-nav__link md-nav__link--index md-nav__link--active">
<a href="./">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
<div class="md-nav__link md-nav__link--index ">
<a href="../recipe-help/">Recipe help</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="phonify">Phonify</h1>
<p><img alt="demo" src="demo.gif" /></p>
<div class="highlight"><span class="filename">Makefile (phonify)</span><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">a-task</span><span class="o">:</span><span class="w"> </span><span class="c">## will be marked phony</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="w"> </span>@echo<span class="w"> </span>a-task<span class="w"> </span>executed
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="nf">b-task</span><span class="o">:</span><span class="w"> </span><span class="c">## wont be marked phony |&gt; --not-phony</span>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="w"> </span>@echo<span class="w"> </span>b-task<span class="w"> </span>executed
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="nf">c-task</span><span class="o">:</span>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="w"> </span>@echo<span class="w"> </span>c-task<span class="w"> </span>executed
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a>
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">gen</span>-<span class="n">task</span>-<span class="n">files</span>
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="nf">gen-task-files</span><span class="o">:</span>
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="w"> </span>touch<span class="w"> </span>a-task<span class="w"> </span>b-task<span class="w"> </span>c-task
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a>
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a><span class="cp">define USAGE</span>
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="nf">{a.$(HEADER_STYLE)}usage</span><span class="o">:</span>{<span class="n">a</span>.<span class="n">end</span>}\<span class="n">n</span> <span class="n">make</span> &lt;<span class="n">recipe</span>&gt;\<span class="n">n</span>
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a><span class="w"> </span>phonifying<span class="w"> </span>tasks
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a><span class="w"> </span><span class="o">{</span>a.faint<span class="o">}</span>hint:<span class="w"> </span>there<span class="w"> </span>is<span class="w"> </span>also<span class="w"> </span>a<span class="w"> </span>c-task...<span class="o">{</span>a.end<span class="o">}</span><span class="se">\n</span>
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a><span class="cp">endef</span>
<a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a>
<a id="__codelineno-0-20" name="__codelineno-0-20" href="#__codelineno-0-20"></a><span class="nv">PHONIFY</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">true</span>
<a id="__codelineno-0-21" name="__codelineno-0-21" href="#__codelineno-0-21"></a><span class="nv">.DEFAULT_GOAL</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">help</span>
<a id="__codelineno-0-22" name="__codelineno-0-22" href="#__codelineno-0-22"></a><span class="cp">include .task.mk</span>
</code></pre></div>
<hr>
<div class="md-source-file">
<small>
Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2023</span>
<br>
Created:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2023</span>
</small>
</div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.indexes"], "search": "../../assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.a00a7c5e.min.js"></script>
</body>
</html>

View file

@ -1,10 +1,8 @@
## deps-only | a task/target with dependencies
.PHONY: deps-only
deps-only: foo
deps-only: foo ## a task/target with dependencies
## foo | a dummy rule that depends on the local files
.PHONY: foo
foo: $(wildcard *)
foo: $(wildcard *) ## a dummy rule that depends on the local files
@echo 'this is a dummy rule'
# bar but no docstring
@ -20,5 +18,5 @@ define USAGE
endef
.DEFAULT_GOAL = help
include $(shell git rev-parse --show-toplevel)/task.mk
include .task.mk

View file

@ -1,138 +0,0 @@
{"version": 2, "width": 60, "height": 20, "timestamp": 1664060106, "env": {"SHELL": "/usr/bin/zsh", "TERM": "xterm-256color"}}
[0.007806, "o", "\u001b[H\u001b[2J\u001b[3J"]
[0.008354, "o", "bash >> "]
[0.008532, "o", "ma"]
[0.189207, "o", "ke"]
[0.279458, "o", " -"]
[0.369697, "o", "f "]
[0.459892, "o", "re"]
[0.550111, "o", "ci"]
[0.640099, "o", "pe"]
[0.730309, "o", "-h"]
[0.820408, "o", "el"]
[0.910572, "o", "p/"]
[1.090837, "o", "re"]
[1.180944, "o", "ci"]
[1.271024, "o", "pe"]
[1.36131, "o", "-h"]
[1.451464, "o", "el"]
[1.541712, "o", "p."]
[1.631676, "o", "mk"]
[1.721815, "o", " h"]
[1.812133, "o", "el"]
[1.99248, "o", "p\r\n"]
[3.025715, "o", "\u001b[1;36musage:\u001b[0m\r\n\tmake <recipe>\r\n\tmake help <recipe>\r\n\r\n\u001b[1;33m deps-only\u001b[0m │ \u001b[2ma task/target with dependencies\u001b[0m\r\n\u001b[1;33m foo\u001b[0m │ \u001b[2ma dummy rule that depends on the local files\u001b[0m\r\n\u001b[1;33m h, help\u001b[0m │ \u001b[2mshow this help\u001b[0m\r\n\r\n"]
[5.032814, "o", "\u001b[H\u001b[2J\u001b[3Jbash >> "]
[5.034705, "o", "ma"]
[5.215256, "o", "ke"]
[5.305482, "o", " -"]
[5.395504, "o", "f "]
[5.485805, "o", "re"]
[5.576036, "o", "ci"]
[5.666095, "o", "pe"]
[5.756177, "o", "-h"]
[5.846563, "o", "el"]
[5.93671, "o", "p/"]
[6.11689, "o", "re"]
[6.206935, "o", "ci"]
[6.297128, "o", "pe"]
[6.387205, "o", "-h"]
[6.477454, "o", "el"]
[6.567496, "o", "p."]
[6.657713, "o", "mk"]
[6.747729, "o", " h"]
[6.838006, "o", "el"]
[7.018242, "o", "p "]
[7.108261, "o", "he"]
[7.198405, "o", "lp"]
[7.288809, "o", "\r\n"]
[8.318829, "o", "\u001b[1;36mtask.mk recipe help\u001b[0m\r\n\r\n"]
[8.325694, "o", " \u001b[1;33mh help\u001b[0m\r\n\u001b[38m ────────────────────────────────────────────────────────\u001b[0m\r\n $(call py,help_py) || { echo \"exiting early!\"; exit 1; }\r\n\r\n"]
[8.329695, "o", "exiting early!\r\nmake[1]: *** [/home/daylin/dev/github/mine/task.mk/task.mk:30: help] Error 1\r\n"]
[10.332715, "o", "\u001b[H\u001b[2J\u001b[3J"]
[10.333056, "o", "bash >> "]
[10.335005, "o", "ma"]
[10.515605, "o", "ke"]
[10.605896, "o", " -"]
[10.696226, "o", "f "]
[10.78629, "o", "re"]
[10.876669, "o", "ci"]
[10.966704, "o", "pe"]
[11.056858, "o", "-h"]
[11.146831, "o", "el"]
[11.236969, "o", "p/"]
[11.417281, "o", "re"]
[11.507468, "o", "ci"]
[11.597442, "o", "pe"]
[11.687589, "o", "-h"]
[11.777832, "o", "el"]
[11.867969, "o", "p."]
[11.958105, "o", "mk"]
[12.048177, "o", " h"]
[12.138291, "o", "el"]
[12.318676, "o", "p "]
[12.408796, "o", "de"]
[12.498823, "o", "ps"]
[12.588985, "o", "-o"]
[12.679133, "o", "nl"]
[12.769237, "o", "y\r\n"]
[13.807661, "o", "\u001b[1;36mtask.mk recipe help\u001b[0m\r\n\r\n"]
[13.816448, "o", "\u001b[1;33m deps-only\u001b[0m │ \u001b[2ma task/target with dependencies\u001b[0m\r\n \u001b[38mdeps\u001b[0m: \u001b[2mfoo\u001b[0m\r\n\r\n"]
[13.820255, "o", "exiting early!\r\n"]
[13.820461, "o", "make[1]: *** [/home/daylin/dev/github/mine/task.mk/task.mk:30: help] Error 1\r\n"]
[15.823763, "o", "\u001b[H\u001b[2J\u001b[3J"]
[15.824036, "o", "bash >> "]
[15.826016, "o", "ma"]
[16.006673, "o", "ke"]
[16.09685, "o", " -"]
[16.186936, "o", "f "]
[16.277228, "o", "re"]
[16.367339, "o", "ci"]
[16.45744, "o", "pe"]
[16.547483, "o", "-h"]
[16.637622, "o", "el"]
[16.727742, "o", "p/"]
[16.907989, "o", "re"]
[16.99817, "o", "ci"]
[17.088391, "o", "pe"]
[17.178352, "o", "-h"]
[17.268476, "o", "el"]
[17.358766, "o", "p."]
[17.448842, "o", "mk"]
[17.539039, "o", " h"]
[17.629197, "o", "el"]
[17.809354, "o", "p "]
[17.899578, "o", "fo"]
[17.989694, "o", "o\r\n"]
[19.020047, "o", "\u001b[1;36mtask.mk recipe help\u001b[0m\r\n\r\n"]
[19.03039, "o", "\u001b[1;33m foo\u001b[0m │ \u001b[2ma dummy rule that depends on the local files\u001b[0m\r\n \u001b[38mdeps\u001b[0m: \u001b[2mcheck embedded functions.sh index.md Makefile recipe-help\u001b[0m\r\n\u001b[38m ────────────────────────────\u001b[0m\r\n @echo 'this is a dummy rule'\r\n\r\n"]
[19.035496, "o", "exiting early!\r\n"]
[19.035706, "o", "make[1]: *** [/home/daylin/dev/github/mine/task.mk/task.mk:30: help] Error 1\r\n"]
[21.039168, "o", "\u001b[H\u001b[2J\u001b[3J"]
[21.03927, "o", "bash >> "]
[21.041378, "o", "ma"]
[21.221916, "o", "ke"]
[21.31205, "o", " -"]
[21.402214, "o", "f "]
[21.492482, "o", "re"]
[21.582638, "o", "ci"]
[21.672609, "o", "pe"]
[21.762748, "o", "-h"]
[21.853045, "o", "el"]
[21.943154, "o", "p/"]
[22.123286, "o", "re"]
[22.2134, "o", "ci"]
[22.303509, "o", "pe"]
[22.393685, "o", "-h"]
[22.483815, "o", "el"]
[22.574005, "o", "p."]
[22.664056, "o", "mk"]
[22.754229, "o", " h"]
[22.844432, "o", "el"]
[23.02464, "o", "p "]
[23.114692, "o", "ba"]
[23.205123, "o", "r\r\n"]
[24.260098, "o", "\u001b[1;36mtask.mk recipe help\u001b[0m\r\n\r\n"]
[24.267129, "o", " \u001b[1;33mbar\u001b[0m\r\n\u001b[38m ─────────────────────────────────────\u001b[0m\r\n @echo 'some rule with no help string'\r\n\r\n"]
[24.271004, "o", "exiting early!\r\n"]
[24.271137, "o", "make[1]: *** [/home/daylin/dev/github/mine/task.mk/task.mk:30: help] Error 1\r\n"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

View file

@ -0,0 +1,14 @@
Output demo.gif
Set FontSize 32
Set Width 1600
Set Height 800
Set Theme "Catppuccin Mocha"
Type "make help" Sleep 1s Enter Sleep 2s
Type "make help help" Sleep 1s Enter Sleep 2s
Type "make help deps-only" Sleep 1s Enter Sleep 2s
Type "make help foo" Sleep 1s Enter Sleep 2s
Type "make help bar" Sleep 1s Enter Sleep 2s
Sleep 2s

View file

@ -11,11 +11,11 @@
<link rel="canonical" href="https://gh.dayl.in/task.mk/examples/recipe-help/">
<link rel="prev" href="../embedded/">
<link rel="prev" href="../phonify/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
@ -23,7 +23,7 @@
<link rel="stylesheet" href="../../assets/stylesheets/main.558e4712.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.2505c338.min.css">
@ -44,8 +44,6 @@
<link rel="stylesheet" href="../../stylesheets/extra.css">
<link rel="stylesheet" href="../../stylesheets/asciinema-player.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
@ -263,7 +261,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3" type="checkbox" id="__nav_3" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
@ -277,6 +275,8 @@
@ -290,7 +290,7 @@
</div>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
@ -310,7 +310,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_2" type="checkbox" id="__nav_3_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" >
@ -327,7 +327,7 @@
</div>
<nav class="md-nav" aria-label="Check" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
@ -354,7 +354,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_3" type="checkbox" id="__nav_3_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
@ -371,7 +371,7 @@
</div>
<nav class="md-nav" aria-label="Embedded" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
@ -391,6 +391,50 @@
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" >
<div class="md-nav__link md-nav__link--index ">
<a href="../phonify/">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
@ -400,7 +444,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_4" type="checkbox" id="__nav_3_4" checked>
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" checked>
@ -417,8 +461,8 @@
</div>
<nav class="md-nav" aria-label="Recipe help" data-md-level="2">
<label class="md-nav__title" for="__nav_3_4">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
@ -477,31 +521,28 @@
<h1 id="recipe-help">Recipe Help</h1>
<div id="demo-cast"></div>
<div class="highlight"><span class="filename">recipe-help.mk</span><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c">## deps-only | a task/target with dependencies</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">deps</span>-<span class="n">only</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="nf">deps-only</span><span class="o">:</span><span class="w"> </span><span class="n">foo</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="c">## foo | a dummy rule that depends on the local files</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">foo</span>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="nf">foo</span><span class="o">:</span><span class="w"> </span><span class="k">$(</span><span class="nv">wildcard</span> *<span class="k">)</span>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="w"> </span>@echo<span class="w"> </span><span class="s1">&#39;this is a dummy rule&#39;</span>
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a>
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="c"># bar but no docstring</span>
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">bar</span>
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="nf">bar</span><span class="o">:</span>
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a><span class="w"> </span>@echo<span class="w"> </span><span class="s1">&#39;some rule with no help string&#39;</span>
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a>
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="cp">define USAGE</span>
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a><span class="nf">{a.header}usage</span><span class="o">:</span>{<span class="n">a</span>.<span class="n">end</span>}
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a><span class="w"> </span>make<span class="w"> </span>&lt;recipe&gt;
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a><span class="w"> </span>make<span class="w"> </span><span class="nb">help</span><span class="w"> </span>&lt;recipe&gt;
<p><img alt="demo" src="demo.gif" /></p>
<div class="highlight"><span class="filename">Makefile (recipe-help)</span><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">deps</span>-<span class="n">only</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nf">deps-only</span><span class="o">:</span><span class="w"> </span><span class="n">foo</span> <span class="c">## a task/target with dependencies</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">foo</span>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="nf">foo</span><span class="o">:</span><span class="w"> </span><span class="k">$(</span><span class="nv">wildcard</span> *<span class="k">)</span> <span class="c">## a dummy rule that depends on the local files</span>
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="w"> </span>@echo<span class="w"> </span><span class="s1">&#39;this is a dummy rule&#39;</span>
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a>
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="c"># bar but no docstring</span>
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">bar</span>
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="nf">bar</span><span class="o">:</span>
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="w"> </span>@echo<span class="w"> </span><span class="s1">&#39;some rule with no help string&#39;</span>
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a>
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a><span class="cp">define USAGE</span>
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a><span class="nf">{a.header}usage</span><span class="o">:</span>{<span class="n">a</span>.<span class="n">end</span>}
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="w"> </span>make<span class="w"> </span>&lt;recipe&gt;
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a><span class="w"> </span>make<span class="w"> </span><span class="nb">help</span><span class="w"> </span>&lt;recipe&gt;
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a>
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a><span class="cp">endef</span>
<a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a>
<a id="__codelineno-0-20" name="__codelineno-0-20" href="#__codelineno-0-20"></a><span class="cp">endef</span>
<a id="__codelineno-0-21" name="__codelineno-0-21" href="#__codelineno-0-21"></a>
<a id="__codelineno-0-22" name="__codelineno-0-22" href="#__codelineno-0-22"></a><span class="nv">.DEFAULT_GOAL</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">help</span>
<a id="__codelineno-0-23" name="__codelineno-0-23" href="#__codelineno-0-23"></a><span class="cp">include $(shell git rev-parse --show-toplevel)/task.mk</span>
<a id="__codelineno-0-20" name="__codelineno-0-20" href="#__codelineno-0-20"></a><span class="nv">.DEFAULT_GOAL</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">help</span>
<a id="__codelineno-0-21" name="__codelineno-0-21" href="#__codelineno-0-21"></a><span class="cp">include .task.mk</span>
</code></pre></div>
<hr>
@ -509,7 +550,7 @@
<small>
Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">September 24, 2022</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2023</span>
<br>
Created:
@ -555,26 +596,11 @@
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.indexes"], "search": "../../assets/javascripts/workers/search.e5c33ebb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.indexes"], "search": "../../assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.51d95adb.min.js"></script>
<script src="../../javascripts/asciinema-player.min.js"></script>
<script src="../../assets/javascripts/bundle.a00a7c5e.min.js"></script>
<script async>
AsciinemaPlayer.create('./demo.cast', document.getElementById('demo-cast'),{loop: true});
</script>
</body>
</html>

View file

@ -1,11 +0,0 @@
#!/usr/bin/env bash
source "$(dirname "${BASH_SOURCE[0]}")/../functions.sh"
cmd 'make -f recipe-help/recipe-help.mk help'
cmd 'make -f recipe-help/recipe-help.mk help help'
cmd 'make -f recipe-help/recipe-help.mk help deps-only'
cmd 'make -f recipe-help/recipe-help.mk help foo'
cmd 'make -f recipe-help/recipe-help.mk help bar'
sleep 1

View file

@ -15,7 +15,7 @@
<link rel="next" href="usage/">
<link rel="icon" href="assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
@ -23,7 +23,7 @@
<link rel="stylesheet" href="assets/stylesheets/main.558e4712.min.css">
<link rel="stylesheet" href="assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="assets/stylesheets/palette.2505c338.min.css">
@ -44,8 +44,6 @@
<link rel="stylesheet" href="stylesheets/extra.css">
<link rel="stylesheet" href="stylesheets/asciinema-player.css">
<script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
@ -229,7 +227,7 @@
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
@ -260,27 +258,6 @@
Setup
</a>
</li>
<li class="md-nav__item">
<a href="#zsh-completions-for-gnu-make" class="md-nav__link">
Zsh Completions for GNU Make
</a>
</li>
<li class="md-nav__item">
<a href="#why-make" class="md-nav__link">
Why Make?
</a>
</li>
<li class="md-nav__item">
<a href="#simpler-alternative" class="md-nav__link">
Simpler Alternative
</a>
</li>
</ul>
@ -319,7 +296,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
@ -333,6 +310,8 @@
@ -346,7 +325,7 @@
</div>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
@ -366,7 +345,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_2" type="checkbox" id="__nav_3_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" >
@ -383,7 +362,7 @@
</div>
<nav class="md-nav" aria-label="Check" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
@ -410,7 +389,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_3" type="checkbox" id="__nav_3_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
@ -427,7 +406,7 @@
</div>
<nav class="md-nav" aria-label="Embedded" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
@ -454,7 +433,51 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_4" type="checkbox" id="__nav_3_4" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" >
<div class="md-nav__link md-nav__link--index ">
<a href="examples/phonify/">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
@ -471,8 +494,8 @@
</div>
<nav class="md-nav" aria-label="Recipe help" data-md-level="2">
<label class="md-nav__title" for="__nav_3_4">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
@ -522,27 +545,6 @@
Setup
</a>
</li>
<li class="md-nav__item">
<a href="#zsh-completions-for-gnu-make" class="md-nav__link">
Zsh Completions for GNU Make
</a>
</li>
<li class="md-nav__item">
<a href="#why-make" class="md-nav__link">
Why Make?
</a>
</li>
<li class="md-nav__item">
<a href="#simpler-alternative" class="md-nav__link">
Simpler Alternative
</a>
</li>
</ul>
@ -568,10 +570,13 @@
<div align="center">
<h1 align="center"> task.mk </h1>
<img src="https://raw.githubusercontent.com/daylinmorgan/task.mk/main/assets/help.svg" alt="help" width=400 >
<img src="./assets/help.svg" alt="help" width=400 >
<p align="center">
the task runner for GNU Make you've been missing
</p>
<p align="center">
<a href="https://gh.dayl.in/task.mk">Documentation</a>
</p>
</div>
<p></br></p>
<p>GNU make is an excellent build tool and the task runner we love to hate, but can't escape.
@ -580,61 +585,37 @@ So let's improve the UX to make it the best task runner it can be.</p>
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>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 <a href="https://github.com/daylinmorgan/task.mk/v23.1.1/task.mk"><code>.task.mk</code></a>.
You can automagically include it with just two additional lines to your <code>Makefile</code> (and probably one to your <code>.gitignore</code>) and your good to go.</p>
I agree, all you need is one file <a href="https://github.com/daylinmorgan/task.mk/blob/main/task.mk"><code>.task.mk</code></a>
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>
<h2 id="setup">Setup</h2>
<p>One line setup to download .task.mk and add appropriate includes to your <code>Makefile</code>.
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>bash<span class="w"> </span>&lt;<span class="o">(</span>curl<span class="w"> </span>-fsSL<span class="w"> </span>gh.dayl.in/task.mk/init<span class="o">)</span><span class="w"> </span><span class="c1"># or w/ TASKMK_VERSION=</span>
</code></pre></div></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>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="cp">-include .task.mk</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nf">$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk</span><span class="o">:</span><span class="w"> </span>; <span class="n">curl</span> -<span class="n">fsSL</span> <span class="n">https</span>://<span class="n">raw</span>.<span class="n">githubusercontent</span>.<span class="n">com</span>/<span class="n">daylinmorgan</span>/<span class="n">task</span>.<span class="n">mk</span>/<span class="n">v</span>23.1.1/<span class="n">task</span>.<span class="n">mk</span> -<span class="n">o</span> .<span class="n">task</span>.<span class="n">mk</span>))
</code></pre></div>
<p>You might also consider making it a consistently downloaded dependency if you plan to use any of it's advanced feature set, by dropping the <code>$(MAKECMDGOALS)</code> check.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="cp">-include .task.mk</span>
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="nf">$(if $(wildcard .task.mk),,.task.mk</span><span class="o">:</span><span class="w"> </span>; <span class="n">curl</span> -<span class="n">fsSL</span> <span class="n">https</span>://<span class="n">raw</span>.<span class="n">githubusercontent</span>.<span class="n">com</span>/<span class="n">daylinmorgan</span>/<span class="n">task</span>.<span class="n">mk</span>/<span class="n">v</span>23.1.1/<span class="n">task</span>.<span class="n">mk</span> -<span class="n">o</span> .<span class="n">task</span>.<span class="n">mk</span>)
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="nf">$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk</span><span class="o">:</span><span class="w"> </span>; <span class="n">curl</span> -<span class="n">fsSL</span> <span class="n">https</span>://<span class="n">raw</span>.<span class="n">githubusercontent</span>.<span class="n">com</span>/<span class="n">daylinmorgan</span>/<span class="n">task</span>.<span class="n">mk</span>/<span class="n">v</span>23.1.2/<span class="n">task</span>.<span class="n">mk</span> -<span class="n">o</span> .<span class="n">task</span>.<span class="n">mk</span>))
</code></pre></div>
<p>Alternatively, you can use the builtin rule <code>_update-task.mk</code> to update to the latest development version.</p>
<p>See <a href="./usage">Usage</a> to get started running all your tasks.
See <a href="./examples">Examples</a> for more use cases.</p>
<h2 id="zsh-completions-for-gnu-make">Zsh Completions for GNU Make</h2>
<p>If you use <code>GNU Make</code> with zsh you may want to add the following
line to your rc file to allow <code>make</code> to handle the autocomplete.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>zstyle<span class="w"> </span><span class="s1">&#39;:completion::complete:make:*:targets&#39;</span><span class="w"> </span>call-command<span class="w"> </span><span class="nb">true</span>
</code></pre></div>
<h2 id="why-make">Why Make?</h2>
<p>There are lot of <code>GNU Make</code> alternatives but none have near the same level of ubiquity.
This project attaches to <code>make</code> some of the native features of <a href="https://github.com/casey/just"><code>just</code></a>, a command runner.</p>
<p>Just is a great task runner, but it suffers two problems, users probably don't have it installed already, and there is no way to define file specific recipes.
Most of my <code>Makefile</code>'s are comprised primarily of handy <code>.PHONY</code> recipes, but I always end up with a few file specific recipes.</p>
<p>Another interesting project I've evaluated for these purposes is <a href="https://github.com/go-task/task"><code>go-task/task</code></a>.
<code>Task</code> has many of the features of <code>GNU Make</code> and some novel features of it's own.
But like <code>just</code> it's a tool people don't usually already have and it's configured using a <code>yaml</code> file.
<code>Yaml</code> files can be finicky to work with and and it uses a golang based shell runtime, not your native shell, which might lead to unexpected behavior.</p>
<h2 id="simpler-alternative">Simpler Alternative</h2>
<p>But I just want a basic help output, surely I don't need python for this... you would be right.
<code>Task.mk</code> replaces my old <code>make help</code> recipe boilerplate which may better serve you (so long as you have <code>sed</code>/<code>awk</code>).</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="c">## h, help | show this help</span>
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">help</span> <span class="n">h</span>
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="nf">help h</span><span class="o">:</span><span class="w"> </span><span class="n">Makefile</span>
<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span>@awk<span class="w"> </span>-v<span class="w"> </span><span class="nv">fill</span><span class="o">=</span><span class="k">$(</span>shell<span class="w"> </span>sed<span class="w"> </span>-n<span class="w"> </span><span class="s1">&#39;s/^## \(.*\) | .*/\1/p&#39;</span><span class="w"> </span>$&lt;<span class="w"> </span><span class="p">|</span><span class="w"> </span>wc<span class="w"> </span>-L<span class="k">)</span><span class="se">\</span>
<a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="w"> </span><span class="s1">&#39;match($$0,/^## (.*) \|/,name) &amp;&amp; match($$0,/\| (.*)$$/,help)\</span>
<a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="s1"> {printf &quot;\033[1;93m%*s\033[0m | \033[30m%s\033[0m\n&quot;,\</span>
<a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="s1"> fill,name[1],help[1];} match($$0,/^### (.*)/,str) \</span>
<a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="s1"> {printf &quot;%*s \033[30m%s\033[0m\n&quot;,fill,&quot; &quot;,str[1];}&#39;</span><span class="w"> </span>$&lt;
<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>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="cp">-include .task.mk</span>
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="nf">$(if $(wildcard .task.mk),,.task.mk</span><span class="o">:</span><span class="w"> </span>; <span class="n">curl</span> -<span class="n">fsSL</span> <span class="n">https</span>://<span class="n">raw</span>.<span class="n">githubusercontent</span>.<span class="n">com</span>/<span class="n">daylinmorgan</span>/<span class="n">task</span>.<span class="n">mk</span>/<span class="n">v</span>23.1.2/<span class="n">task</span>.<span class="n">mk</span> -<span class="n">o</span> .<span class="n">task</span>.<span class="n">mk</span>)
</code></pre></div>
<p>For more info see the <a href="https://gh.dayl.in/task.mk">documentation</a>.</p>
<hr>
<div class="md-source-file">
<small>
Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 20, 2023</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 30, 2023</span>
<br>
Created:
@ -680,22 +661,11 @@ But like <code>just</code> it's a tool people don't usually already have and it'
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": ".", "features": ["navigation.indexes"], "search": "assets/javascripts/workers/search.e5c33ebb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script id="__config" type="application/json">{"base": ".", "features": ["navigation.indexes"], "search": "assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="assets/javascripts/bundle.51d95adb.min.js"></script>
<script src="javascripts/asciinema-player.min.js"></script>
<script src="assets/javascripts/bundle.a00a7c5e.min.js"></script>
</body>
</html>

18
init
View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
LATEST_TASKMK_VERSION=v23.1.1
LATEST_TASKMK_VERSION="v23.1.2"
VERSION=${TASKMK_VERSION:-$LATEST_TASKMK_VERSION}
printf "Initializing Task.mk (%s) for repo\n" "$VERSION"
if [ -f "./.task.mk" ]; then
@ -11,20 +11,22 @@ if [ -f "./.task.mk" ]; then
fi
curl -fsSL "https://raw.githubusercontent.com/daylinmorgan/task.mk/$VERSION/task.mk" -o .task.mk
echo .task.mk >>.gitignore
echo '-include .task.cfg.mk .task.mk' >>Makefile
printf '$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/%s/task.mk -o .task.mk))' \
printf '\n-include .task.cfg.mk\n' >>Makefile
printf '%s %s\n' '-include' '.task.mk' >>.task.cfg.mk
printf '$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/%s/task.mk -o .task.mk))\n' \
"$VERSION" \
>>Makefile
>>.task.cfg.mk
printf ".task.mk files added to repo\n\n"
echo "Do you want to commit these changes?"
printf "RUN COMMAND: %s (Y/n) " \
"git add Makefile .gitignore && git commit -m \"chore: initialize .task.mk\""
printf "Run the below command?\n\n %s (Y/n) " \
"git add Makefile .gitignore .task.cfg.mk && git commit -m \"chore: initialize .task.mk\""
read -r answer
read -r answer </dev/tty
# if echo "$answer" | grep -iq "^y" ;then
if [ "$answer" != "${answer#[Yy]}" ]; then
git add Makefile .gitignore && git commit -m "chore: initialize .task.mk"
git add Makefile .gitignore .task.cfg.mk &&
git commit -m "chore: initialize .task.mk"
echo finished.
else
echo finished.

File diff suppressed because one or more lines are too long

View file

@ -1,16 +0,0 @@
{% extends "base.html" %}
{% block scripts %}
{{ super() }}
{% if page.meta %}
{% if page.meta.asciinema %}
<script async>
AsciinemaPlayer.create('./demo.cast', document.getElementById('demo-cast'),{loop: true});
</script>
{% endif %}
{% endif %}
{% endblock %}

File diff suppressed because one or more lines are too long

View file

@ -2,32 +2,37 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://gh.dayl.in/task.mk/</loc>
<lastmod>2023-01-22</lastmod>
<lastmod>2023-01-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://gh.dayl.in/task.mk/usage/</loc>
<lastmod>2023-01-22</lastmod>
<lastmod>2023-01-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://gh.dayl.in/task.mk/examples/</loc>
<lastmod>2023-01-22</lastmod>
<lastmod>2023-01-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://gh.dayl.in/task.mk/examples/check/</loc>
<lastmod>2023-01-22</lastmod>
<lastmod>2023-01-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://gh.dayl.in/task.mk/examples/embedded/</loc>
<lastmod>2023-01-22</lastmod>
<lastmod>2023-01-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://gh.dayl.in/task.mk/examples/phonify/</loc>
<lastmod>2023-01-30</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://gh.dayl.in/task.mk/examples/recipe-help/</loc>
<lastmod>2023-01-22</lastmod>
<lastmod>2023-01-30</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,7 @@
<link rel="next" href="../examples/">
<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.8">
@ -25,7 +25,7 @@
<link rel="stylesheet" href="../assets/stylesheets/main.558e4712.min.css">
<link rel="stylesheet" href="../assets/stylesheets/main.0d440cfe.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.2505c338.min.css">
@ -46,8 +46,6 @@
<link rel="stylesheet" href="../stylesheets/extra.css">
<link rel="stylesheet" href="../stylesheets/asciinema-player.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
@ -246,7 +244,7 @@
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
@ -276,6 +274,60 @@
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#builtin-recipes" class="md-nav__link">
Builtin Recipes
</a>
<nav class="md-nav" aria-label="Builtin Recipes">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#help" class="md-nav__link">
Help
</a>
</li>
<li class="md-nav__item">
<a href="#vars" class="md-nav__link">
Vars
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#builtin-functions" class="md-nav__link">
Builtin Functions
</a>
<nav class="md-nav" aria-label="Builtin Functions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#phonify" class="md-nav__link">
Phonify
</a>
</li>
<li class="md-nav__item">
<a href="#tprint" class="md-nav__link">
Tprint
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#configuration" class="md-nav__link">
Configuration
@ -284,8 +336,8 @@
</li>
<li class="md-nav__item">
<a href="#advanced-usage-embedded-python-scripts" class="md-nav__link">
Advanced Usage: Embedded Python Scripts
<a href="#advanced-usage-embedded-scripts" class="md-nav__link">
Advanced Usage: Embedded Scripts
</a>
</li>
@ -311,7 +363,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
@ -325,6 +377,8 @@
@ -338,7 +392,7 @@
</div>
<nav class="md-nav" aria-label="Examples" data-md-level="1">
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Examples
@ -358,7 +412,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_2" type="checkbox" id="__nav_3_2" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2" >
@ -375,7 +429,7 @@
</div>
<nav class="md-nav" aria-label="Check" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_2">
<span class="md-nav__icon md-icon"></span>
Check
@ -402,7 +456,7 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_3" type="checkbox" id="__nav_3_3" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_3" >
@ -419,7 +473,7 @@
</div>
<nav class="md-nav" aria-label="Embedded" data-md-level="2">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_3">
<span class="md-nav__icon md-icon"></span>
Embedded
@ -446,7 +500,51 @@
<input class="md-nav__toggle md-toggle " data-md-toggle="__nav_3_4" type="checkbox" id="__nav_3_4" >
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_4" >
<div class="md-nav__link md-nav__link--index ">
<a href="../examples/phonify/">Phonify</a>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_4">
<span class="md-nav__icon md-icon"></span>
Phonify
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" >
@ -463,8 +561,8 @@
</div>
<nav class="md-nav" aria-label="Recipe help" data-md-level="2">
<label class="md-nav__title" for="__nav_3_4">
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_5">
<span class="md-nav__icon md-icon"></span>
Recipe help
</label>
@ -511,6 +609,60 @@
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#builtin-recipes" class="md-nav__link">
Builtin Recipes
</a>
<nav class="md-nav" aria-label="Builtin Recipes">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#help" class="md-nav__link">
Help
</a>
</li>
<li class="md-nav__item">
<a href="#vars" class="md-nav__link">
Vars
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#builtin-functions" class="md-nav__link">
Builtin Functions
</a>
<nav class="md-nav" aria-label="Builtin Functions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#phonify" class="md-nav__link">
Phonify
</a>
</li>
<li class="md-nav__item">
<a href="#tprint" class="md-nav__link">
Tprint
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#configuration" class="md-nav__link">
Configuration
@ -519,8 +671,8 @@
</li>
<li class="md-nav__item">
<a href="#advanced-usage-embedded-python-scripts" class="md-nav__link">
Advanced Usage: Embedded Python Scripts
<a href="#advanced-usage-embedded-scripts" class="md-nav__link">
Advanced Usage: Embedded Scripts
</a>
</li>
@ -545,90 +697,115 @@
<h1 id="usage">Usage</h1>
<p><code>Task.mk</code> will add access to a recipe <code>help</code> (also aliased to <code>h</code>).
In order to use <code>make help</code> to you will need to add some custom comments to your <code>Makefile</code>.</p>
<p>Deliberately, I don't get names from recipes themselves.
This not only greatly simplifies the parsing but add's some opportunity to customize the output.
Such as to document wildcard or redundant recipes.</p>
<p>You can place these anywhere, but I recommend adding these notes directly above their relevant recipes.
The format is <code>## &lt;recipe&gt; | &lt;msg&gt;</code></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c">## build | build the project</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">build</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="nf">build</span><span class="o">:</span>
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span>...
<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 <a href="/task.mk/examples">examples</a> for more info.</p>
<h2 id="builtin-recipes">Builtin Recipes</h2>
<h3 id="help">Help</h3>
<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>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c">## build |&gt; build the project</span>
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nf">build</span><span class="o">:</span>
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="w"> </span>...
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="nf">build</span><span class="o">:</span><span class="w"> </span><span class="c">## build the project</span>
</code></pre></div>
<p>Now when you invoke <code>make help</code> it will parse these and generate your help output.</p>
<p>In addition to a generic help output you can expose some configuration settings with <code>make vars</code>.
<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>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="c">### build related recipes |&gt; --align center --divider</span>
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="nf">build</span><span class="o">:</span><span class="w"> </span><span class="c">## build the project |&gt; --msg-style bold</span>
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="w"> </span>...
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="nf">package</span><span class="o">:</span><span class="w"> </span><span class="c">## package the project |&gt; -gs b_cyan</span>
</code></pre></div>
<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>
<h3 id="vars">Vars</h3>
<p>In addition to a generic help output you can expose some configuration settings with <code>make vars</code> or <code>make v</code>.
To do so define the variables you'd like to print with <code>PRINT_VARS := VAR1 VAR2 VAR3</code>.</p>
<p>In addition to the <code>help</code> and <code>vars</code> recipes you can use a custom make function to format your text for fancier output.
For this there are two options depending on your needs <code>tprint</code> or <code>tprint-sh</code>. (<code>tprint-sh</code> is for use within a multiline sub-shell that has already been silenced, see the version-check rule of this project's <code>Makefile</code> for an example.)</p>
<h2 id="builtin-functions">Builtin Functions</h2>
<h3 id="phonify">Phonify</h3>
<p>Phonify is a new experimental feature of <code>task.mk</code> that solves one of the biggest gotchas of using <code>make</code> as a task runner!
It stands to reason the tasks you document are likely to all be phony recipes
Rather than write <code>.PHONY: &lt;goal&gt;</code> repeatedly, simply enable <code>task.mk</code>'s phonifier.</p>
<p><code>Task.mk</code> will then parse your <code>Makefile</code> for documented tasks and
generate the necessary <code>.PHONY: &lt;recipes&gt;</code> line to ensure they are always executed.
To use this feature set the <code>PHONIFY</code> environment variable before including <code>.task.mk</code>.
To avoid adding a documented task/recipe to <code>.PHONY</code>, use <code>|&gt; --not-phony</code> after the recipe message.</p>
<h3 id="tprint">Tprint</h3>
<p>Besides the <code>help</code> and <code>vars</code> recipes you can use a custom make function to format your text for fancier output.
For this there are two options depending on your needs <code>tprint</code> or <code>tprint-verbose</code>
(<code>tprint-verbose</code> is for use within a multiline sub-shell that has already been silenced,
see the version-check rule of this project's <code>Makefile</code> for an example).</p>
<p>To use <code>tprint</code> you call it with the builtin <code>make</code> call function.
It accepts only one argument: an unquoted f-string literal.
All strings passed to <code>tprint</code> have access to an object <code>ansi</code> or <code>a</code> for simplicity.
This stores ANSI escape codes which can be used to style your text.</p>
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="c">## build | compile the source</span>
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">build</span>
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="nf">build</span><span class="o">:</span>
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tprint,<span class="o">{</span>a.cyan<span class="o">}</span>Build<span class="w"> </span>Starting<span class="o">{</span>a.end<span class="o">}</span><span class="k">)</span>
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="w"> </span>...
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tprint,<span class="o">{</span>a.green<span class="o">}</span>Build<span class="w"> </span>Finished<span class="o">{</span>a.end<span class="o">}</span><span class="k">)</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">build</span>
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="nf">build</span><span class="o">:</span><span class="w"> </span><span class="c">## compile the source</span>
<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tprint,<span class="o">{</span>a.cyan<span class="o">}</span>Build<span class="w"> </span>Starting<span class="o">{</span>a.end<span class="o">}</span><span class="k">)</span>
<a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a><span class="w"> </span>...
<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tprint,<span class="o">{</span>a.green<span class="o">}</span>Build<span class="w"> </span>Finished<span class="o">{</span>a.end<span class="o">}</span><span class="k">)</span>
</code></pre></div>
See this projects <code>make info</code> for more examples of <code>tprint</code>.</p>
<p>See this projects <code>make info</code> for more examples of <code>tprint</code>.</p>
<p>To see the available colors and formatting(bold,italic,etc.) use the hidden recipe <code>make _print-ansi</code>.</p>
<p><strong>Note</strong>: Any help commands starting with an underscore will be ignored.
To view hidden <code>tasks</code> (or recipes in GNU Make land) you can use <code>make _help</code>.</p>
<p>In addition, you can use custom colors using the builtin <code>ansi.custom</code> or (<code>a.custom</code>) method.
It has two optional arguments <code>fg</code> and <code>bg</code>. Which can be used to specify either an 8-bit color from the <a href="https://en.wikipedia.org/wiki/8-bit_color">256 colors</a>.
Or a tuple/list to define an RBG 24-bit color, for instance <code>a.custom(fg=(5,10,255))</code>.
See this project's <code>make info</code> for an example.</p>
<h2 id="configuration">Configuration</h2>
<p>You can quickly customize some of the default behavior of <code>task.mk</code> by overriding the below variables prior to the <code>-include .task.mk</code>.
These can also be included in a seperate file <code>.task.cfg.mk</code>.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="c"># ---- [config] ---- #</span>
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="nv">HEADER_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>b_cyan
<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="nv">ACCENT_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>b_yellow
<a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a><span class="nv">PARAMS_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span><span class="k">$(</span>ACCENT_STYLE<span class="k">)</span>
<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a><span class="nv">GOAL_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span><span class="k">$(</span>ACCENT_STYLE<span class="k">)</span>
<a id="__codelineno-2-6" name="__codelineno-2-6" href="#__codelineno-2-6"></a><span class="nv">MSG_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>faint
<a id="__codelineno-2-7" name="__codelineno-2-7" href="#__codelineno-2-7"></a><span class="nv">DIVIDER_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>default
<a id="__codelineno-2-8" name="__codelineno-2-8" href="#__codelineno-2-8"></a><span class="nv">DIVIDER</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>
<a id="__codelineno-2-9" name="__codelineno-2-9" href="#__codelineno-2-9"></a><span class="nv">HELP_SEP</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>
<a id="__codelineno-2-10" name="__codelineno-2-10" href="#__codelineno-2-10"></a><span class="c"># python f-string literals</span>
<a id="__codelineno-2-11" name="__codelineno-2-11" href="#__codelineno-2-11"></a><span class="nv">EPILOG</span><span class="w"> </span><span class="o">?=</span>
<a id="__codelineno-2-12" name="__codelineno-2-12" href="#__codelineno-2-12"></a><span class="nv">USAGE</span><span class="w"> </span><span class="o">?={</span>ansi.<span class="k">$(</span>HEADER_STYLE<span class="k">)</span><span class="o">}</span>usage<span class="o">{</span>ansi.end<span class="o">}</span>:<span class="se">\n</span><span class="w"> </span>make<span class="w"> </span>&lt;recipe&gt;<span class="se">\n</span>
<a id="__codelineno-2-13" name="__codelineno-2-13" href="#__codelineno-2-13"></a><span class="nv">INHERIT_SHELL</span><span class="w"> </span><span class="o">?=</span>
These can also for instance included in a seperate file <code>.task.cfg.mk</code>.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="c"># ---- [config] ---- #</span>
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="nv">HEADER_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>b_cyan
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="nv">ACCENT_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>b_yellow
<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="nv">PARAMS_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span><span class="k">$(</span>ACCENT_STYLE<span class="k">)</span>
<a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="nv">GOAL_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span><span class="k">$(</span>ACCENT_STYLE<span class="k">)</span>
<a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="nv">MSG_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>faint
<a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="nv">DIVIDER_STYLE</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>default
<a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="nv">DIVIDER</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>
<a id="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><span class="nv">HELP_SEP</span><span class="w"> </span><span class="o">?=</span><span class="w"> </span>
<a id="__codelineno-3-10" name="__codelineno-3-10" href="#__codelineno-3-10"></a><span class="c"># python f-string literals</span>
<a id="__codelineno-3-11" name="__codelineno-3-11" href="#__codelineno-3-11"></a><span class="nv">EPILOG</span><span class="w"> </span><span class="o">?=</span>
<a id="__codelineno-3-12" name="__codelineno-3-12" href="#__codelineno-3-12"></a><span class="nv">USAGE</span><span class="w"> </span><span class="o">?={</span>ansi.<span class="k">$(</span>HEADER_STYLE<span class="k">)</span><span class="o">}</span>usage<span class="o">{</span>ansi.end<span class="o">}</span>:<span class="se">\n</span><span class="w"> </span>make<span class="w"> </span>&lt;recipe&gt;<span class="se">\n</span>
<a id="__codelineno-3-13" name="__codelineno-3-13" href="#__codelineno-3-13"></a><span class="nv">TASKMK_SHELL</span><span class="w"> </span><span class="o">?=</span>
<a id="__codelineno-3-14" name="__codelineno-3-14" href="#__codelineno-3-14"></a><span class="nv">PHONIFY</span><span class="w"> </span><span class="o">?=</span>
</code></pre></div>
<p>To use a custom color for one of the predefined configuration variables specify only the custom method.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="nv">HEADER_STYLE</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>custom<span class="o">(</span><span class="nv">fg</span><span class="o">=</span><span class="m">171</span>,bg<span class="o">=</span><span class="m">227</span><span class="o">)</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="nv">HEADER_STYLE</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>custom<span class="o">(</span><span class="nv">fg</span><span class="o">=</span><span class="m">171</span>,bg<span class="o">=</span><span class="m">227</span><span class="o">)</span>
</code></pre></div>
<p><strong>NOTE</strong>: <code>HELP_SEP</code> does not change the argument definitions syntax only the format of <code>make help</code>.</p>
<h2 id="advanced-usage-embedded-python-scripts">Advanced Usage: Embedded Python Scripts</h2>
<h2 id="advanced-usage-embedded-scripts">Advanced Usage: Embedded Scripts</h2>
<p>You can take advantage of the builtin python script runner and write multi-line python scripts of your own.
This is a simple example but a few lines of python in your <code>Makefile</code>
may be easier than balancing sub-shells and strung together awk commands.</p>
<p>When <code>make</code> expands the function it will take the parameters passed to <code>py</code> and expand them.
<code>$(1)</code> is the variable name and <code>$(2)</code> in this case is the implicit pattern from the rule. Pay attention to quotes.
If you need to debug your python script, use <code>TASKMK_DEBUG=1</code> when you run <code>make</code> and it will first print the script that will be piped to <code>python</code>.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="cp">define list_files_py</span>
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a><span class="err">from</span><span class="w"> </span><span class="err">pathlib</span><span class="w"> </span><span class="err">import</span><span class="w"> </span><span class="err">Path</span>
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="err">print(</span><span class="s2">&quot;files in $(2)&quot;</span><span class="err">)</span>
<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a><span class="err">print([f.name</span><span class="w"> </span><span class="err">for</span><span class="w"> </span><span class="err">f</span><span class="w"> </span><span class="err">in</span><span class="w"> </span><span class="err">(Path(</span><span class="s2">&quot;$(2)&quot;</span><span class="err">).iterdir())])</span>
<a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="cp">endef</span>
<a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a>
<a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="c">## list-% | use pathlib.Path to list files</span>
<a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><span class="nf">list-%</span><span class="o">:</span>
<a id="__codelineno-4-9" name="__codelineno-4-9" href="#__codelineno-4-9"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>py,list_files_py,<span class="nv">$*</span><span class="k">)</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="cp">define list_files_py</span>
<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a><span class="err">from</span><span class="w"> </span><span class="err">pathlib</span><span class="w"> </span><span class="err">import</span><span class="w"> </span><span class="err">Path</span>
<a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a><span class="err">print(</span><span class="s2">&quot;files in $(2)&quot;</span><span class="err">)</span>
<a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a><span class="err">print([f.name</span><span class="w"> </span><span class="err">for</span><span class="w"> </span><span class="err">f</span><span class="w"> </span><span class="err">in</span><span class="w"> </span><span class="err">(Path(</span><span class="s2">&quot;$(2)&quot;</span><span class="err">).iterdir())])</span>
<a id="__codelineno-5-5" name="__codelineno-5-5" href="#__codelineno-5-5"></a><span class="cp">endef</span>
<a id="__codelineno-5-6" name="__codelineno-5-6" href="#__codelineno-5-6"></a>
<a id="__codelineno-5-7" name="__codelineno-5-7" href="#__codelineno-5-7"></a><span class="c">## list-% | use pathlib.Path to list files</span>
<a id="__codelineno-5-8" name="__codelineno-5-8" href="#__codelineno-5-8"></a><span class="nf">list-%</span><span class="o">:</span>
<a id="__codelineno-5-9" name="__codelineno-5-9" href="#__codelineno-5-9"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>py,list_files_py,<span class="nv">$*</span><span class="k">)</span>
</code></pre></div>
<p>For what it's worth there is also a predefined function for <code>bash</code> (named <code>tbash</code>) as well should you need to accomplish something similar of more easily embedding your bash script rather than having to escape every line with a backslash.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="cp">define bash_script</span>
<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a><span class="nf">figlet task.mk 2&gt;/dev/null || echo &#39;no figlet </span><span class="o">:</span>(&#39;
<a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;This is from bash&quot;</span>
<a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a><span class="err">cat</span><span class="w"> </span><span class="err">/etc/hostname</span>
<a id="__codelineno-5-5" name="__codelineno-5-5" href="#__codelineno-5-5"></a><span class="err">printf</span><span class="w"> </span><span class="s2">&quot;%s\n&quot;</span><span class="w"> </span><span class="s2">&quot;$(2)&quot;</span>
<a id="__codelineno-5-6" name="__codelineno-5-6" href="#__codelineno-5-6"></a><span class="cp">endef</span>
<a id="__codelineno-5-7" name="__codelineno-5-7" href="#__codelineno-5-7"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">test</span>-<span class="n">bash</span>
<a id="__codelineno-5-8" name="__codelineno-5-8" href="#__codelineno-5-8"></a><span class="nf">test-bash</span><span class="o">:</span>
<a id="__codelineno-5-9" name="__codelineno-5-9" href="#__codelineno-5-9"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tbash,bash_script,test<span class="w"> </span>bash<span class="w"> </span>multiline<span class="k">)</span>
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="cp">define bash_script</span>
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a><span class="nf">figlet task.mk 2&gt;/dev/null || echo &#39;no figlet </span><span class="o">:</span>(&#39;
<a id="__codelineno-6-3" name="__codelineno-6-3" href="#__codelineno-6-3"></a><span class="err">echo</span><span class="w"> </span><span class="s2">&quot;This is from bash&quot;</span>
<a id="__codelineno-6-4" name="__codelineno-6-4" href="#__codelineno-6-4"></a><span class="err">cat</span><span class="w"> </span><span class="err">/etc/hostname</span>
<a id="__codelineno-6-5" name="__codelineno-6-5" href="#__codelineno-6-5"></a><span class="err">printf</span><span class="w"> </span><span class="s2">&quot;%s\n&quot;</span><span class="w"> </span><span class="s2">&quot;$(2)&quot;</span>
<a id="__codelineno-6-6" name="__codelineno-6-6" href="#__codelineno-6-6"></a><span class="cp">endef</span>
<a id="__codelineno-6-7" name="__codelineno-6-7" href="#__codelineno-6-7"></a><span class="nf">.PHONY</span><span class="o">:</span><span class="w"> </span><span class="n">test</span>-<span class="n">bash</span>
<a id="__codelineno-6-8" name="__codelineno-6-8" href="#__codelineno-6-8"></a><span class="nf">test-bash</span><span class="o">:</span>
<a id="__codelineno-6-9" name="__codelineno-6-9" href="#__codelineno-6-9"></a><span class="w"> </span><span class="k">$(</span>call<span class="w"> </span>tbash,bash_script,test<span class="w"> </span>bash<span class="w"> </span>multiline<span class="k">)</span>
</code></pre></div>
<hr>
@ -636,7 +813,7 @@ If you need to debug your python script, use <code>TASKMK_DEBUG=1</code> when yo
<small>
Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 19, 2023</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">January 27, 2023</span>
<br>
Created:
@ -682,22 +859,11 @@ If you need to debug your python script, use <code>TASKMK_DEBUG=1</code> when yo
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.indexes"], "search": "../assets/javascripts/workers/search.e5c33ebb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.indexes"], "search": "../assets/javascripts/workers/search.db81ec45.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../assets/javascripts/bundle.51d95adb.min.js"></script>
<script src="../javascripts/asciinema-player.min.js"></script>
<script src="../assets/javascripts/bundle.a00a7c5e.min.js"></script>
</body>
</html>