Skip to content

Instantly share code, notes, and snippets.

@sebastianrothbucher
Created March 16, 2019 16:12
Show Gist options
  • Save sebastianrothbucher/e2b82202432657052d6d56bd30bfe6d2 to your computer and use it in GitHub Desktop.
Save sebastianrothbucher/e2b82202432657052d6d56bd30bfe6d2 to your computer and use it in GitHub Desktop.
Reactjs docs as ebook (epub / Kindle)

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

echo '' > ALL.md
for i in $(cat nav.yml | grep 'id:' | awk -F:  '{print$2}')
do
cat "$i.md" >> 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)
@jb08
Copy link

jb08 commented Jul 17, 2020

thanks @sebastianrothbucher. I used this script! Here's the output if helpful to anyone: Kindle format.

@bangedorrunt
Copy link

bangedorrunt commented Jul 26, 2020

@sebastianrothbucher, tks for the script, but i got these errors:

cat: profiler.md: No such file or directory
cat: react-api.md: No such file or directory
cat: react-component.md: No such file or directory
cat: react-dom.md: No such file or directory
cat: react-dom-server.md: No such file or directory
cat: dom-elements.md: No such file or directory
cat: events.md: No such file or directory
cat: test-utils.md: No such file or directory
cat: test-renderer.md: No such file or directory
cat: javascript-environment-requirements.md: No such file or directory
cat: glossary.md: No such file or directory

@gjorgiev
Copy link

gjorgiev commented Jan 3, 2021

Thanks a lot for the script. I am posting the output in epub format here. Download Docs (epub)

@karl-friman
Copy link

Posting the epub output for Aug 29th 2021 here:
https://github.com/monotones1/reactjs-docs-epub
I just did
pandoc *.md > all.html
and then changed the TOC in Calibre

@tiffany-taylor
Copy link

tiffany-taylor commented Aug 13, 2024

git clone git@github.com:reactjs/react.dev.git
cd react.dev/src/content/learn
pandoc *.md -o learn.epub
cd ../reference/react
pandoc *.md -o reference.epub

The markdown files can probably be combined into one epub, but I wanted to have them separate for my use case. I do get some errors, but seems like it might just be broken images... assuming the epub still works, I don't mind broken images for my use case.

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