Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code a Coding Book: Publish a paperback with Node, Haskell, Vim, Markdown, ASTs, and lots of piping.

Code a Coding Book: Publish a paperback with Node, Haskell, Vim, Markdown, ASTs, and lots of piping.

eBook + Paperback via Amazon:
https://jonathanleemartin.com/books/

Ever wondered where those beautifully-formatted books come from? As a developer, you actually have better tools and expertise at your disposal to craft stunning paperbacks than many publishing houses! Join us for a whirlwind overview of the tools, open source libraries and challenges that go into turning words into a paperback (and EPUB, MOBI, LaTeX, PDF…)

Jonathan Lee Martin

June 25, 2019
Tweet

More Decks by Jonathan Lee Martin

Other Decks in Programming

Transcript

  1. Code a Coding Book
    Publish a paperback with Node, Haskell,
    Vim, Markdown, ASTs, and lots of piping.
    JonathanLeeMartin.com/books

    View Slide

  2. I’m Jonathan Lee Martin.
    @nybblr

    View Slide

  3. I teach developers
    to craft exceptional software.

    View Slide

  4. I’ve worked with over 300 developers —
    from career switchers to senior developers
    at Fortune 100 companies — through their
    journey into software development.

    View Slide

  5. Functional React 3 days
    Practical TDD 5 days
    Full Stack JavaScript 8 week
    Express in a Hurry 1 day
    Remote Collaboration 5 days
    Functional Programming in JS 3 days

    View Slide

  6. Let’s do something together.
    jonathanleemartin.com
    Functional React 3 days
    Practical TDD 5 days
    Full Stack JavaScript 8 week
    Express in a Hurry 1 day
    Remote Collaboration 5 days
    Functional Programming in JS 3 days

    View Slide

  7. “The composition of vast books is a
    laborious and impoverishing
    extravagance.”
    — Jorge Luis Borges

    View Slide

  8. To write a book, you must
    first invent the universe.
    (mostly with JavaScript)

    View Slide

  9. Today, we’ll cover:
    1. High-level timeline of writing the book
    2. AST preprocessing for Web, ePub, MOBI, LaTeX, PDF
    3. Tech behind online distribution
    4. Unique challenges going from digital to print
    5. Q + A

    View Slide

  10. Timeline
    From concept to print

    View Slide

  11. Timeline
    1. Planning
    2. Writing
    3. Digital pipeline
    4. Technical reviews
    5. Editing
    6. Officialese
    7. Final digital layout
    tweaks
    8. Digital distribution
    9. Print pipeline
    10. Print layout
    revisions
    11. Prepress
    12. Proofing, proofing,
    proofing
    13. Proof hard copy
    14. Submit to Amazon
    15. Optimize
    marketing copy
    16. Real work begins!
    3–4 months

    View Slide

  12. Preprocessing
    Markdown ASTs for

    View Slide

  13. Preprocessing
    1. Markdown to
    JSON AST
    2. Image path
    transforms
    3. Cached SVG
    rendering
    4. AST
    concatenation
    5. Figure numbering
    6. Chapter
    numbering
    7. Unique header
    IDs
    8. Table of contents
    9. Syntax
    highlighting
    10. Diffing code
    blocks
    11. Intraline diff
    hints
    12. Term indexing

    View Slide

  14. Output Preprocessing
    1. Web (preview + debugging)
    2. ePub (main eBook format)
    3. MOBI (Kindle)
    4. PDF via TeX (LaTeX + XeLaTeX)

    View Slide

  15. Distribution
    Online eBook

    View Slide

  16. github.com/nybblr/bookseller-api

    View Slide

  17. Print
    From digital to

    View Slide

  18. Q + A
    1. How does that highlight-diff filter work?
    2. Why pipes instead of Make or Gulp?
    3. Why not use an off-the-shelf solution for
    writing / rendering / distribution?
    4. What’s the book actually about?

    View Slide

  19. Let’s do something together.
    jonathanleemartin.com

    View Slide