# Input: arg1 path input wikicode file
# Output: files wikicode file tree
# Depends: Bash 5.1.16, GNU Coreutils 8.32
# Input: arg1 path input wikicode file
# Output: files wikicode file tree
# Depends: Bash 5.1.16, GNU Coreutils 8.32
re_sp='^(<!-- @subpage:)(.*)([ ]*-->)$'; # subpage marker pattern
d_out=./wikicode/; # default output dir
f_spl="subpage_list.txt"; # subpage title list
re_sp='^(<!-- @subpage:)(.*)([ ]*-->)$'; # subpage marker pattern
d_out=./wikicode/; # default output dir
f_spl="subpage_list.txt"; # subpage title list
p_splwc="${d_out}/${f_splwc}";
yell() { echo "$0: $*" >&2; } # print script path and all args to stderr
p_splwc="${d_out}/${f_splwc}";
yell() { echo "$0: $*" >&2; } # print script path and all args to stderr
sp_path="$(echo "$line" | sed -E -e "s/${re_sp}/\2/" -e 's/[ ]*$//'; )";
# declare -p sp_path; # debug
#### Update subpage content file path
sp_path="$(echo "$line" | sed -E -e "s/${re_sp}/\2/" -e 's/[ ]*$//'; )";
# declare -p sp_path; # debug
#### Update subpage content file path
spc_dir="$(dirname "$spc_path"; )";
#declare -p spc_path spc_dir; # debug
#### Prepare file destination
spc_dir="$(dirname "$spc_path"; )";
#declare -p spc_path spc_dir; # debug
#### Prepare file destination