docs: typos

This commit is contained in:
daylin 2022-09-05 20:20:10 -05:00 committed by Daylin Morgan
parent 9ee2a8db79
commit 4e2a771b8c
3 changed files with 51 additions and 51 deletions

View file

@ -77,7 +77,7 @@ as python {a.bold}f-string{a.end} literals
{a.end}
endef
## info | demonsrtate usage of tprint
## info | demonstrate usage of tprint
.PHONY: task
info:
$(call header, Info Message)

View file

@ -119,8 +119,8 @@ You can take advantage of the builtin python script runner and write multi-line
This is a simple example but a few lines of python in your `Makefile`
may be easier than balancing sub-shells and strung together awk commands.
When `make` expands the function it will take the parameters passed to `py` and expand them `$(1)` is the variable name.
`$(2)` in this case is the implicit pattern from the rule. Pay attention to quotes.
When `make` expands the function it will take the parameters passed to `py` and expand them.
`$(1)` is the variable name and `$(2)` in this case is the implicit pattern from the rule. Pay attention to quotes.
If you need to debug your python script, use `DEBUG=1` when you run `make` and it will first print the script that will be piped to `python`.
```make
@ -135,7 +135,7 @@ list-%:
$(call py,list_files_py,$*)
```
For what it's worth there is also a predefined function for `bash` (named `tbash`) as well should you need to accomplish something similar of more easily embedding your bash script rather than having to escape every line with '\'.
For what it's worth there is also a predefined function for `bash` (named `tbash`) 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.
```make
define bash_script
@ -182,10 +182,10 @@ But I just want a basic help output, surely I don't need python for this... you
```make
## h, help | show this help
.PHONY: help h
help h: Makefile params
help h: Makefile
@awk -v fill=$(shell sed -n 's/^## \(.*\) | .*/\1/p' $< | wc -L)\
'match($$0,/^## (.*) \|/,name) && match($$0,/\| (.*)$$/,help)\
{printf "\033[1;93m%*s\033[0m | \033[30m%s\033[0m\n",\
fill,name[1],help[1];} match($$0,/^### (.*)/,str) \
{printf "%*s \033[30m%s\033[0m\n",fill," ",str[1];}' $<
```
```

View file

