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      2   # to write a shebang that works across distros, so we're generating
     3      3   # the shebang and inserting it into the script at build time.
     4      4   # we also do something similar with the path to cortav, in case the
     5      5   # executable isn't in $PATH
     6      6   
     7      7   out=$(mktemp --suffix=.html)
     8      8   
     9         -"$cortav_exec" "$1" -o "$out" -m html:width 35em
            9  +"$cortav_exec" "$1" -o "$out" $cortav_flags
    10     10   
    11     11   if test "$BROWSER" != ""; then
    12     12   	"$BROWSER" "file://$out"
    13     13   else
    14     14   	xdg-open "$out"
    15     15   fi
    16     16   
    17     17   # clean up when the browser closes
    18     18   sleep 1 # in case of tricksiness
    19     19   rm "$out"

Modified makefile from [be343fd9b7] to [af39b8375f].

     2      2   luac != which luac
     3      3   sh != which sh
     4      4   
     5      5   extens = $(wildcard ext/*.lua)
     6      6   extens_names ?= $(basename $(notdir $(extens)))
     7      7   build = build
     8      8   executable = cortav
            9  +default-format-flags = -m html:width 40em
     9     10   
    10     11   prefix = $(HOME)/.local
    11     12   bin_prefix = $(prefix)/bin
    12     13   share_prefix = $(prefix)/share/$(executable)
    13     14   
    14     15   $(build)/$(executable): sirsem.lua cortav.lua $(extens) cli.lua | $(build)/
    15     16   	@echo ' ยป building with extensions $(extens_names)'
    16     17   	echo '#!$(lua)' > $@
    17     18   	luac -o - $^ >> $@
    18     19   	chmod +x $@
    19     20   
    20     21   $(build)/cortav.html: cortav.ct $(build)/$(executable) | $(build)/
    21         -	./cortav $< -o $@ -m render:format html -y html:fossil-uv
           22  +	$(build)/$(executable) $< -o $@ -m render:format html -y html:fossil-uv
    22     23   
    23     24   .PHONY: syncdoc
    24     25   syncdoc: $(build)/cortav.html
    25     26   	fossil uv add $<
    26     27   	fossil uv sync
    27     28   
    28     29   .PHONY: clean
    29     30   clean:
    30     31   	rm -f $(build)/cortav $(build)/cortav.html $(build)/velartrill-cortav-view.desktop $(build)/cortav-view.sh
    31     32   
    32     33   $(build)/%.sh: desk/%.sh
    33     34   	echo >$@ "#!$(sh)"
    34     35   	echo >>$@ 'cortav_exec="$(bin_prefix)/$(executable)"'
           36  +	echo >>$@ 'cortav_flags="$${ct_format_flags-$(default-format-flags)}"'
    35     37   	cat $< >> $@
    36     38   	chmod +x $@
    37     39   
    38         -$(build)/velartrill-cortav-view.desktop: desk/cortav-view.desktop.tpl
           40  +$(build)/velartrill-cortav-view.desktop: desk/cortav-view.desktop
    39     41   	cp $< $@
    40     42   	echo "Exec=$(bin_prefix)/cortav-view.sh" >>$@
    41     43   
    42     44   %/:
    43     45   	mkdir -p $@
    44     46   
    45     47   .PHONY: install