Skip to content

Instantly share code, notes, and snippets.

@sebastianrothbucher
Created March 16, 2019 16:27
Show Gist options
  • Save sebastianrothbucher/dd2a0ac8f11637375f8e4af79cbeae1e to your computer and use it in GitHub Desktop.
Save sebastianrothbucher/dd2a0ac8f11637375f8e4af79cbeae1e to your computer and use it in GitHub Desktop.
Vuejs guide as ebook (epub / Kindle)

This is how you can conver the vuejs guide to a .ePub / Kindle (.mobi) file to read in an eReader (or eReader app):

  • Make sure you have Pandoc available (on a Mac, it can be installed by brew install pandoc via Homebrew)
  • Checkout or download master from the Vue docs repo [https://github.com/vuejs/vuejs.org]
  • go to src/v2/guide
  • run the following commands in a shell (builds one markdown in order of order attr in each file):
echo '' > toc
for i in *.md
do 
echo "$(cat $i | grep '^order:' | head -1 | awk -F: '{printf("%03d", $2)}') $i" >> toc
done
echo '' > ALL.md
for i in $(cat toc | sort | awk '{print$2}')
do
cat $i >> ALL.md 
done
  • convert to an epub via pandoc ALL.md -o ALL.epub
  • Open All.epub in Calibre
  • edit metadata (and poss. convert to MOBI via Conversion)
@davidhenley
Copy link

This doesn't work anymore.

@mlvrkhn
Copy link

mlvrkhn commented Mar 4, 2021

any update on this?

@lttr
Copy link

lttr commented Jan 18, 2024

I've created a script for Vue3 docs, in my case, exporting to HTML, which works even better then EPUB.
https://gist.github.com/lttr/459ce1728a8b080be0132cd2ce166254

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