68
MARKUP LANGUAGES AND WARP-SPEED DOCUMENTATION Lois Patterson – Presentation

Markup languages and warp-speed documentation

Embed Size (px)

Citation preview

Page 1: Markup languages and warp-speed documentation

MARKUP LANGUAGES AND WARP-SPEED DOCUMENTATION

Lois Patterson – Presentation

Page 2: Markup languages and warp-speed documentation

Lois Patterson - Presentation

What this presentation is about

• How software development culture is moving towards Dev Ops• Using markup languages to adjust to the Dev Ops culture• Advantages and disadvantages of different markup languages• How content written in a markup language is converted to attractive

documentation• How you can switch to using markup languages

Page 3: Markup languages and warp-speed documentation

Lois Patterson - Presentation

In the olden days …

Page 4: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Today’s demands

• Weekly, daily, hourly releases

Page 5: Markup languages and warp-speed documentation

Lois Patterson - Presentation

How about you?

• What type of team?

Page 6: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Agile development

• Agile workflows <-> continual, timely updates of code and docs

Page 7: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Are you agile?

Page 8: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Book recommendation:

Modern Technical Writing: An Introduction to Software Documentation Kindle Edition

by Andrew Etter

Page 9: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Documentation is not separate from the product

• Part of the product, embedded in the product

Page 10: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Dev ops and doc ops

• Dev ops, doc ops

• Full stack approach

Page 11: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Markup languages and doc ops• Simplify!

o Writingo Docs productiono Integration of docs with product

Page 12: Markup languages and warp-speed documentation

Lois Patterson - Presentation

What is a markup language?• Plain text, with various tags or other elements

that indicate how the text should be processed• HTML is best-known• XML – family of markup languages• Simple, doc-friendly markup languages: • reStructuredText• AsciiDoc• Markdown

Page 13: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Simple vs. complex markup languages

• DITA and DocBook• reStructuredText, Markdown, and AsciiDoc• Overhead versus structure

Page 14: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Markup languages foster content collaboration

• Learn a markup language quickly• Constant documentation updates require cross-team contributors• Make life easy for all contributors

Page 15: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Proprietary vs. open source

• Expensive and difficult tools, limited licenses• Free tools, unlimited users

Page 16: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Markup + Processor

• General principle: Write doc in markup language• Process the markup to get your final docs• DITA Open Toolkit, Sphinx (for reStructuredText), Jekyll (for Markdown)• Static site generators produce static HTML• Dynamic site generators render on the fly• GitHub processes various markup formats instantaneously

Page 17: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Let’s look at Markdown

• My portfolio page at GitHub

Page 18: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Page 19: Markup languages and warp-speed documentation

Lois Patterson - Presentation

More about Github

• 35 million repositories!

Page 20: Markup languages and warp-speed documentation

Lois Patterson - Presentation

GitHub, markup languages, and collaborative culture

• Github as an exemplar

• Full engagement from team

• Widespread contributions

• We’re in this together

Page 21: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Collaborative culture

Page 22: Markup languages and warp-speed documentation

Lois Patterson - Presentation

You can be a contributor

• Help out open source software• Learn new technologies• Build your portfolio

Page 23: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Do you have a Github site?

• Will you get a Github site?

Page 24: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Nitty-gritty

Page 25: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Challenges of unstructured languages

• DITA forces unity among writers. Deviation is punished.

• Impose structure with templates and standards.

• “You can, but you shouldn’t.”

• Structure and unity particularly important if localization is happening.

Page 26: Markup languages and warp-speed documentation

Lois Patterson - Presentation

reStructuredText

Page 27: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Let’s look at reStructuredText

