2 Commits

Author SHA1 Message Date
aacbf51475 Update to v2.1.5:
Fixed: Properly escape entries with a '%'
2022-09-09 16:11:42 -04:00
2136ba3f69 Update to v2.1.4:
New: Allow for comma separated list of references in aux_cmd.
2019-11-13 11:22:41 -05:00
7 changed files with 107 additions and 85 deletions

View File

@ -1,3 +1,13 @@
2.1.5:
* Fixed: Properly escape entries with a '%'
2.1.4:
* New: Allow for comma separated list of references in aux_cmd.
2.1.3: 2.1.3:
* Fixed: entries that contain a '%' do not cause a failure. * Fixed: entries that contain a '%' do not cause a failure.

View File

@ -1,4 +1,4 @@
## Copyright Ian Jauslin 2015-2019 ## Copyright Ian Jauslin 2015-2022
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License. ## you may not use this file except in compliance with the License.

2
NOTICE
View File

@ -1,2 +1,2 @@
BBlog BBlog
Copyright Ian Jauslin 2015-2019 Copyright Ian Jauslin 2015-2022

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## Copyright Ian Jauslin 2015-2019 ## Copyright Ian Jauslin 2015-2022
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License. ## you may not use this file except in compliance with the License.
@ -15,10 +15,10 @@
## limitations under the License. ## limitations under the License.
# directory containing the engine files # directory containing the engine files
enginedir=/home/ian/Programs/BBlog2/src/engines enginedir=/usr/share/BBlog/engines
# version # version
version=2.1.3 version=2.1.5
function print_config { function print_config {
echo "engine: $engine" echo "engine: $engine"
@ -235,12 +235,13 @@ function replace_format {
out="${out//\%$command\%/$replacement}" out="${out//\%$command\%/$replacement}"
done done
# un-escape '%' in replacement
out="${out//::iansays:percent::/\%}"
# finish replacing newlines # finish replacing newlines
out="${out//\\n/%}" out="${out//\\n/%}"
out=$(echo "$out" | tr "%" "\n") out=$(echo "$out" | tr "%" "\n")
# un-escape '%' in replacement
out="${out//::iansays:percent::/\%}"
echo "$out" echo "$out"
} }
@ -272,9 +273,11 @@ function inverse_map_citeref {
foundref=0 foundref=0
# sift through aux file # sift through aux file
grep -h "$aux_cmd" $aux | while read -r ref; do grep -h "$aux_cmd" $aux | while read -r refs; do
eval "ref=\${ref#$aux_cmd}" eval "refs=\${refs#$aux_cmd}"
ref="${ref%\}}" refs="${ref%\}}"
# can be a comma separated list
for ref in $(echo -n "$refs" | tr ',' '\n'); do
# replace the ref via the ref_map # replace the ref via the ref_map
possibleref=$(map_citeref "$ref") possibleref=$(map_citeref "$ref")
# check whether the ref is the right one # check whether the ref is the right one
@ -283,6 +286,7 @@ function inverse_map_citeref {
foundref=1 foundref=1
return 1 return 1
fi fi
done
done && echo "$foundref$newref" done && echo "$foundref$newref"
} }

View File

@ -1,5 +1,5 @@
base_SQL="SELECT title,author,journal,year,token,doi,arxiv,citeref,prauth FROM bibliography" base_SQL="SELECT title,author,journal,year,token,doi,arxiv,citeref,prauth,bibtex FROM bibliography"
base_SQL_noprauth="SELECT title,author,journal,year,token,doi,arxiv,citeref FROM bibliography" base_SQL_noprauth="SELECT title,author,journal,year,token,doi,arxiv,citeref,bibtex FROM bibliography"
# add quotes # add quotes
function SQL_addquotes { function SQL_addquotes {
@ -23,9 +23,12 @@ function generate_SQL_alpha {
exists_citeref=0 exists_citeref=0
# sift through aux file # sift through aux file
grep -h "$aux_cmd" $aux | while read -r citeref; do grep -h "$aux_cmd" $aux | while read -r citerefs; do
eval "citeref=\${citeref#$aux_cmd}" eval "citerefs=\${citerefs#$aux_cmd}"
citeref="${citeref%\}}" citerefs="${citerefs%\}}"
# can be a comma separated list
for citeref in $(echo -n "$citerefs" | tr ',' '\n'); do
# replace the citeref with a ref_map if there is any # replace the citeref with a ref_map if there is any
if [ -n "$ref_map" ]; then if [ -n "$ref_map" ]; then
@ -50,6 +53,7 @@ function generate_SQL_alpha {
exists_citeref=1 exists_citeref=1
fi fi
done done
done
# if there are no citerefs close ' # if there are no citerefs close '
[ $exists_citeref = 0 ] && echo -n "'" [ $exists_citeref = 0 ] && echo -n "'"
@ -70,9 +74,12 @@ function fetch_BBlog_entries_appearance {
citeref_list="" citeref_list=""
# sift through aux file # sift through aux file
grep -h "$aux_cmd" $aux | while read -r citeref; do grep -h "$aux_cmd" $aux | while read -r citerefs; do
eval "citeref=\${citeref#$aux_cmd}" eval "citerefs=\${citerefs#$aux_cmd}"
citeref="${citeref%\}}" citerefs="${citerefs%\}}"
# can be a comma separated list
for citeref in $(echo -n "$citerefs" | tr ',' '\n'); do
# replace the citeref with a ref_map if there is any # replace the citeref with a ref_map if there is any
if [ -n "$ref_map" ]; then if [ -n "$ref_map" ]; then
@ -111,5 +118,6 @@ function fetch_BBlog_entries_appearance {
echo "" echo ""
fi fi
done done
done
} }

View File

@ -1,5 +1,5 @@
.Dd $Mdocdate: November 5 2019 $ .Dd $Mdocdate: September 9 2022 $
.Dt BBLOG 2.1.3 .Dt BBLOG 2.1.5
.Os .Os
.Sh NAME .Sh NAME
.Nm BBlog .Nm BBlog
@ -194,6 +194,6 @@ automatically adds a letter (from 'b' to 'z') at the end of non-unique tokens, i
.Nm .Nm
was written by Ian Jauslin. was written by Ian Jauslin.
.Sh COPYRIGHT .Sh COPYRIGHT
copyright Ian Jauslin 2015-2019 copyright Ian Jauslin 2015-2022
.Sh SEE ALSO .Sh SEE ALSO
.Sx BBlog-sqlite Ns (7) .Sx BBlog-sqlite Ns (7)

View File

@ -1,4 +1,4 @@
.Dd $Mdocdate: Novermber 5 2019 $ .Dd $Mdocdate: November 5 2019 $
.Dt BBLOG-sqlite .Dt BBLOG-sqlite
.Os .Os
.Sh DESCRIPTION .Sh DESCRIPTION
@ -32,7 +32,7 @@ label of the reference
.Sh AUTHORS .Sh AUTHORS
The sqlite BBlog engine was written by Ian Jauslin. The sqlite BBlog engine was written by Ian Jauslin.
.Sh COPYRIGHT .Sh COPYRIGHT
copyright Ian Jauslin 2015-2019 copyright Ian Jauslin 2015-2022
.Sh SEE ALSO .Sh SEE ALSO
.Sx BBlog Ns (1) , .Sx BBlog Ns (1) ,
.Sx sqlite3 Ns (1) .Sx sqlite3 Ns (1)