star-ty

Generate content for online publication
git clone git://git.meso-star.com/star-ty.git
Log | Files | Refs | README | LICENSE

sty-index (1271B)


      1 #!/bin/sh
      2 
      3 # Copyright (C) 2017-2026 |Méso|Star> (contact@meso-star.com)
      4 #
      5 # This file is part Star-Typesetting.
      6 #
      7 # Star-Typesetting is free software: you can redistribute it and/or modify
      8 # it under the terms of the GNU General Public License as published by
      9 # the Free Software Foundation, either version 3 of the License, or
     10 # (at your option) any later version.
     11 #
     12 # Star-Typesetting is distributed in the hope that it will be useful,
     13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     15 # GNU General Public License for more details.
     16 #
     17 # You should have received a copy of the GNU General Public License
     18 # along with Star-Typesetting. If not, see <http://www.gnu.org/licenses/>.
     19 
     20 . "sty.sh"
     21 
     22 set -e
     23 
     24 # Print to standard output the Makefile targets that make the section
     25 # index file a prerequisite for the section's HTML content.
     26 
     27 if [ ! -e "menu.tsv" ]; then
     28   >&2 printf \
     29     '%s: not a star-typesetting directory (the menu.tsv file is missing)\n' \
     30     "${0##*/}"
     31   exit 1
     32 fi
     33 
     34 html="$(sty-list html)"
     35 
     36 sections | while read -r i; do
     37   html_section="$(printf '%s\n' "${html}" \
     38     | sed -n "/^${i}\//p" \
     39     | tr '\n' ' ')"
     40 
     41   printf '%s: %s/index.tsv\n' "${html_section}" "${i}"
     42 done