Created
January 18, 2024 13:18
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 ./ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @lttr I am using the generated html version in my kobo (e-ink device)