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