Things I Wish People Told Me About Writing Docs

A presentation at API Strategy & Practice in November 2017 in Portland, OR, USA by Taylor Barnett

Slide 1

Slide 1

THINGS I WISH PEOPLE TOLD ME ABOUT WRITING DOCS @taylor_atx

Slide 2

Slide 2

TAYLOR BARNETT Community Engineer at Keen IO taylor@keen.io @taylor_atx

Slide 3

Slide 3

HOW DO PEOPLE ACTUALLY READ DOCS? @taylor_atx

Slide 4

Slide 4

@taylor_atx

Slide 5

Slide 5

https://www.nngroup.com/articles/f-shaped-pattern-reading-web-content

Slide 6

Slide 6

IMPLICATIONS OF F SHAPE • First two paragraphs must state the most important information • Further, the first 3-5 words are very important • Start headers, paragraphs, and bullet points with informationcarrying words • Variations in typeface (text size, links, bold, etc) @taylor_atx

Slide 7

Slide 7

STRUCTURE • Prevent search failure - what the users wants doesn’t stand out • One idea per paragraph, if there’s more than one, split the paragraphs • Users skip over things that look like ads • Aim for 65-90 characters in width @taylor_atx

Slide 8

Slide 8

USABILITY VARIES: PARAGRAPH VS BULLETS @taylor_atx

Slide 9

Slide 9

USABILITY VARIES: PARAGRAPH VS BULLETS Event collections can have almost any name, but there are a few rules to follow: The name must be 64 characters or less. It must contain only Ascii characters. It cannot be a null value. @taylor_atx

Slide 10

Slide 10

USABILITY VARIES: PARAGRAPH VS BULLETS Event collections can have almost any name, but there are a few rules to follow: The name must be 64 characters or less. It must contain only Ascii characters. It cannot be a null value. Event collections can have almost any name, but there are a few rules to follow: • The name must be 64 characters or less. • It must contain only Ascii characters. • It cannot be a null value. @taylor_atx

Slide 11

Slide 11

USERS ACTUALLY READ CODE SNIPPETS @taylor_atx

Slide 12

Slide 12

WHAT IS THIS CODE SNIPPET MISSING? var client = new Keen({ projectId: “your_project_id”, writeKey: “your_write_key” }); var ticketPurchase = { price: 50.00, user: { id: “020939382”, age: 28 }, artist: { id: “19039”, name: “Tycho” } } 🤔 client.addEvent(“ticket_purchases”, ticketPurchase); @taylor_atx

Slide 13

Slide 13

WHAT IS THIS CODE SNIPPET MISSING? var client = new Keen({ projectId: “your_project_id”, writeKey: “your_write_key” }); var ticketPurchase = { price: 50.00, user: { id: “020939382”, age: 28 }, artist: { id: “19039”, name: “Tycho” } } • First, how do I even run this? ” client.addEvent(“ticket_purchases”, ticketPurchase); @taylor_atx

Slide 14

Slide 14

WHAT IS THIS CODE SNIPPET MISSING? var client = new Keen({ projectId: “your_project_id”, writeKey: “your_write_key” }); var ticketPurchase = { price: 50.00, user: { id: “020939382”, age: 28 }, artist: { id: “19039”, name: “Tycho” } } • First, how do I even run this? ” • “ReferenceError: Keen is not defined” client.addEvent(“ticket_purchases”, ticketPurchase); @taylor_atx

Slide 15

Slide 15

WHAT IS THIS CODE SNIPPET MISSING? var client = new Keen({ projectId: “your_project_id”, writeKey: “your_write_key” }); var ticketPurchase = { price: 50.00, user: { id: “020939382”, age: 28 }, artist: { id: “19039”, name: “Tycho” } } • First, how do I even run this? ” • “ReferenceError: Keen is not defined” • Didn’t set the Project ID and Write Key client.addEvent(“ticket_purchases”, ticketPurchase); @taylor_atx

Slide 16

Slide 16

PREVENT COPY AND PASTE BUGS What will this return?

Copy and paste the following command

🤔 $ gem install rails @taylor_atx

Slide 17

Slide 17

PREVENT COPY AND PASTE BUGS What will this return?

Copy and paste the following command $ gem install rails # Returns “bash: command not found: $”

😔 @taylor_atx

Slide 18

Slide 18

TWILIO @taylor_atx

Slide 19

Slide 19

WHAT DO I MEAN BY “DOCS?” API REFERENCES GUIDES TUTORIALS BLOG POSTS* @taylor_atx

Slide 20

Slide 20

GUIDES • Somewhere between API references and tutorials • Similar reference but with prose that explains how to use the API • Example: Authorization guide @taylor_atx

Slide 21

Slide 21

Slide 22

Slide 22

TUTORIALS • Teach specific things with an API, beginning to end, including setup • Tightly focused on a few pieces of functionality • Includes working sample code • Example: Getting Started or Hello World tutorial @taylor_atx

Slide 23

Slide 23

SPRING FRAMEWORK @taylor_atx

Slide 24

Slide 24

BLOG POSTS • “Share Knowledge, Not Features” — Adam DuVander • Features != Benefits • A blog post should teach, inspire, and help • Give a preview, then help navigate them to the full docs @taylor_atx

Slide 25

Slide 25

@taylor_atx

Slide 26

Slide 26

DOCS NAVIGATION AND UNIVERSAL PRINCIPLES OF DESIGN @taylor_atx

Slide 27

Slide 27

  1. PROGRESSIVE DISCLOSURE @taylor_atx

Slide 28

Slide 28

  1. NAVIGATE FROM DOC SET TO DOC SET @taylor_atx

Slide 29

Slide 29

DOCS PORTAL HOMEPAGE PRODUCT HOMEPAGE SECTION HOMEPAGE PAGE @taylor_atx

Slide 30

Slide 30

@taylor_atx

Slide 31

Slide 31

  1. IMMERSION @taylor_atx

Slide 32

Slide 32

  1. ALLOW NAVIGATION WITHIN CONTENT @taylor_atx

Slide 33

Slide 33

BOTTOM-UP NAVIGATION • If you tell me I can do something, link to how to do that something. • If you tell me I can use something, link to a description of that something. • If you mention a concept or an idea, link to a description of that concept or idea. — Mark Baker from “Every Page is Page One” @taylor_atx

Slide 34

Slide 34

@taylor_atx

Slide 35

Slide 35

  1. MODULARITY @taylor_atx

Slide 36

Slide 36

  1. REDUCE INFORMATION FRAGMENTATION @taylor_atx

Slide 37

Slide 37

@taylor_atx

Slide 38

Slide 38

Slide 39

Slide 39

😨 😨 @taylor_atx

Slide 40

Slide 40

LIBRARIES SDKS WRAPPERS CLIENTS @taylor_atx

Slide 41

Slide 41

WHY DO BAD NAMES PERSIST? • Because we don’t realize that the name is bad • Or we do, but can’t or won’t justify fixing it because we… • Are tied to it • Can’t justify the time • Don’t know the value • Don’t have the agency to fix it @taylor_atx

Slide 42

Slide 42

EMPATHY FAILURE BEGINNER’S MIND FAILURE @taylor_atx

Slide 43

Slide 43

WORD CHOICE IS HARD • Hard to give one framework to use, but you can… • Talk to users, get feedback - ask someone to review it • Refactor and rewrite • Search existing names @taylor_atx

Slide 44

Slide 44

@taylor_atx

Slide 45

Slide 45

ERROR MESSAGES @taylor_atx

Slide 46

Slide 46

ERROR MESSAGES ARE AN OPPORTUNITY @taylor_atx

Slide 47

Slide 47

3 H’S OF GOOD ERROR MESSAGES: HUMBLE HUMAN HELPFUL @taylor_atx

Slide 48

Slide 48

HUMBLE • Apologize even if it is not your fault • Example: • Sorry, we could not connect to ___. Please check your network settings, connect to an available network, and try again. @taylor_atx

