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 full-size slide

  2. I’m Jonathan Lee Martin.
    @nybblr

    View full-size slide

  3. I teach developers
    to craft exceptional software.

    View full-size 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 full-size 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 full-size 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 full-size slide

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

    View full-size slide

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

    View full-size 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 full-size slide

  10. Timeline
    From concept to print

    View full-size 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 full-size slide

  12. Preprocessing
    Markdown ASTs for

    View full-size 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 full-size slide

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

    View full-size slide

  15. Distribution
    Online eBook

    View full-size slide

  16. github.com/nybblr/bookseller-api

    View full-size slide

  17. Print
    From digital to

    View full-size 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 full-size slide

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

    View full-size slide