Ask HN: How does your team write documentation? What tools do you use?
We're trying to get better at writing docs, so I thought I'd turn to you guys for help.
How does your team write documentation? What part of the documentation (e.g. architecture, processes, tooling) do you give the most attention to? What tools have you found helpful in improving the documentation your team writes?
90 comments
[ 3.2 ms ] story [ 173 ms ] threadI work at a small startup with a roughly 10-person eng team.
When we write docs we focus mainly on architecture and processes. The architecture docs often emerge from a "tech spec" that was written for the development of a feature that required a new service, or substantial changes to a new one. We keep everything in Github, in a README or other markdown files.
We also write API docs for HTTP endpoints. These are written with client developers and their concerns in mind. When doing this for a Rails app we use rspec_API_documentation, which is nice, but it can be annoying to have testing and documentation so tightly couples. We've talked about changing how we do this, but we always have more pressing things to do.
We never write docs for classes or modules within an app/service.
Regarding your comment on considering changing your API docs: What have you and your team talked about moving to?
Also, why no class or module docs? I find a docstring at the top of the class that talks about it's implementation, usage, etc very helpful.
That said, the preferred tool in our company is still MS Word. Fortunately I've managed to adapt Gitbook output to look pretty much the same as output from our Word template.
I know your feels. I've worked at companies that do things because "that's what people use". Never fun.
What sort of documentation do you and your team maintain other than your API docs?
Also: +1 for Sphinx! <3 ReST
flatdoc is a small JavaScript file that fetches Markdown files and renders them as full pages: https://github.com/rstacruz/flatdoc
Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API. http://swagger.io
- Installation just requires a pip install
- You can view the generated docs with `mkdocs serve`
- It comes with nice-looking themes, such as the readthedocs theme.
- You can deploy it to a static site host by just copying the site/ directory to your host.
We also have higher level documentation, which is meant to serve as a sort of conceptual overview of the framework, as well as to show what the framework comes with out of the box. This section is written mostly in kramdown, which gets parsed by jekyll before it's turned into HTML.
1) Write to all of your target audience. For example if your product is targeted at both technical and non-technical people, then write the documentation in such a way that non-technical folks can understand it. Don't just write for the technical people.
2) If possible, write documentation around several 'how do I do XYZ task'? My experience has been that people tend to turn to documentation when they want to execute a specific task and they tend to search for those phrases
3) As much as is possible, include examples. This tends to remove ambiguities.
I also want to add a ton of documentation around the "Why?" factor. Why did we make this decision? Why are we using this technology? etc.
The first question is always "How do I do this?". The second question is almost always "Why do I have to do it that way?". ;)
http://www.sphinx-doc.org/en/latest/
http://www.mkdocs.org/
Which make it easy to create html, pdf, epub, latex formats, etc.
I like to create a user guide, developer guide, and ops guide for each large project.
So whenever a new staffer comes along, I get asked to give them wiki access... but I'm the only one here that uses my edits (only ops staffer). Sure, have some wiki access, for all the good it will do you!
I really don't recommend our model :)
Anyway, this is an important point: documentation is not free. It takes time. Even shitty documentation takes time. If you want good documentation, you need to budget time away from other tasks. When I used to work in support, the field repair engineers would budget 30% of their hours for doing paperwork - not documentation specifically, but it clearly shows that 'writing stuff' is not something that springs as a natural/free parallel to other activity.
Wikis seem like such a great idea, but I've never seen an implementation that was good enough and low friction enough that people will actually use them. Same for Sharepoint...
The structured information can also be queried, visualized, exported to various data formets etc.
To document software projects, I really like to write *executable documentation". E.g. I'm using JSON Schema a lot to define my expected data structures and contracts between modules.
Then I write a small program that automatically generates the technical documentation based for me. Humans can still add/annotate to the documentation because it's a wiki (and I can separate between auto-generated and human-generated rather easily, because of queries).
So far, I really like this approach as it has the automation of doc generators, the flexibility of wikis. Most of the information is stored/accessible as data / API. The downside of this appraoch is, that this platform takes some time and knowledge to setup and model the data structure / forms. Without those, corporate wikis usually seem to die the "one man show" death you described
This is the most important step. If you cannot remember it from a blank slate, then no one can. Keep doing that until you understand the code at first glance. Then your code will be easy for anyone to maintain.
So we have a doc folder in the repo that is like staring into the maw of Cthulhu and takes up 90% of our build time on the CI server sucking that down mass of garbage for the checkout.
Saner systems have been proposed, but rejected because the powers that be are too averse to change...
I'm actually pretty proud of the search that I put together for this setup too, it's all done in the browser and the indexes are built at compile time which is then downloaded in full for a search, which sounds silly, but it works surprisingly well [4].
[1] https://github.com/exosite/docs/
[2] https://github.com/exosite/docs/blob/master/gulpfile.js
[3] http://docs.exosite.com
[4] http://docs.exosite.com/search.html?q=subscribe
Would anyone be interested in a write-up of how I put it together? It might finally be something to post to one of the umpteen blogs I've setup and never used.
http://tiddlywiki.com/
We do have the technical part down pretty well, but actually managing the documentation is one area that we're still lacking in. For the longest time our docs consisted mostly of just an API reference [1] and to be honest that did really cover about 90% of the needs of our customers, but that last 10% involved quite a bit of hands-on coaching with most of our customers to get them to understand the system as a whole before they could go off on their own and understand which API calls they'd need to make to do the thing they wanted to do.
One of the biggest helps has been keeping everything in github. Having all the docs be markdown is great because it's just text so everyone can use the tools they want to, we're not locked into some web wysiyg editor. And since it's all in git it's trivial for anyone in the company to open an issue about something incorrect or even submit a PR for anyone that's more technical. Plus when someone does have a question that I and the other editors don't know the answer to we can just git blame it to find out who put the piece in question there and ask them to clarify what they meant.
Now that we've been able to grow so much we're getting more able to focus on polishing up the docs, which is actually officially my job now that I've moved from the support team into the (new) technical marketing team. We've started making more information that describes how the system works as a whole [2] so that we can have completely hands-off customers who just pay us money without us having to personally walk them through the system.
Of course there are other fun things that I intend to do with it like interactive demo API requests and auto generating a table of contents, but those are really just 'wizz-bang' features that are fun and helpful but are definitely not required.
These are some of the other sites that I've taken (or am planning to take) inspiration from: [3] [4] [5]
[1] http://docs.exosite.com/rpc/
[2] http://docs.exosite.com/oneplatform/
[3] http://developer.wordnik.com/docs
[4] https://www.twilio.com/docs/
[5] https://docs.particle.io/
This seems like something that is a really good idea, but is hard to find any projects for it.
By way of example, I frequently use inline comments to discuss things like how a given class is architected, which (if any) popular design patterns are used, usage examples, etc. This stuff is really only relevant when you have the file open in your editor, so inlining the comments makes perfect sense.
I've been thinking about setting up a forum. That's a flexible form and might encourage creating the documentation that actually answers real questions.
The important thing about docs is to keep in mind the audience. This is important because it lets you estimate their mental model and omit things that are redundant: for example, if it's internal documentation for a codebase, there is little need to explicitly list out Doxygen or JSDoc style information, because they have access to the damned source code. External audiences may need certain terms clarified, or some things explained more carefully because they can't just read the source.
I'd say that the biggest thing missing in the documentation efforts I've seen fail is the lack of explanation for the overarching vision/cohesive architecture of the work. This is sometimes because there isn't a single vision, or because the person who has the vision gets distracted snarfing on details that are not helpful without a preexisting schema to hang them on when learning. So, always always always have a high-level document that describes the general engineering problem the project solves, the main business constraints on that solution, and a rough sketch of how the problem is solved.
Ideally, the loss of the codebase should be less of a setback than the loss of the doc.
I will say that, as your documentation improves, you will hate your project more and more--this is the nature of the beast as you drag yourself through the broken shards of your teams engineering.
Regarding documentation covering an overarching vision for the code: It is my experience that the person best-suited to write these docs -- i.e. The person who knows the codebase the best -- is always in demand at the company. This person has very little free time and I doubt they want to spent it writing docs for everyone else.
Is that something you've noticed?
The thing is, the company needs to understand that the smartest thing to do is to leave that person alone and task them on educating (here via docs, but also in other ways) the other developers (assuming the team is of sufficient size, which in my experience is the case as soon as total headcount is 3).
Hoarding expertise like that is a good way to waste company resources (because other devs function at a great disadvantage) and to bring down stress upon onself (becuase you become a bottleneck and that gets to be super stressful).
The fact of the matter is that it is anti-social and bad practice for these devs not to take a step back and write down the coherent vision of their product--and if they can't explain the vision in a handful of pages with some simple diagrams, they've probably deeply fucked up the design.
The company, management usually, needs to bite the bullet and sacrifice short-term firefighting ability for mid-to-long-term training.
If they won't do this, you should leave.
Trying to get people onto Sphinx [0], and use it for some non-sanctioned documentation with good success, but unlikely to make it official.
I really think version control is important: what changed, who changed it, provisional changes through branches, and removing the bottleneck of "I updated the docs, please everyone check before release and send me your comments". It should be patches, and only patches.
[0]: http://sphinx-doc.org/
With that said, what advantages are there to removing the bottleneck of "I updated the docs, please everyone check before release and send me your comments"? To me, personally, letting anyone update the docs without review sounds like a recipe for trouble.
I didn't mean everyone can update the docs, rather send feedback by patch/pull request of actual changes instead of writing in email with words that "Rewrite header 1 to be X, add label Y to figure 2, and add date into footer". Currently bloody Word Docs and PDFs are sent around twice a day for "please reply with your comments", and things get lost between emails, changes that were applied before disappear because someone edited the wrong version of the Doc, or exported into PDF in the wrong way... All in all, changes shouldn't happen in email text, IMHO.
Whether anyone can edit the docs - I'd actually like to see that (even if I haven't said that originally). Currently even the people who are charged with maintaining the docs update it only when pushed, I think in most places you'd be lucky if anyone touches it. On the other hand, an empowered team where anyone can access improve on things is a very different feeling, that's what creates successful stuff, IMHO. And with version control failure is cheap and easy to fix, so there's very little downside. Think of large public projects like OpenStreetMap or the Embedded Linux Wiki at http://elinux.org It works out pretty well for them with no big trouble, and they literally let everyone change things (not just project members).