cortav  Check-in [13a73d4eb8]

Overview
Comment:make names consistent, make view script customizable
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 13a73d4eb826dd1519542eb45fce47b71c60214583fc0ebd0a9482ccdee1518f
User & Date: lexi on 2021-12-21 03:15:55
Other Links: manifest | tags
Context
2021-12-21
03:26
fix embarassing typobug check-in: d5e8521d30 user: lexi tags: trunk
03:15
make names consistent, make view script customizable check-in: 13a73d4eb8 user: lexi tags: trunk
01:22
tidy up repo, add freedesktop file format stuff and viewer handler script check-in: 3b2fea2df1 user: lexi tags: trunk
Changes

Name change from desk/cortav-view.desktop.tpl to desk/cortav-view.desktop.

Modified desk/cortav-view.sh from [a29a5961ee] to [053a3467a6].

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# to write a shebang that works across distros, so we're generating
# the shebang and inserting it into the script at build time.
# we also do something similar with the path to cortav, in case the
# executable isn't in $PATH

out=$(mktemp --suffix=.html)

"$cortav_exec" "$1" -o "$out" -m html:width 35em

if test "$BROWSER" != ""; then
	"$BROWSER" "file://$out"
else
	xdg-open "$out"
fi

# clean up when the browser closes
sleep 1 # in case of tricksiness
rm "$out"







|










2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# to write a shebang that works across distros, so we're generating
# the shebang and inserting it into the script at build time.
# we also do something similar with the path to cortav, in case the
# executable isn't in $PATH

out=$(mktemp --suffix=.html)

"$cortav_exec" "$1" -o "$out" $cortav_flags

if test "$BROWSER" != ""; then
	"$BROWSER" "file://$out"
else
	xdg-open "$out"
fi

# clean up when the browser closes
sleep 1 # in case of tricksiness
rm "$out"

Modified makefile from [be343fd9b7] to [af39b8375f].

2
3
4
5
6
7
8

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
43
44
45
luac != which luac
sh != which sh

extens = $(wildcard ext/*.lua)
extens_names ?= $(basename $(notdir $(extens)))
build = build
executable = cortav


prefix = $(HOME)/.local
bin_prefix = $(prefix)/bin
share_prefix = $(prefix)/share/$(executable)

$(build)/$(executable): sirsem.lua cortav.lua $(extens) cli.lua | $(build)/
	@echo ' » building with extensions $(extens_names)'
	echo '#!$(lua)' > $@
	luac -o - $^ >> $@
	chmod +x $@

$(build)/cortav.html: cortav.ct $(build)/$(executable) | $(build)/
	./cortav $< -o $@ -m render:format html -y html:fossil-uv

.PHONY: syncdoc
syncdoc: $(build)/cortav.html
	fossil uv add $<
	fossil uv sync

.PHONY: clean
clean:
	rm -f $(build)/cortav $(build)/cortav.html $(build)/velartrill-cortav-view.desktop $(build)/cortav-view.sh

$(build)/%.sh: desk/%.sh
	echo >$@ "#!$(sh)"
	echo >>$@ 'cortav_exec="$(bin_prefix)/$(executable)"'

	cat $< >> $@
	chmod +x $@

$(build)/velartrill-cortav-view.desktop: desk/cortav-view.desktop.tpl
	cp $< $@
	echo "Exec=$(bin_prefix)/cortav-view.sh" >>$@

%/:
	mkdir -p $@

.PHONY: install







>












|













>



|







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
luac != which luac
sh != which sh

extens = $(wildcard ext/*.lua)
extens_names ?= $(basename $(notdir $(extens)))
build = build
executable = cortav
default-format-flags = -m html:width 40em

prefix = $(HOME)/.local
bin_prefix = $(prefix)/bin
share_prefix = $(prefix)/share/$(executable)

$(build)/$(executable): sirsem.lua cortav.lua $(extens) cli.lua | $(build)/
	@echo ' » building with extensions $(extens_names)'
	echo '#!$(lua)' > $@
	luac -o - $^ >> $@
	chmod +x $@

$(build)/cortav.html: cortav.ct $(build)/$(executable) | $(build)/
	$(build)/$(executable) $< -o $@ -m render:format html -y html:fossil-uv

.PHONY: syncdoc
syncdoc: $(build)/cortav.html
	fossil uv add $<
	fossil uv sync

.PHONY: clean
clean:
	rm -f $(build)/cortav $(build)/cortav.html $(build)/velartrill-cortav-view.desktop $(build)/cortav-view.sh

$(build)/%.sh: desk/%.sh
	echo >$@ "#!$(sh)"
	echo >>$@ 'cortav_exec="$(bin_prefix)/$(executable)"'
	echo >>$@ 'cortav_flags="$${ct_format_flags-$(default-format-flags)}"'
	cat $< >> $@
	chmod +x $@

$(build)/velartrill-cortav-view.desktop: desk/cortav-view.desktop
	cp $< $@
	echo "Exec=$(bin_prefix)/cortav-view.sh" >>$@

%/:
	mkdir -p $@

.PHONY: install