@ -16,14 +16,14 @@
font-weight: 700;
}
.terminal-649569392-matrix {
.terminal-649700464-matrix {
font-family: Fira Code, monospace;
font-size: 20px;
line-height: 24.4px;
font-variant-east-asian: full-width;
}
.terminal-649569392-title {
.terminal-649700464-title {
font-size: 18px;
font-weight: bold;
font-family: arial;
@ -33,95 +33,95 @@
-webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
}
.terminal-649569392-r1 { fill: #94e2d5;font-weight: bold }
.terminal-649569392-r2 { fill: #c6d0f5 }
.terminal-649569392-r3 { fill: #f5c2e7;font-weight: bold }
.terminal-649569392-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
.terminal-649569392-r5 { fill: #f9e2af;font-weight: bold }
.terminal-649569392-r6 { fill: #8288a5 }
.terminal-649700464-r1 { fill: #94e2d5;font-weight: bold }
.terminal-649700464-r2 { fill: #c6d0f5 }
.terminal-649700464-r3 { fill: #f5c2e7;font-weight: bold }
.terminal-649700464-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
.terminal-649700464-r5 { fill: #f9e2af;font-weight: bold }
.terminal-649700464-r6 { fill: #8288a5 }
</style>
<defs>
<clipPath id="terminal-649569392-clip-terminal">
<clipPath id="terminal-649700464-clip-terminal">
<rect x="0" y="0" width="609.0" height="413.79999999999995" />
</clipPath>
<clipPath id="terminal-649569392-line-0">
<clipPath id="terminal-649700464-line-0">
<rect x="0" y="1.5" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-1">
<clipPath id="terminal-649700464-line-1">
<rect x="0" y="25.9" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-2">
<clipPath id="terminal-649700464-line-2">
<rect x="0" y="50.3" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-3">
<clipPath id="terminal-649700464-line-3">
<rect x="0" y="74.7" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-4">
<clipPath id="terminal-649700464-line-4">
<rect x="0" y="99.1" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-5">
<clipPath id="terminal-649700464-line-5">
<rect x="0" y="123.5" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-6">
<clipPath id="terminal-649700464-line-6">
<rect x="0" y="147.9" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-7">
<clipPath id="terminal-649700464-line-7">
<rect x="0" y="172.3" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-8">
<clipPath id="terminal-649700464-line-8">
<rect x="0" y="196.7" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-9">
<clipPath id="terminal-649700464-line-9">
<rect x="0" y="221.1" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-10">
<clipPath id="terminal-649700464-line-10">
<rect x="0" y="245.5" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-11">
<clipPath id="terminal-649700464-line-11">
<rect x="0" y="269.9" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-12">
<clipPath id="terminal-649700464-line-12">
<rect x="0" y="294.3" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-13">
<clipPath id="terminal-649700464-line-13">
<rect x="0" y="318.7" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-14">
<clipPath id="terminal-649700464-line-14">
<rect x="0" y="343.1" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649569392-line-15">
<clipPath id="terminal-649700464-line-15">
<rect x="0" y="367.5" width="610" height="24.65"/>
</clipPath>
</defs>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="626" height="462.8" rx="8"/><text class="terminal-649569392-title" fill="#c6d0f5" text-anchor="middle" x="313" 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="626" height="462.8" rx="8"/><text class="terminal-649700464-title" fill="#c6d0f5" text-anchor="middle" x="313" 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-649569392-clip-terminal)">
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-649700464-clip-terminal)">
<g class="terminal-649569392-matrix">
<text class="terminal-649569392-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-649569392-line-0)">usage:</text><text class="terminal-649569392-r2" x="610" y="20" textLength="12.2" clip-path="url(#terminal-649569392-line-0)">
</text><text class="terminal-649569392-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-649569392-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-649569392-r2" x="610" y="44.4" textLength="12.2" clip-path="url(#terminal-649569392-line-1)">
</text><text class="terminal-649569392-r2" x="610" y="68.8" textLength="12.2" clip-path="url(#terminal-649569392-line-2)">
</text><text class="terminal-649569392-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-649569392-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-649569392-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-649569392-line-3)">`Makefile`</text><text class="terminal-649569392-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-649569392-line-3)">&#160;into</text><text class="terminal-649569392-r2" x="610" y="93.2" textLength="12.2" clip-path="url(#terminal-649569392-line-3)">
</text><text class="terminal-649569392-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-649569392-line-4)">&#160;&#160;the&#160;</text><text class="terminal-649569392-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-649569392-line-4)">task&#160;runner</text><text class="terminal-649569392-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-649569392-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-649569392-r2" x="610" y="117.6" textLength="12.2" clip-path="url(#terminal-649569392-line-4)">
</text><text class="terminal-649569392-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-649569392-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-649569392-r2" x="610" y="142" textLength="12.2" clip-path="url(#terminal-649569392-line-5)">
</text><text class="terminal-649569392-r2" x="610" y="166.4" textLength="12.2" clip-path="url(#terminal-649569392-line-6)">
</text><text class="terminal-649569392-r5" x="0" y="190.8" textLength="109.8" clip-path="url(#terminal-649569392-line-7)">bootstrap</text><text class="terminal-649569392-r2" x="109.8" y="190.8" textLength="36.6" clip-path="url(#terminal-649569392-line-7)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-649569392-line-7)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-649569392-r2" x="610" y="190.8" textLength="12.2" clip-path="url(#terminal-649569392-line-7)">
</text><text class="terminal-649569392-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-649569392-line-8)">&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-649569392-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-649569392-line-8)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-649569392-line-8)">lint&#160;the&#160;python</text><text class="terminal-649569392-r2" x="610" y="215.2" textLength="12.2" clip-path="url(#terminal-649569392-line-8)">
</text><text class="terminal-649569392-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-649569392-line-9)">&#160;&#160;&#160;assets</text><text class="terminal-649569392-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-649569392-line-9)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-649569392-line-9)">generate&#160;assets</text><text class="terminal-649569392-r2" x="610" y="239.6" textLength="12.2" clip-path="url(#terminal-649569392-line-9)">
</text><text class="terminal-649569392-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-649569392-line-10)">&#160;&#160;&#160;list-%</text><text class="terminal-649569392-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-649569392-line-10)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-649569392-line-10)">use&#160;pathlib.Path&#160;to&#160;list&#160;files</text><text class="terminal-649569392-r2" x="610" y="264" textLength="12.2" clip-path="url(#terminal-649569392-line-10)">
</text><text class="terminal-649569392-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-649569392-line-11)">&#160;&#160;release</text><text class="terminal-649569392-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-649569392-line-11)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-649569392-line-11)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-649569392-r2" x="610" y="288.4" textLength="12.2" clip-path="url(#terminal-649569392-line-11)">
</text><text class="terminal-649569392-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-649569392-line-12)">&#160;c,&#160;clean</text><text class="terminal-649569392-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-649569392-line-12)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-649569392-line-12)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-649569392-r2" x="610" y="312.8" textLength="12.2" clip-path="url(#terminal-649569392-line-12)">
</text><text class="terminal-649569392-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-649569392-line-13)">&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-649569392-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-649569392-line-13)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-649569392-line-13)">demonsrtate&#160;usage&#160;of&#160;tprint</text><text class="terminal-649569392-r2" x="610" y="337.2" textLength="12.2" clip-path="url(#terminal-649569392-line-13)">
</text><text class="terminal-649569392-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-649569392-line-14)">&#160;&#160;h,&#160;help</text><text class="terminal-649569392-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-649569392-line-14)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-649569392-line-14)">show&#160;this&#160;help</text><text class="terminal-649569392-r2" x="610" y="361.6" textLength="12.2" clip-path="url(#terminal-649569392-line-14)">
</text><text class="terminal-649569392-r2" x="610" y="386" textLength="12.2" clip-path="url(#terminal-649569392-line-15)">
</text><text class="terminal-649569392-r2" x="0" y="410.4" textLength="610" clip-path="url(#terminal-649569392-line-16)">for&#160;more&#160;info:&#160;see&#160;github.com/daylinmorgan/task.mk</text><text class="terminal-649569392-r2" x="610" y="410.4" textLength="12.2" clip-path="url(#terminal-649569392-line-16)">
<g class="terminal-649700464-matrix">
<text class="terminal-649700464-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-649700464-line-0)">usage:</text><text class="terminal-649700464-r2" x="610" y="20" textLength="12.2" clip-path="url(#terminal-649700464-line-0)">
</text><text class="terminal-649700464-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-649700464-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-649700464-r2" x="610" y="44.4" textLength="12.2" clip-path="url(#terminal-649700464-line-1)">
</text><text class="terminal-649700464-r2" x="610" y="68.8" textLength="12.2" clip-path="url(#terminal-649700464-line-2)">
</text><text class="terminal-649700464-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-649700464-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-649700464-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-649700464-line-3)">`Makefile`</text><text class="terminal-649700464-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-649700464-line-3)">&#160;into</text><text class="terminal-649700464-r2" x="610" y="93.2" textLength="12.2" clip-path="url(#terminal-649700464-line-3)">
</text><text class="terminal-649700464-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-649700464-line-4)">&#160;&#160;the&#160;</text><text class="terminal-649700464-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-649700464-line-4)">task&#160;runner</text><text class="terminal-649700464-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-649700464-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-649700464-r2" x="610" y="117.6" textLength="12.2" clip-path="url(#terminal-649700464-line-4)">
</text><text class="terminal-649700464-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-649700464-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-649700464-r2" x="610" y="142" textLength="12.2" clip-path="url(#terminal-649700464-line-5)">
</text><text class="terminal-649700464-r2" x="610" y="166.4" textLength="12.2" clip-path="url(#terminal-649700464-line-6)">
</text><text class="terminal-649700464-r5" x="0" y="190.8" textLength="109.8" clip-path="url(#terminal-649700464-line-7)">bootstrap</text><text class="terminal-649700464-r2" x="109.8" y="190.8" textLength="36.6" clip-path="url(#terminal-649700464-line-7)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-649700464-line-7)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-649700464-r2" x="610" y="190.8" textLength="12.2" clip-path="url(#terminal-649700464-line-7)">
</text><text class="terminal-649700464-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-649700464-line-8)">&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-649700464-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-649700464-line-8)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-649700464-line-8)">lint&#160;the&#160;python</text><text class="terminal-649700464-r2" x="610" y="215.2" textLength="12.2" clip-path="url(#terminal-649700464-line-8)">
</text><text class="terminal-649700464-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-649700464-line-9)">&#160;&#160;&#160;assets</text><text class="terminal-649700464-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-649700464-line-9)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-649700464-line-9)">generate&#160;assets</text><text class="terminal-649700464-r2" x="610" y="239.6" textLength="12.2" clip-path="url(#terminal-649700464-line-9)">
</text><text class="terminal-649700464-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-649700464-line-10)">&#160;&#160;&#160;list-%</text><text class="terminal-649700464-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-649700464-line-10)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-649700464-line-10)">use&#160;pathlib.Path&#160;to&#160;list&#160;files</text><text class="terminal-649700464-r2" x="610" y="264" textLength="12.2" clip-path="url(#terminal-649700464-line-10)">
</text><text class="terminal-649700464-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-649700464-line-11)">&#160;&#160;release</text><text class="terminal-649700464-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-649700464-line-11)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-649700464-line-11)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-649700464-r2" x="610" y="288.4" textLength="12.2" clip-path="url(#terminal-649700464-line-11)">
</text><text class="terminal-649700464-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-649700464-line-12)">&#160;c,&#160;clean</text><text class="terminal-649700464-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-649700464-line-12)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-649700464-line-12)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-649700464-r2" x="610" y="312.8" textLength="12.2" clip-path="url(#terminal-649700464-line-12)">
</text><text class="terminal-649700464-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-649700464-line-13)">&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-649700464-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-649700464-line-13)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-649700464-line-13)">demonstrate&#160;usage&#160;of&#160;tprint</text><text class="terminal-649700464-r2" x="610" y="337.2" textLength="12.2" clip-path="url(#terminal-649700464-line-13)">
</text><text class="terminal-649700464-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-649700464-line-14)">&#160;&#160;h,&#160;help</text><text class="terminal-649700464-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-649700464-line-14)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-649700464-line-14)">show&#160;this&#160;help</text><text class="terminal-649700464-r2" x="610" y="361.6" textLength="12.2" clip-path="url(#terminal-649700464-line-14)">
</text><text class="terminal-649700464-r2" x="610" y="386" textLength="12.2" clip-path="url(#terminal-649700464-line-15)">
</text><text class="terminal-649700464-r2" x="0" y="410.4" textLength="610" clip-path="url(#terminal-649700464-line-16)">for&#160;more&#160;info:&#160;see&#160;github.com/daylinmorgan/task.mk</text><text class="terminal-649700464-r2" x="610" y="410.4" textLength="12.2" clip-path="url(#terminal-649700464-line-16)">
</text>
</g>
</g>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB