dot

packages and services management
Log | Files | Refs | README

commit 8ef8872f4e70b2f594f71983a6e20bcae6695d23
parent e916dc19f8c8f8259e424abbac8b146c14ef5c1c
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Wed, 17 May 2017 09:27:03 +0200

compatibility with sbase sed

Diffstat:
Mbin/doc-wiki | 21+++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/bin/doc-wiki b/bin/doc-wiki @@ -6,25 +6,26 @@ WIKI='http://en.wikipedia.org/wiki' E=`printf '\033'` # search for a title -wget -qO- "$API&list=search&srsearch=$*" | -awk -v RS='"title": *"' 'NR > 1 { gsub(/".*/, ""); print; }' | +name=` + wget -qO- "$API&list=search&srsearch=$*" | + awk -v RS='"title": *"' 'NR > 1 { gsub(/".*/, ""); print; }' | -# prompt the results -iomenu -p wiki | + # prompt the results + iomenu -p wiki +` # download the raw wiki text -xargs -I % wget -qO- "$WIKI/%?action=raw" | +wget -qO- "$WIKI/$name?action=raw" | # format and display the page sed -r ' - # bold s/'"'''"'([^'"'"']*)'"'''"'/{\1}/g # '''text''' # wiki links - s/\[\[[^]|]*\|/[/g # [[*| - s/\{\{[^}|]*\|/[/g # {{*| + s/\[\[[^\]|]*\|/[/g # [[*| + s/\{\{[^\}|]*\|/[/g # {{*| s/\[\[/[/g; s/\]\]/]/g # [[ ]] - s/\{\{/[/g; s/\}\}/]/g # {{ }} + s/\{\{/[/g; s/\}\}/]/g # {{ # bullet lists s/^(\*\**) */\n\1 / # * Text @@ -52,7 +53,7 @@ sed -r ' s/\]/'$E[m'/g # bold - s/\{/'$E[1m'/g # { * } + s/\{/'$E[1m'/g # { * s/\}/'$E[m'/g ' | sed '