File: thumbspage/examples/2.2-upgrades/more-demos/config-args-demo.sh
#!/bin/bash # ======================================================================== # Demo 2.2 config arguments. # # This builds the ../../2.1-upgrades/ gallery with 2.2's command-line # config arguments, in one of two flavors per its "flavor" setting. # Config arguments like these make it easy to vary settings per build. # # See also ../tool-tips-gallery/_generate.sh for similar code, plus # ../../2.1-upgrades/dynamiclayout/_generate.sh for the former (and now # largely superseded) alternative which edited the config file with sed. # # This file is Bash code. Run it in its own folder with "bash filename" # in a Unix shell, or use its python3 commands separately at the console. # This script uses Bash multi-line commands ("\" means line continuation), # and 'here' documents to automate console input (lines in "<<EOF...EOF"). # See UserGuide.html#otherusagemodes for more on input techniques. # # Update: as of 2.3, console inputs can be more portably provided as # setting=value command-line config arguments too, instead of using the # <<-EOF "here documents" technique shown here. See UserGuide.html#2.3. # ======================================================================== flavor='2' # pick a configs set: '1' or '2' (no spaces) thumbspage=../../.. # path to thumbspage.py examples=../.. # path to examples/ folder # Custom layout, tool tips, index color if [ $flavor == '1' ] then printf '\nMaking flavor 1\n' python3 $thumbspage/thumbspage.py $examples/2.1-upgrades \ useDynamicIndexLayout=True \ dynamicLayoutPaddingH=\'0px\' \ useToolTips=True \ thumbsBgColor=\'#dddddd\' \ <<-EOF 128,128 EOF fi # Or, for something completely different... if [ $flavor == '2' ] then printf '\nMaking flavor 2\n' python3 $thumbspage/thumbspage.py $examples/2.1-upgrades \ useDynamicIndexLayout=False \ useToolTips=False \ thumbsBgColor=\'cyan\' \ viewerBgColor=\'lightgrey\' \ viewerFgColor=\'black\' \ <<-EOF 3 128,128 EOF fi # And see the results by opening ../2.1-upgrades/index.html