Added: width, height, new window options + readme
This commit is contained in:
parent
99f1927d65
commit
301cb68dd2
31
README.md
31
README.md
|
@ -261,14 +261,39 @@ Définir en METAS
|
|||
|
||||
```
|
||||
image: 1 : FILENAME : ALT-TEXT
|
||||
image: 2 : FILENAME : ALT-TEXT
|
||||
```
|
||||
|
||||
Dans l'article... (appliquez les lettre l,r, ou c (g,d également) pour
|
||||
définir l'alignement auche, droite, centre)
|
||||
Dans l'article...
|
||||
Définir le marqueur ```_image``` sur une seule ligne et spécifiez les
|
||||
valeurs séparées par ":"
|
||||
|
||||
- Numero d'image
|
||||
- Alignement: l,r, ou c (g,d également) pour gauche, droite, centre)
|
||||
- Longueur width: juste le nombre
|
||||
- Largeur height: juste le nombre
|
||||
- Champ non vide: Lien de l'image dans un nouvel onglet
|
||||
|
||||
Exemple d'images affichées l'une à côté de l'autre
|
||||
|
||||
```
|
||||
(
|
||||
_image:1
|
||||
_image:1:r
|
||||
_image:2:c:640:480
|
||||
_image:3:c:320:240:+
|
||||
)
|
||||
```
|
||||
|
||||
Exemple d'images affichées l'une en dessous de l'autre, dont la première
|
||||
peut s'ouvrir dans un nouvel onglet
|
||||
|
||||
```
|
||||
(
|
||||
_image:1:c:640:480:+
|
||||
)
|
||||
(
|
||||
_image:2:c:1920:1080
|
||||
)
|
||||
```
|
||||
|
||||
### Block-Code depuis un fichier
|
||||
|
|
2
control
2
control
|
@ -1,5 +1,5 @@
|
|||
Package: egsl
|
||||
Version: 0.0.19
|
||||
Version: 0.0.20
|
||||
Section: custom
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
|
|
|
@ -261,14 +261,39 @@ Définir en METAS
|
|||
|
||||
```
|
||||
image: 1 : FILENAME : ALT-TEXT
|
||||
image: 2 : FILENAME : ALT-TEXT
|
||||
```
|
||||
|
||||
Dans l'article... (appliquez les lettre l,r, ou c (g,d également) pour
|
||||
définir l'alignement auche, droite, centre)
|
||||
Dans l'article...
|
||||
Définir le marqueur ```_image``` sur une seule ligne et spécifiez les
|
||||
valeurs séparées par ":"
|
||||
|
||||
- Numero d'image
|
||||
- Alignement: l,r, ou c (g,d également) pour gauche, droite, centre)
|
||||
- Longueur width: juste le nombre
|
||||
- Largeur height: juste le nombre
|
||||
- Champ non vide: Lien de l'image dans un nouvel onglet
|
||||
|
||||
Exemple d'images affichées l'une à côté de l'autre
|
||||
|
||||
```
|
||||
(
|
||||
_image:1
|
||||
_image:1:r
|
||||
_image:2:c:640:480
|
||||
_image:3:c:320:240:+
|
||||
)
|
||||
```
|
||||
|
||||
Exemple d'images affichées l'une en dessous de l'autre, dont la première
|
||||
peut s'ouvrir dans un nouvel onglet
|
||||
|
||||
```
|
||||
(
|
||||
_image:1:c:640:480:+
|
||||
)
|
||||
(
|
||||
_image:2:c:1920:1080
|
||||
)
|
||||
```
|
||||
|
||||
### Block-Code depuis un fichier
|
||||
|
|
|
@ -56,14 +56,14 @@ case "$gsl_post_type" in
|
|||
gsl_srv_www_page="$gsl_srv_www/$gsl_header_slug/index.html"
|
||||
gsl__check_srv_files "$gsl_srv_wip_page" wip
|
||||
gsl__check_srv_files "$gsl_srv_www_page" www
|
||||
gsl_uri=".."
|
||||
#gsl_uri=".."
|
||||
;;
|
||||
page)
|
||||
gsl_srv_wip_page="$gsl_srv_wip/$gsl_header_slug.html"
|
||||
gsl_srv_www_page="$gsl_srv_www/$gsl_header_slug.html"
|
||||
gsl__check_srv_files "$gsl_srv_wip_page" wip
|
||||
gsl__check_srv_files "$gsl_srv_www_page" www
|
||||
gsl_uri="."
|
||||
#gsl_uri="."
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
@ -17,8 +17,15 @@ gsl__all_makers() {
|
|||
# Code readability a11y
|
||||
gsl_a11y_post=`mktemp`
|
||||
|
||||
# Get content only, not header in a file
|
||||
gsl__post_content_only
|
||||
|
||||
# Get base uri from post/page type:
|
||||
case "$gsl_post_type" in
|
||||
post) gsl_uri=".." ;;
|
||||
page) gsl_uri="." ;;
|
||||
esac
|
||||
|
||||
# Create Listng Page
|
||||
gsl__page_listing_create Add
|
||||
|
||||
|
@ -583,38 +590,44 @@ EOCITE
|
|||
gsl__make_image() {
|
||||
gsl_this_mark="$gsl_mark_image:$gsl_post_hf_1"
|
||||
|
||||
# Set HTML base Link
|
||||
case "$gsl_post_type" in
|
||||
post) gsl_bpic_url="../images" ;;
|
||||
page) gsl_bpic_url="images" ;;
|
||||
esac
|
||||
|
||||
while IFS=: read -r "line_nbr" "this_image"
|
||||
while IFS=: read -r "line_nbr" \
|
||||
"marker" \
|
||||
"this_image" \
|
||||
"align_image" \
|
||||
"width" \
|
||||
"height" \
|
||||
"target"
|
||||
do
|
||||
|
||||
align_image=`awk -F: '{print $3}' <<< "$this_image"`
|
||||
|
||||
# Get this marker
|
||||
gsl_this_mark=`awk -v ln="$line_nbr" 'NR == ln' $gsl_tmp_post`
|
||||
|
||||
#align_image=`awk -F: '{print $3}' <<< "$this_image"`
|
||||
case "$align_image" in
|
||||
R|r|D|d)
|
||||
gsl_html_class="class=\"${gsl_site_css}_image_right\""
|
||||
;;
|
||||
L|l|G|g)
|
||||
gsl_html_class="class=\"${gsl_site_css}_image_left\""
|
||||
;;
|
||||
C|c)
|
||||
gsl_html_class="class=\"${gsl_site_css}_image_center\""
|
||||
;;
|
||||
*)
|
||||
gsl_html_class="class=\"${gsl_site_css}_image_center\""
|
||||
;;
|
||||
R|r|D|d) gsl_html_class="class=\"${gsl_site_css}_image_right\"" ;;
|
||||
L|l|G|g) gsl_html_class="class=\"${gsl_site_css}_image_left\"" ;;
|
||||
C|c) gsl_html_class="class=\"${gsl_site_css}_image_center\"";;
|
||||
*) gsl_html_class="class=\"${gsl_site_css}_image_center\"";;
|
||||
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_src="src=\"$gsl_uri/images/$gsl_post_hf_2\""
|
||||
gsl_html_alt="alt=\"$gsl_post_hf_3\" title=\"$gsl_post_hf_3\""
|
||||
[[ "$width" ]] && gsl_html_width="style=\"width:${width}px;\""
|
||||
[[ "$height" ]] && gsl_html_height="style=\"height:${height}px;\""
|
||||
|
||||
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"
|
||||
gsl_html_image=`
|
||||
printf '%s %s %s %s %s' \
|
||||
"<img $gsl_html_src" \
|
||||
"$gsl_html_class" \
|
||||
"$gsl_html_alt" \
|
||||
"$gsl_html_width" \
|
||||
"$gsl_html_height />"`
|
||||
|
||||
[[ "$target" ]] \
|
||||
&& gsl_html_image="<a target=\"_blank\" href=\"$gsl_uri/images/$gsl_post_hf_2\">$gsl_html_image</a>"
|
||||
|
||||
echo -ne "\r\033[2K: Converting Image... Line:$line_nbr $gsl_this_mark"
|
||||
sed -i "${line_nbr}s|$gsl_this_mark|$gsl_html_image|" "$gsl_tmp_post"
|
||||
|
||||
done < <(grep -n "$gsl_this_mark" "$gsl_tmp_post")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue