2
0

make-docs-pages.sh 524 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # we have run download-playlist.sh in $PLAYLIST_DIR
  3. # we have segmented each video in the playlist
  4. # there is a thumbnail for each downloaded video
  5. DOCS_DIR="${1:-doc}"
  6. DOC_FILES=$( find $DOCS_DIR -maxdepth 1 -type f -name '*.md' )
  7. i=4000
  8. for docFile in $DOC_FILES; do
  9. export PAGE_INDEX="$i"
  10. baseName="$(basename -s .md $docFile)"
  11. pageFile="md-pages/doc-$baseName.md" # todo flatten
  12. title="Doc: ${baseName}"
  13. scripts/md-to-page.sh "$docFile" "$title" > "$pageFile"
  14. i=$(expr $i + 1)
  15. done