X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=clickslide.sh;h=dcb01db6dc4b3264d00cfa3ee5dca6b7d2863c5c;hb=f3d10e74c2c37195dc5fac09af5ff02d13307bf3;hp=ddc94c37ef79e44753e54fc71b670f1aef45d0f2;hpb=c2772fd3bec6c84a3bfdcd90b2008d9381c10876;p=clickslide diff --git a/clickslide.sh b/clickslide.sh index ddc94c3..dcb01db 100755 --- a/clickslide.sh +++ b/clickslide.sh @@ -22,16 +22,29 @@ depth=0 ucdepth=-1 line="${line#*>}" tag="${tag}>" fi - + + ### Image embedding for Inline styles + while expr "$tag" : '.*<[^>]*style="[^"]*url("\?[^)]\+\.\(png\|jpg\|jpeg\|gif\|svg\)"\?)'; do + pre="${tag%%url(*)*}" + post="${tag#*url(*)}" + file="${tag#${pre}url(}" file="${file%)$post}" + file="${file#"}" file="${file%"}" + echo Inlining Image "$file" >&2 + if [ -r "$file" ]; then + tag="${pre}url('data:image/${file##*.};base64,$(base64 <"${file}" |tr -d \\n)')${post}" + fi + done >/dev/null + + ### Tag Processing case $tag in - *\*|\*\) + *\*|\*\) # Inline styles into head printf '%s %s' "${tag#*}" tag='' depth=$((depth + 1)) ;; - *\*) + *\*) # Count slide id, insert "next" button prev="$next" next="${tag#**) + *\*) # Insert "previous" button printf '%sprevious%s' \ "${tag%*}" "$prev" "${tag#*}" tag='' depth=$((depth - 1)) ;; - *\<*class=\"uncover\"*\>*) - #printf '%s
  • ' "$tag" - printf '%s' "$tag" - tag='' depth=$((depth + 1)) - ucdepth=$depth - ;; - *\*) + *\*) # Insert toplevel link printf '%soverview' "$tag" tag='' depth=$((depth + 1)) ;; - *\*) + *\*) # Insert total slide count printf '%i%s' "$idoff" "$tag" tag='' depth=$((depth - 1)) ;; + *\<*class=\"uncover\"*\>*) # Insert checkboxes in "uncover" lists + #printf '%s
  • ' "$tag" + printf '%s' "$tag" + tag='' depth=$((depth + 1)) + ucdepth=$depth + ;; *\*) printf %s "$tag" tag='' depth=$((depth - 1))