parent
9f7402009d
commit
63250fc307
|
@ -7,8 +7,7 @@
|
|||
client for the [tldr](https://github.com/rprieto/tldr/) project, providing
|
||||
poignant examples of terminal commands.**
|
||||
|
||||
[//]: # <img alt="tldr list screenshot" src="tldr-list.jpg" title="tldr list" width="600" />
|
||||
<img alt="tldr list GIF" src="tldr-list.gif" title="tldr list" />
|
||||
<img alt="tldr list screenshot" src="tldr-list.jpg" title="tldr list" width="600" />
|
||||
|
||||
This client can render both the old and the new tldr markup format.
|
||||
|
||||
|
@ -23,7 +22,9 @@ sudo chmod +x $location
|
|||
|
||||
If the location is not in $PATH, you need to specify the path to run it.
|
||||
|
||||
<img alt="tldr page screenshot" src="tldr-page.jpg" title="tldr page" width="600" />
|
||||
<img alt="tldr page gif" src="tldr-page.gif" title="tldr page" />
|
||||
{::comment}<img alt="tldr page screenshot" src="tldr-page.jpg" title="tldr page" width="600" />
|
||||
{{:/comment}
|
||||
|
||||
### Prerequisites
|
||||
coreutils, less, grep, unzip, curl / wget
|
||||
|
|
8
tldr
8
tldr
|
@ -17,9 +17,9 @@ VERSION='0.1a'
|
|||
# (The style items are separated by space, lower or uppercase mixed allowed.)
|
||||
: ${TLDR_TITLE_STYLE:= Newline Space Bold Yellow }
|
||||
: ${TLDR_DESCRIPTION_STYLE:= Space Yellow }
|
||||
: ${TLDR_EXAMPLE_STYLE:= Newline Bold Green }
|
||||
: ${TLDR_EXAMPLE_STYLE:= Newline Space Bold Green }
|
||||
: ${TLDR_CODE_STYLE:= Space Bold Blue }
|
||||
: ${TLDR_VALUE_STYLE:= Bold Cyan }
|
||||
: ${TLDR_VALUE_STYLE:= Space Bold Cyan }
|
||||
# Color and/or background (Newline and Space also allowed) for error messages
|
||||
: ${TLDR_ERROR_COLOR= Space Red }
|
||||
|
||||
|
@ -254,7 +254,7 @@ Display_tldr(){
|
|||
'-') ((newfmt)) && Unlinted "Bad first character"
|
||||
((${#REPLY} <= 2)) && Unlinted "No example content"
|
||||
[[ ! ${REPLY:1:1} = ' ' ]] && Unlinted "2nd character no space"
|
||||
Out "$ENL$EPS$E ${REPLY:2}$XE" ;;
|
||||
Out "$ENL$ESP$E${REPLY:2}$XE" ;;
|
||||
' ') ((newfmt)) || Unlinted "Bad first character"
|
||||
((${#REPLY} <= 4)) && Unlinted "No valid code content"
|
||||
[[ ${REPLY:0:4} = ' ' ]] || Unlinted "No four spaces before code"
|
||||
|
@ -274,7 +274,7 @@ Display_tldr(){
|
|||
'') continue ;;
|
||||
*) ((newfmt)) || Unlinted "Bad first character"
|
||||
[[ -z $REPLY ]] && Unlinted "No example content"
|
||||
Out "$ENL$EPS$E $REPLY$XE" ;;
|
||||
Out "$ENL$EPS$E$REPLY$XE" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
|
BIN
tldr-list.gif
BIN
tldr-list.gif
Binary file not shown.
Before Width: | Height: | Size: 523 KiB |
Binary file not shown.
After Width: | Height: | Size: 375 KiB |
Loading…
Reference in New Issue