• Start at readthedocs.org. (Docs at https://docs.readthedocs.io/ .)

• Python community origin

• Versatile

• Used with Sphinx static site generator

Page 28: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Let’s look at reStructuredText

• ReadTheDocs page, editable at GitHub

• Rendered at GitHub

• Rendered at ReadTheDocs.org

• You can do the same!

Page 29: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Sample reStructuredText template

Page 30: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Sample reStructuredText template

Page 31: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Look at a specific example

Page 32: Markup languages and warp-speed documentation

restructuredText looks like this

Getting Started===============

This document will show you how to get up and running with Read the Docs.You will have your docs imported on Read the Docs in 5 minutes,displayed beautifully for the world.

If you are already using Sphinx or Markdown for your docs, skip ahead to:ref:`import-docs`.

Page 33: Markup languages and warp-speed documentation

Sphinx transforms restructuredText

Page 34: Markup languages and warp-speed documentation

Compare restructuredText to DITA XML

Page 35: Markup languages and warp-speed documentation

XML (DITA XML) – VERY SIMPLE FILE• <?xml version="1.0" encoding="UTF-8"?>• <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">• <topic id="topic_qk5_knc_fg"> • <title>Troubleshooting</title> • <body> • <p>Troubleshoot most common issues.</p> • </body>• </topic>

Page 36: Markup languages and warp-speed documentation

From source to docs with Sphinx

Page 37: Markup languages and warp-speed documentation

SPHINX AND RESTRUCTUREDTEXT

• reStructuredText (reST) is rather like Markdown.

• Sphinx is a static site generator.

• restructuredText other stuff (HTML, PDF, etc.)

• restructuredText/Sphinx:: Markdown/Jekyll

Page 38: Markup languages and warp-speed documentation

SPHINX, DOCUTILS, RST - SUMMARY• Output formats• Extensive cross-references• Hierarchical structure• Automatic indices• Code handling• Extensions• Contributed extensions• Uses reStructuredText for markup, and Docutils for parsing

See more: http://sphinx-doc.org/index.html

Page 39: Markup languages and warp-speed documentation

Want to author in reStructuredText and generate in Sphinx?

Install Python first. (We used a 2.7.x version, but 3.3+ supported too.)

Sphinx Tutorial: http://sphinx-doc.org/tutorial.html

YouTube too! https://www.youtube.com/watch?feature=player_embedded&v=oJsUvBQyHBs

Look, copy, build, experiment

Page 40: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Static site generators• Server load reduced• Less prone to network difficulties and

intermittent errors• Speed, security• Available offline (many clients require this)• Recent count: 394 different ones• Choosing a well-supported one is key• Disadvantages too

Page 41: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Incorporating content from code

• Pull content from the code

• DRY (Don’t Repeat Yourself)

Page 42: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Automate, automate, automate

Page 43: Markup languages and warp-speed documentation

Lois Patterson - Presentation

Organization – still important

Page 44: Markup languages and warp-speed documentation

WHY WE LEFT THE CUSTOM XML WORLD

• Custom XML locked us in.

• HTML-based systems (e.g., MadCap Flare) do not easily integrate into our vision of all devs write

• Did not really leave after all

Page 45: Markup languages and warp-speed documentation

GREAT THINGS ABOUT SPHINX AND RST

• Well-developed eco-system• Python! • Versatile outputs• Easy to write• Easy to read• Text-based• Encourages topic-based authoring!

Page 46: Markup languages and warp-speed documentation

MORE BENEFITS

• Everyone writes• Tool-agnostic (emacs, vim, Notepad++, SublimeText, whatever you love)• Version-control friendly

Page 47: Markup languages and warp-speed documentation

OLD VS. NEW

Structured XML• Proprietary format• Complex build machinery• Tightly coupled with product (in a bad

way)• Supports MathJax

Positives

Enforced programming structure

It’s ours!

Sphinx/rsT• Open format• Easy to build• Easy to write• Easy to read• Supports MathJax• Negatives• Some customization needed

Page 48: Markup languages and warp-speed documentation

TYPICAL CONVERSION WORKFLOW (XML TO RST)• High-level website design• Create templates (for our sanity)• Convert content• Create content• (All the time be building)• Integrate into product and build system

Page 49: Markup languages and warp-speed documentation

WEBSITE DESIGN (DOCUMENTATION SYSTEM)• A corporate-branded site, not a personal or open-source look• Standard UX and design work• Liaise with Marketing and other stakeholders• jinja templating engines are a starting point

Page 50: Markup languages and warp-speed documentation

CREATE RESTRUCTUREDTEXT TEMPLATES

• restructuredText allows you to author without much structure (ironic?)• Enforce structure with templates and code reviews.

Page 51: Markup languages and warp-speed documentation

CONVERT CONTENT

• Pandoc!http://www.pandoc.org/

• Semi-manualCustom scripts

Page 52: Markup languages and warp-speed documentation

ALWAYS BE BUILDINGKnow how your docs look at any moment. (Continuous integration for docs.)

Page 53: Markup languages and warp-speed documentation

INTEGRATE INTO PRODUCT BUILD SYSTEM

Page 54: Markup languages and warp-speed documentation

CODE PRACTICES FOR DOCUMENTATION• Code review• Version control• Automated testing

Page 55: Markup languages and warp-speed documentation

WHAT ABOUT?

• Content reuse?• Content management systems?

Page 56: Markup languages and warp-speed documentation

CASE STUDY• Rackspace (along with NASA invented OpenStack)

switched/is switching OpenStack docs from DocBook XML to Sphinx/RST.• http://justwriteclick.com/2015/02/23/state-of-the-migration-to-sphinxrst/• https://wiki.openstack.org/wiki/Documentation/Migrate

Page 57: Markup languages and warp-speed documentation

CUSTOM EXTENSIONSDocs must pull information from the code in unique ways.

Page 58: Markup languages and warp-speed documentation

CREATE, USE MORE EXTENSIONS

Sphinx has so many options, just finding what is available takes time.

Page 59: Markup languages and warp-speed documentation

WHAT COULD HAVE BEEN BETTERNOT SO BLAMELESS POST-MORTEM

Page 60: Markup languages and warp-speed documentation

COULD HAVE STARTED SOONER

But Sphinx did not exist way back when ….

Page 61: Markup languages and warp-speed documentation

MORE AUTOMATION

Lack of time, but still …

Page 62: Markup languages and warp-speed documentation

MAKE TASKS MORE GRANULARToo big and scary a task? Break it down!

Page 63: Markup languages and warp-speed documentation

SHOULD YOU USE MARKUP LANGUAGES?

Page 64: Markup languages and warp-speed documentation

IT DEPENDSConsider:

• Markdown (different flavors)

• AsciiDoc

• DocBook

• DITA XML

• Or ?

Page 65: Markup languages and warp-speed documentation

WHAT NOT TO DO

• Design your custom bespoke system from scratch by yourself.• Except if …

Page 66: Markup languages and warp-speed documentation

RESOURCES• http://sphinx-doc.org/• http://readthedocs.org• http://www.pandoc.org

http://justwriteclick.com/2015/02/23/state-of-the-migration-to-sphinxrst/

https://wiki.openstack.org/wiki/Documentation/Migrate

http://sphinx-doc.org/tutorial.html

https://www.youtube.com/watch?feature=player_embedded&v=oJsUvBQyHBs

Page 67: Markup languages and warp-speed documentation

Lois Patterson - Presentation

In summary

• Technical writers must work faster than ever• Technical writers must collaborate across teams• Markup languages facilitate a collaborative culture• You have huge flexibility in the solutions you choose• Structure, standards, and process are as important as ever

Page 68: Markup languages and warp-speed documentation

THANK YOU!

• Lois Patterson• [email protected]• Twitter: @LoisRP• Tumblr: http://www.AnAPIaDay.tumblr.com