Skip to content

Instantly share code, notes, and snippets.

@blaisep
Created April 13, 2022 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blaisep/aee5c49bcaf8c0303a18e95a0e026b48 to your computer and use it in GitHub Desktop.
Save blaisep/aee5c49bcaf8c0303a18e95a0e026b48 to your computer and use it in GitHub Desktop.

Code as docs - notes for the flyless.dev group

About this talk

We seek to surprise and delight developers. - devs don't like to write docs (or code, for that matter) - code is structured by nature - can we leverage the structure of code to produce docs? (spoiler: YES)

The four (plus one) categories

- Instructions (Howto, tutorial, )
- Reference (Release notes, API guides)
- Description (Sequence diagrams, RFC, Architecture guides, WhitePapers )
- Persuasion (Whitepapers, Data sheets, Benchmarks, demos)

... and chatter.

The tools

- Slack vs Gitter
- Discourse vs Discord
- GDocs vs Confluence
- Confluence vs Sphinx

The formats

- Markdown vs HTML
- rST vs Asciidoc (MyST)
- google docs vs Word

The Layouts

- HTML vs PDF
- ePub vs MOBI
- Confluence vs WikiMedia (somebody shoot me)

Pro tips: usability

- The `touch` pattern (reverse breadcrumb)
- Copy on write (how to avoid the /var/log/syslog black hole)
- Federate search, not editors

Wait, what about the code?

- the dream of literal programming
- Doxygen, comments as code
- docutils and rST
- templates and semantic markup
- cucumber and gherkin (feature files)

The decisions

- One file or many?
- One author or many?
- On version or many?
- On cycle or many?
- One content owner or many?

Structure of a doc

- Meta data (golden signals, SEO, dependencies)
- Context (set the stage with a human touch)
- Details (where the compiler is the source of truth)

the dream of literal programming

- academic, loose structure, DIY

Doxygen, comments as code

- Content is close to the source, but static
- Structured layout

docutils and rST

- Compiler binds symbols and meaning
- Dynamic and elastic

templates and semantic markup

- rST abstracts the functional parts
- Jinja abstracts the layout

CMS: compilers for docs

- Python Sphinx
  • Typo3 CMS
    • DITAA

Take Aways

- Avoid Google Search for help on Sphinx: (the oldest, least useful results appear first) [I like the coderefinery tutorial](https://coderefinery.github.io/sphinx-lesson/toctree/)
  • Sphinx Themes
  • The touch pattern
    • Federate search, not editors
    • Track readers if you can, downloads if you must
    • (Thanks to Diataxis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment