Zaid-Ajaj / the-elmish-book

A practical guide to building modern and reliable web applications in F# from first principles
https://zaid-ajaj.github.io/the-elmish-book
Other
339 stars 51 forks source link

Not an Issue, but a guide to convert to epub #64

Open Hardt-Coded opened 4 years ago

Hardt-Coded commented 4 years ago

It's not perfect, but for those who want'S to read it on a e-ink reader or something. M;aybe that helps.

  1. download pandoc (https://pandoc.org/)

  2. convert all images in the md-files to a proper md-format (I used notpad++) replace in all files:

    the images-tags (<resolved-image source=")(.*)(" />) to ![.$2]\(.$2\)

    the highlight-tags inside the code blocks \{highlight: \[.*\]\} to (empty-string) \{ highlight: \[.*\]\ } to (empty-string) \{\s*highlight:\s*\[.*\]\s*\} to (empty-string)

  3. use following script (state: 2020-03-18) (cmd for windows - sorry guys)


REM Please adjust the path for pandoc if needed

"C:\Program Files\Pandoc\pandoc" ^
-o the-elmisch-book.epub ^
.\title.txt ^
.\ReadMe.md ^
.\chapters\audience.md ^
.\chapters\overview.md ^
.\chapters\planned-chapters.md ^
.\chapters\contributing.md ^
.\chapters\acknowledgment.md ^
.\license.md ^
.\chapters\fable\readme.md ^
.\chapters\fable\hello-world.md ^
.\chapters\fable\development-mode.md ^
.\chapters\fable\counter.md ^
.\chapters\fable\observations.md ^
.\chapters\fable\compatibility.md ^
.\chapters\fable\fable-packages.md ^
.\chapters\fable\fable-bindings.md ^
.\chapters\fable\node-packages.md ^
.\chapters\fable\how-fable-works.md ^
.\chapters\elm\readme.md ^
.\chapters\elm\the-architecture.md ^
.\chapters\elm\counter.md ^
.\chapters\elm\render-html.md ^
.\chapters\elm\conditional-rendering.md ^
.\chapters\elm\using-css.md ^
.\chapters\elm\form-inputs.md ^
.\chapters\elm\react-in-elmish.md ^
.\chapters\elm\todo-app.md ^
.\chapters\elm\todo-app-part1.md ^
.\chapters\elm\todo-app-part2.md ^
.\chapters\elm\todo-app-part3.md ^
.\chapters\elm\todo-app-exercises.md ^
.\chapters\elm\project-structure.md ^
.\chapters\commands\readme.md ^
.\chapters\commands\commands.md ^
.\chapters\commands\definition.md ^
.\chapters\commands\async-updates.md ^
.\chapters\commands\async-to-cmd.md ^
.\chapters\commands\failing-async.md ^
.\chapters\commands\async-state.md ^
.\chapters\commands\deferred-module-utilities.md ^
.\chapters\commands\recursive-updates.md ^
.\chapters\commands\async-recursive-updates.md ^
.\chapters\commands\http.md ^
.\chapters\commands\xhr-elmish.md ^
.\chapters\commands\async-xhr.md ^
.\chapters\commands\working-with-json.md ^
.\chapters\commands\using-json.md ^
.\chapters\commands\elmish-hackernews.md ^
.\chapters\commands\elmish-hackernews-part1.md ^
.\chapters\commands\elmish-hackernews-part2.md ^
.\chapters\commands\elmish-hackernews-part3.md ^
.\chapters\commands\elmish-hackernews-exercises.md ^
.\chapters\scaling\readme.md ^
.\chapters\scaling\pages-as-programs.md ^
.\chapters\scaling\splitting-programs.md ^
.\chapters\scaling\integrating-commands.md ^
.\chapters\scaling\composition-forms.md ^
.\chapters\scaling\understanding-data-communication.md ^
.\chapters\scaling\intent.md ^
.\chapters\scaling\routing.md ^
.\chapters\scaling\parsing-url-segments.md ^
.\chapters\scaling\parsing-date-segments.md ^
.\chapters\scaling\programmatic-navigation.md ^
.\chapters\scaling\introducing-url-type.md ^
.\chapters\scaling\modelling-nested-routes.md ^
.\chapters\scaling\multi-page-routing.md ^
.\chapters\dev-flow\readme.md ^
.\chapters\dev-flow\webpack-mode.md ^
.\chapters\dev-flow\compiler-directives.md ^
.\chapters\dev-flow\configuration-variables.md ^
.\chapters\dev-flow\hot-module-replacement.md ^
.\chapters\dev-flow\understanding-webpack-loaders.md ^
.\chapters\dev-flow\static-images.md ^
.\chapters\dev-flow\styling-with-sass.md ^
.\chapters\dev-flow\introducing-femto.md

Update: had to adjust the highlight replace regex

Zaid-Ajaj commented 4 years ago

Hello there @DieselMeister. Thanks for the suggestion even I though I can't think of any good reason why someone would want to read this on anything but a browser: there are links to references, git repositories, animations and typos are fixed in real-time.

Hardt-Coded commented 4 years ago

Hi. I am on the way to go to bed and I want to read this on my kindle :D So I decided to convert this for this reason and share the knowledge.

But you are right. With the references the best way is to read it in the browser.

Zaid-Ajaj commented 4 years ago

Well fair enough :smile: good night!

melston commented 4 years ago

Well, one reason for an epub/pdf version is that you can put it down and come back later to the same place you left off (ebook readers/acrobat remembers this information - browsers generally don't). But, it is static and you do lose out on the updated information when it is available.

Thorium commented 3 years ago

As there seems to be some epub users, could it be possible to link some old version to git repo?

Edit: For me, it's more like a bookmark: read these when you have some extra time. Easier to remember from Kindle / Google Books library where are all the other unread books and research papers. Libraries of web-links tend to expire and go missing.

kodfodrasz commented 3 years ago

For me reading technical books in paper/ebook is more effective than in a browser: There are less distractions. If I get stuck I can still go to a computer to research the problem in question, but my method is usually reading up on the topic, gathering knowledge and context in a larger sprint, then later doing assignments, or practice or starting to use something in larger experiments in a larger batch/sprint.

Also the (e)book I have won't go 404, as Thorium noted.