summaryrefslogtreecommitdiff
path: root/man/example-filter.sh
blob: 2a71d40d7c595fe9f21bdf1d78c93d979ed07b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# This is a super bootleg script for converting plaintext examples into groff.

while read line; do
	echo "$line" | while read -n 1 char; do
		if [[ $char == "%" ]]; then
			echo -n '%'
			continue
		fi
		ord=$(printf '%d' "'$char")
		if [[ $ord -eq 0 ]]; then
			printf ' '
		elif [[ $ord -gt 127 ]]; then
			printf '\[u%X]' "'$char"
		else
			printf "$char"
		fi
	done
	echo
	echo ".br"
done
map-go.git/commit/internal/feed/template/feed.tpl.go?h=v0.4.0&id=e0a857eafebd92d5e94d156997d5d9422a50933f&follow=1'>Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12