Skip to content

Instantly share code, notes, and snippets.

@lttr
Created January 18, 2024 13:18
Show Gist options
  • Save lttr/459ce1728a8b080be0132cd2ce166254 to your computer and use it in GitHub Desktop.
Save lttr/459ce1728a8b080be0132cd2ce166254 to your computer and use it in GitHub Desktop.
I wanted to read the VueJS docs on my eink tablet. HTML seems to work even better then EPUB in Boox NeoReader app.
#!/usr/bin/env bash
set -e
TEMPORARY="vue-docs.md"
GUIDE_PATH="./src/guide/"
OUTPUT_EPUB="vue-docs.epub"
OUTPUT_HTML="vue-docs.html"
git clone --depth=1 https://github.com/vuejs/docs
cd docs
touch ${GUIDE_PATH}${TEMPORARY}
cat .vitepress/config.ts | rg -v 'html|//' | rg "/guide/[^']+" --only-matching | while read -r guide_path; do
CURRENT_GUIDE=`echo $guide_path | xargs dirname | xargs basename`
cat "src${guide_path}.md" | sed "s#images/#${CURRENT_GUIDE}/images/#" >> ${GUIDE_PATH}${TEMPORARY}
done
cd $GUIDE_PATH
pandoc $TEMPORARY -o $OUTPUT_EPUB
pandoc $TEMPORARY -o $OUTPUT_HTML
cd ../..
mv ${GUIDE_PATH}$OUTPUT_EPUB ./
mv ${GUIDE_PATH}$OUTPUT_HTML ./
@fguillen
Copy link

fguillen commented Jan 27, 2024

Thanks @lttr I am using the generated html version in my kobo (e-ink device)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment