github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/docs/rebuild.sh (about)

     1  #!/bin/sh
     2  
     3  # extract '# Desription' section from root README.md
     4  csplit -f prep_ ../README.md '/^# Description/' > /dev/null
     5  csplit -f desc_ prep_01 '/^#/' '{1}' > /dev/null
     6  # change headline to 'u-root' and fix relative links to point to GitHub
     7  sed \
     8    -e 's/# Description/\n# u-root/' \
     9    -e 's#(\(cmds\|pkg\)#(https://github.com/u-root/u-root/tree/master/\1#g' \
    10    desc_01 > description.md
    11  rm desc_* prep_*
    12  
    13  # fetch pandoc-uikit template
    14  _TEMPLATE=pandoc-uikit-master
    15  [ -d "$_TEMPLATE" ] ||
    16    curl -L https://github.com/diversen/pandoc-uikit/archive/master.tar.gz | tar -xzf -
    17  
    18  # cat it all and pipe into pandoc :)
    19  cat header.md description.md index.md | pandoc --metadata title="u-root" --toc \
    20    -o index.html --template="$_TEMPLATE"/template.html -