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 ./ |
Thank you for the comments. The use case is to be able to read the docs sort of comfortably with minimal effort. The input format and the build would have to be more sofisticated for e-book like level, this script was an attempt to have good enough experiance (reading inside browser was slighly below this on my e-ink device).
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
I have opened the .html version in my Kobo and it works nice :)... 1 start ;)