2 function __init_pandoc{
10 # Every package should define these 6 variables
13 pkg_dst_cmd="$HOME/.local/bin/pandoc"
14 pkg_dst="$pkg_dst_cmd"
16 pkg_src_cmd="$HOME/.local/opt/pandoc-v$WEBI_VERSION/bin/pandoc"
17 pkg_src_dir="$HOME/.local/opt/pandoc-v$WEBI_VERSION"
18 pkg_src="$pkg_src_cmd"
20 # pkg_install must be defined by every package
22 # ~/.local/opt/pandoc-v2.10.1/bin
23 mkdir -p "$(dirname $pkg_src_cmd)"
25 # mv ./pandoc-*/pandoc ~/.local/opt/pandoc-v2.10.1/bin/pandoc
26 mv ./pandoc-*/bin/pandoc "$pkg_src_cmd"
29 # pkg_get_current_version is recommended, but (soon) not required
30 pkg_get_current_version() {
31 # 'pandoc --version' has output in this format:
33 # Compiled with pandoc-types 1.21, texmath 0.12.0.3, skylighting 0.8.5
34 # Default user data directory: /home/sergi/.local/share/pandoc or /home/sergi/.pandoc
35 # Copyright (C) 2006-2020 John MacFarlane
36 # Web: https://pandoc.org
37 # This is free software; see the source for copying conditions.
38 # There is no warranty, not even for merchantability or fitness
39 # for a particular purpose.
40 # This trims it down to just the version number:
42 echo $(pandoc --version 2> /dev/null | head -n 1 | cut -d ' ' -f 2)