Slide 49

Slide 49

HUMAN • Speak in human terms • Example: • Your API Key is invalid, please try a different key. @taylor_atx

Slide 50

Slide 50

HELPFUL • Share what the users can expect or do to fix the problem • Example: • Sorry, the image you tried to upload is too big. Try again with an image smaller than 4000px tall by 4000px wide. @taylor_atx

Slide 51

Slide 51

WRITING ERROR MESSAGES 1. Acknowledge 2. Apologize 3. Explain 4. Help @taylor_atx

Slide 52

Slide 52

WRITING ERROR MESSAGES • Object first, action second • What the users wants first, how to get there second • If you can, put the input in the error string @taylor_atx

Slide 53

Slide 53

ERROR MESSAGE SEO • If users get an error message often, put the exact text in your docs • You can also edit StackOverflow posts @taylor_atx

Slide 54

Slide 54

HOW DO I GET OTHER TEAMMATES TO CONTRIBUTE TO DOCS? @taylor_atx

Slide 55

Slide 55

“I DON’T HAVE THE TIME” “DOCS ARE HARD TO MAINTAIN” “JUST READ THE SOURCE” “DOCUMENTATION IS USELESS” — Fred Hebert from “Don’t be a Jerk: Write Documentation” @taylor_atx

Slide 56

Slide 56

MAKE SURE CONTRIBUTORS ARE VALUED & REWARDED @taylor_atx

Slide 57

Slide 57

SHOW THE BENEFITS @taylor_atx

Slide 58

Slide 58

GITHUB FOR DOCS • Continuous integration and automated testing • Issues • Incremental changes @taylor_atx

Slide 59

Slide 59

REVIEWS • “Pair” on reviews • Use reviews to coach contributors • For small suggestions, fix it yourself and share before merging • If a review sounds harsh, reach out and let them know you aim to instruct and appreciate them @taylor_atx

Slide 60

Slide 60

STYLE GUIDES • Frees your contributors to focus on what’s more valuable, instead of grammar, consistency, or other issues • Examples: • Google Developer Documentation Style Guide • 18F Content Guide @taylor_atx

Slide 61

Slide 61

TAYLOR BARNETT Community Engineer at Keen IO taylor@keen.io @taylor_atx

Slide 62

Slide 62

APPENDIX: LINKS • How Users Read on the Web article: https://www.nngroup.com/articles/how-users-read-on-the-web/ • Articles: https://www.nngroup.com/topic/writing-web/ • How to Write Documentation for People that Don’t Read talk: https://youtu.be/sQP_hUNCrcE • Designing Great API Docs blog post: http://blog.parse.com/learn/engineering/designing-great-apidocs/ • Blog plus much more: http://idratherbewriting.com/ • Building navigation for your doc site: 5 best practices talk: https://youtu.be/w-kEmsLwPDE • Building navigation for your documentation site: 5 best practices in design blog post: http:// idratherbewriting.com/files/doc-navigation-wtd/design-principles-for-doc-navigation/ • Breaking Down Barriers to “Hello World” talk: https://www.slideshare.net/taylorsoitgoes/breakingdown-barriers-to-hello-world-79181115 • Even Naming This Talk Is Hard talk: https://youtu.be/RFfpkrbkvxc • Error Messages: Being Humble, Human, and Helpful talk: https://youtu.be/gBBZUATL7Qo • Don’t be a Jerk: Write Documentation blog post: https://ferd.ca/don-t-be-a-jerk-writedocumentation.html • Docs like Code book: https://www.docslikecode.com/

Slide 63

Slide 63

APPENDIX: A NOTE ON OPENAPI SPECIFICATION • Spec output can provide a clear source for reference info about endpoints, parameters, requests, and responses • Auto generation is a starting point • Still need more use cases, authorization, why API exists, more samples, and tutorials • Think of it as a compliment, a sandbox to play around with • Two sites isn’t necessarily a bad thing @taylor_atx