From c89f5cec9e3b8d5b07c705fd4bbf646ddd625291 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 7 Jun 2024 06:12:42 -0500 Subject: [PATCH] Removing gallery manual HTML scripts --- docs/gallery/make_gallery.sh | 22 -------- docs/gallery/make_html_entry.sh | 95 --------------------------------- 2 files changed, 117 deletions(-) delete mode 100755 docs/gallery/make_gallery.sh delete mode 100755 docs/gallery/make_html_entry.sh diff --git a/docs/gallery/make_gallery.sh b/docs/gallery/make_gallery.sh deleted file mode 100755 index e59a8baeaa..0000000000 --- a/docs/gallery/make_gallery.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# scans the current directory and for each new file not already existing in the -# gallery.rst file, creates a new entry, the person adding the file will however -# need to add descriptive text - -file=gallery.rst - -# function to write a gallery entry -function gallery_entry() -{ - echo "" >> $2 - echo ".. image::" $1 >> $2 - echo " :alt: Dummy Text Lorem Ipsum" >> $2 -} - -# for each png file -for i in *.png ; do - if ! grep -q $i gallery.rst ; then - gallery_entry $i $file - fi -done diff --git a/docs/gallery/make_html_entry.sh b/docs/gallery/make_html_entry.sh deleted file mode 100755 index 79da754584..0000000000 --- a/docs/gallery/make_html_entry.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash - -# on the basis of the entries in gallery.rst file -# produce the html snippet that allows to make the -# gallery on the front page - -# this function writes the html entry for a given image, as determined -# from the gallery.rst entry -function html_slide_entry() -{ - slide_number="$1" - number_of_slides="$2" - imagename="$3" - alttext="$4" - output_html="$5" - - echo '
' >> $5 - echo '
'$1' / '$2'
' >> $5 - echo ' ' >> $5 - echo '
'$4'
' >> $5 - echo '
' >> $5 - echo '' >> $5 -} - -# writes the forward and backward buttons -function html_write_buttons -{ - outfile=$1 - echo ' ' >> $outfile - echo ' ' >> $outfile -} - -# writes the dots for the images -function html_write_dots -{ - dot_type="$1" - num_dots="$2" - outfile="$3" - echo '
' >> $outfile - for (( i = 1 ; i <= $num_dots ; i++ )) ; do - echo ' ' >> $outfile - done - echo '
' >> $outfile - echo '' >> $outfile -} - - -# this is the input rst file which determines, what the html will show -gallery_file="gallery.rst" - -# the file we are writing out to -out_file="test.html" - -# determine the number of images -num_images=`grep -c ' image::' $gallery_file` - -# write the start of the html section -echo '' > $out_file -echo '' >> $out_file -echo '
' >> $out_file -echo '
' >> $out_file - -# loop over the number of slides -for (( i = 1 ; i <= $num_images ; i++ )) ; do - alttext=`grep ":alt:" $gallery_file | sed -n "$i"p | cut -d ' ' -f6-` - img_file=`grep "image::" $gallery_file | sed -n "$i"p | awk '{print $3}'` - echo $alttext $img_file - html_slide_entry $i $num_images $img_file "$alttext" $out_file -done - -# write the buttons -html_write_buttons $out_file - -echo '
' >> $out_file -echo '
' >> $out_file - -# write the dots -html_write_dots "dot" $num_images $out_file - -echo '' >> $out_file - -# now we insert the autogen content into the slideshow file -# determine the line on which we insert the auto get content -breakline=`grep -n "<\!-- WE WILL INSERT AUTO GEN CONENT HERE -->" ../slideshow_empty.html | sed -e s'/:/ /'g | awk '{print $1}'` -breaklineplus1=$(($breakline+1)) -filelength=`wc -l ../slideshow_empty.html | awk '{print $1}'` - -# first print out the file upto the break point -sed -n 1,"$breakline"p ../slideshow_empty.html > ../slideshow.html -# dump the contents of the autogen file into the slideshow -cat $out_file >> ../slideshow.html -# now print out the rest of the slideshow -sed -n "$breaklineplus1","$filelength"p ../slideshow_empty.html >> ../slideshow.html - -# all done :)