Fix: Images Alignement - + autres fix

This commit is contained in:
Cyrille L 2022-04-11 18:06:38 +02:00
parent 14196f870d
commit 64c30a31a5
7 changed files with 54 additions and 55 deletions

View File

@ -1,5 +1,5 @@
Package: egsl Package: egsl
Version: 0.0.12 Version: 0.0.13
Section: custom Section: custom
Priority: optional Priority: optional
Architecture: all Architecture: all

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: 0.0.12 # Version: 0.0.13
# file: gsl # file: gsl
# Folder: /usr/local/bin # Folder: /usr/local/bin
# By echolib # By echolib
@ -11,18 +11,18 @@
if__command() { if__command() {
! [[ `command -v $1` ]] \ ! [[ `command -v $1` ]] \
&& echo -e "$I_Red Missing $1 command" \ && echo -e "$I_Red Missing $1 command" \
&& exit 1 && exit
} }
gsl__if_file() { gsl__if_file() {
if ! [[ -f "$1" ]];then if ! [[ -f "$1" ]];then
echo "! Missing file: $1" echo "! Missing file: $1"
exit 1 exit
fi fi
case "$2" in case "$2" in
source) source)
source "$1" || exit 1 source "$1" || exit
;; ;;
read) read)
cat "$1" cat "$1"
@ -190,7 +190,7 @@ gsl__create_ff
gsl__find_domain gsl__find_domain
gsl__if_file "$gsl_dir_scripts/gsl__auth_manager" source gsl__if_file "$gsl_dir_scripts/gsl__auth_manager" source
gsl__authors_list check || exit 1 gsl__authors_list check || exit
gsl__if_file "$gsl_dir_scripts/gsl__post_checkers" source gsl__if_file "$gsl_dir_scripts/gsl__post_checkers" source
gsl__if_file "$gsl_dir_scripts/gsl__post_manager" source gsl__if_file "$gsl_dir_scripts/gsl__post_manager" source
gsl__if_file "$gsl_dir_scripts/gsl__db_manager" source gsl__if_file "$gsl_dir_scripts/gsl__db_manager" source
@ -205,7 +205,7 @@ case "$1" in
edit|-E) edit|-E)
! [[ "$2" ]] \ ! [[ "$2" ]] \
&& echo "! Missing argument: post [FILE]" \ && echo "! Missing argument: post [FILE]" \
&& exit 1 && exit
gsl__if_file "$2" post gsl__if_file "$2" post
if ! [[ "$EDITOR" ]];then if ! [[ "$EDITOR" ]];then
@ -257,7 +257,7 @@ case "$1" in
db) db)
! [[ "$2" ]] \ ! [[ "$2" ]] \
&& echo "! Missing argument: post [FILE]" \ && echo "! Missing argument: post [FILE]" \
&& exit 1 && exit
gsl__if_file "$2" post gsl__if_file "$2" post
[[ -f "$gsl_dir_db/$gsl_this_post.db" ]] \ [[ -f "$gsl_dir_db/$gsl_this_post.db" ]] \
@ -358,13 +358,13 @@ case "$1" in
;; ;;
*) *)
echo "! Bad Argument: $2" echo "! Bad Argument: $2"
exit 1 exit
;; ;;
esac esac
! [[ "$3" ]] \ ! [[ "$3" ]] \
&& echo "! Missing argument: post [FILE]" \ && echo "! Missing argument: post [FILE]" \
&& exit 1 && exit
gsl__if_file "$3" post gsl__if_file "$3" post
@ -389,7 +389,7 @@ case "$1" in
www) www)
! [[ "$2" ]] \ ! [[ "$2" ]] \
&& echo "! Missing argument: OPT=add/remove" \ && echo "! Missing argument: OPT=add/remove" \
&& exit 1 && exit
if__command rsync if__command rsync
gsl_www_act="$2" gsl_www_act="$2"
@ -402,13 +402,13 @@ case "$1" in
;; ;;
*) *)
echo "! Bad argument: $2 ? OPT=add/remove" echo "! Bad argument: $2 ? OPT=add/remove"
exit 1 exit
;; ;;
esac esac
! [[ "$3" ]] \ ! [[ "$3" ]] \
&& echo "! Missing argument: post [FILE]/all" \ && echo "! Missing argument: post [FILE]/all" \
&& exit 1 && exit
case "$3" in case "$3" in
all) all)
@ -419,7 +419,7 @@ case "$1" in
;; ;;
*) *)
echo "# Abandon" echo "# Abandon"
exit 1 exit
;; ;;
esac esac
;; ;;

View File

@ -112,7 +112,6 @@ do
sed -i "s|$gsl_bold|$gsl_html_bold|g" "$2" sed -i "s|$gsl_bold|$gsl_html_bold|g" "$2"
;; ;;
esac esac
fi fi
done < <(grep -oPn "(?<=$gsl_mark_bold).*?(?=$gsl_mark_bold)" "$2") done < <(grep -oPn "(?<=$gsl_mark_bold).*?(?=$gsl_mark_bold)" "$2")

View File

@ -226,6 +226,7 @@ if (( "$gsl_count_links" > 0 ));then
"$gsl_log_h_link" \ "$gsl_log_h_link" \
"Offline:$gsl_url_status ${gsl_post_hf_2:0:40}..." \ "Offline:$gsl_url_status ${gsl_post_hf_2:0:40}..." \
"${PWD}/$gsl_post" "${PWD}/$gsl_post"
# Decomment below if you want the error link avoiding convertion
#gsl_checker_err=true #gsl_checker_err=true
return return
;; ;;

View File

@ -590,12 +590,6 @@ while IFS=: read -r "line_nbr" "this_image"
do do
align_image=`awk -F: '{print $3}' <<< "$this_image"` align_image=`awk -F: '{print $3}' <<< "$this_image"`
[[ $align_image ]] \
&& align_image=":$align_image"
echo -ne "\r\033[2K: Converting Image... Line:$line_nbr $this_image"
gsl_html_src="src=\"$gsl_bpic_url/$gsl_post_hf_2\""
gsl_html_alt="alt=\"$gsl_post_hf_3\""
case "$align_image" in case "$align_image" in
R|r|D|d) R|r|D|d)
@ -612,9 +606,12 @@ do
;; ;;
esac esac
gsl_html_src="src=\"$gsl_bpic_url/$gsl_post_hf_2\""
gsl_html_alt="alt=\"$gsl_post_hf_3\""
gsl_html_image="<img $gsl_html_src $gsl_html_class $gsl_html_alt />" gsl_html_image="<img $gsl_html_src $gsl_html_class $gsl_html_alt />"
gsl_post_image="$gsl_mark_image:$gsl_post_hf_1$align_image"
sed -i "${line_nbr}s|$gsl_post_image|$gsl_html_image|" "$gsl_tmp_post" echo -ne "\r\033[2K: Converting Image... Line:$line_nbr $this_image"
sed -i "${line_nbr}s|$this_image|$gsl_html_image|" "$gsl_tmp_post"
done < <(grep -n "$gsl_this_mark" "$gsl_tmp_post") done < <(grep -n "$gsl_this_mark" "$gsl_tmp_post")
} }
@ -718,6 +715,7 @@ do
gsl__make_a11y_add_space gsl__make_a11y_add_space
unset gsl_start_line unset gsl_start_line
fi fi
gsl_set_space=`expr substr "$gsl_line" 3 1` gsl_set_space=`expr substr "$gsl_line" 3 1`
gsl_start_line=$gsl_line_nbr gsl_start_line=$gsl_line_nbr
unset gsl_stop_line unset gsl_stop_line

View File

@ -60,6 +60,7 @@ do
"$gsl_post_type ; $gsl_post has changed" \ "$gsl_post_type ; $gsl_post has changed" \
"$gsl_srv_wip_page" "$gsl_srv_wip_page"
fi fi
if [[ -f "$gsl_file_db_post" ]];then if [[ -f "$gsl_file_db_post" ]];then
rm -f "$gsl_file_db_post" && \ rm -f "$gsl_file_db_post" && \
gsl__logs_print \ gsl__logs_print \
@ -215,9 +216,9 @@ fi
gsl__check_nbr_posts() { gsl__check_nbr_posts() {
gsl_nbr_posts=`ls -1 *.gsl 2>/dev/null | wc -l` gsl_nbr_posts=`ls -1 *.gsl 2>/dev/null | wc -l`
! (( $gsl_nbr_posts >= 1 )) \ (( $gsl_nbr_posts == 0 )) \
&& echo "! No Posts found with .gsl extension" \ && echo "! No Posts found with .gsl extension" \
&& exit 1 && exit
} }
#====================================================================== #======================================================================

View File

@ -41,7 +41,7 @@ find . -maxdepth 1 -not -type d -type f \
&& exit $gsl_nbr_domains && exit $gsl_nbr_domains
(( $gsl_nbr_domains == 0 )) \ (( $gsl_nbr_domains == 0 )) \
&& echo "! No registred domain here: change or set folder. See help new" \ && echo "! No registred domain here: change or set folder. See help new" \
&& exit 1 && exit
gsl_find_domain=` gsl_find_domain=`
find . -maxdepth 1 -not -type d -type f \ find . -maxdepth 1 -not -type d -type f \
@ -63,7 +63,7 @@ gsl_this_conf_domain=`grep "$1" "$gsl_file_db_domains"`
! [[ "$gsl_this_conf_domain" ]] \ ! [[ "$gsl_this_conf_domain" ]] \
&& echo "! Domain Not found: $1" \ && echo "! Domain Not found: $1" \
&& exit 1 && exit
gsl_dir_domain_tpl="$gsl_this_conf_domain/templates" gsl_dir_domain_tpl="$gsl_this_conf_domain/templates"
gsl_dir_domain_files="$gsl_this_conf_domain/files" gsl_dir_domain_files="$gsl_this_conf_domain/files"