77 points · by brwr · 10y ago · 90 comments
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?
I 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.
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/
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.
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
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
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.
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).
- Easy editing (namely markdown files in folders) - Runs on "cheap" hosting/everywhere (built with PHP) - Supports multiple languages (so you can create docs in english, german, etc.) - Can have editable try-on-your-own demos embedded into the documentation - SEO friendly (clean URLs and navigation structure) - Themeable (themes are separated and run with the Twig templating engine) - Works on mobiles out of the box - Supports Plugins/Modules for custom content/behaviour - Formats reference pages for objects/classes/APIs in a nice way - Supports easy embedding of disqus for user feedback - Other stuff I forgot right now
The system powers the knowledge base of my recent app "InSite" for web developers: https://www.insite-feedback.com/en/help
You can see it also in action working - with a different theme - for my javascript UI library "modoJS": http://docs.modojs.com
That page is a bit more complex. It does _not_ use multiple languages there but it makes great use of the reference pages and has many many editable live-demos. It also has some custom modules like a live build script for the javascript library. At one point it even had a complete user-module with payments but I disabled that when modoJS went opensource.
Another instance of docEngine runs for my pet html5 game engine: http://wearekiss.com/gamekit This one uses the default theme, has most pages in two languages and again incorporates a couple of live demos.
I host a little documentation about the engine itself here, but its not complete right now: http://wearekiss.com/docEngine You can also find the github link to the project in the footer of every hosted documentation.
Have fun with it - I give it away for free. Critics and comments welcome! Everything I have linked was built by myself.
Besides the README.md to get started, the app defaults to a private portal with a component playground (for React), internal docs (for answering "how do I"), and tools for completely removing the need for doc pages at all.
I believe that documentation has to be part of the workflow, so component documentation should be visible while working on the component, tools for workflow should have introductions and helpful hints rather than being just forms and buttons, etc.
So far, this is proving fruitful.
(Side note: wikis are where docs go to die.)
Two questions for you:
1) I agree that documentation has to be a visible part of the workflow, but getting buy-in from the whole team is difficult even with small decisions. What have you done to get your team onboard with writing docs?
2) Why are wikis where docs go to die?
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.
I believe that literate style of code writing has many benefits in any language.
Basically mix markdown with the codebase and export the documentation from the same file.
For a very well executed and interactive example check out
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
http://www.sphinx-doc.org/en/latest/
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.
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?". ;)
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.
We generate the bulk of those manuals based on our object model, which is liberally sprinkled with (text only) descriptions. We've created a simple XML-based authoring framework which allows us to create pretty tidy documentation. Including images, tables, code examples etc.
We convert that XML to Apache FOP. At the end of the process, we're left with a bunch of tidy PDF manuals in a variety of languages.
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.
* macros allow us to produce integration-specific installation and user guides
* ability to generate HTML and PDF versions
Lately though I'm beginning to regret this choice. The owner of the docs isn't allowed to commit to our repo (for good reason), but this means I get changes via the wiki which need to be cut and pasted in. Also, the HTML output was never really good enough, so we've stopped doing that. Getting long tables to look good takes a lot of rebuild-and-check cycles. But my biggest issue is that having a common source for each document with minor version-specific changes sounds great until you try to adjust the page breaks. What looks good for one doc looks bad for another, it's a real nightmare.
* MS doc(x) on a network folder with an excel spreadsheet to keep track of docs (and a lot of ugly macros).
* MS doc(x) in a badly organized subversion repository (side note here, docs comments and revision mode are heavily used in those contexts, which is really annoying)
* rst + sphinx documentation in a repository to generate various outputs (html, odt, pdf...) depending on the client.
In some cases we also use Mako (a python template engin) before sphinx to instantiate the documentation for a specific platform (ex: Windows, RedHat, Debian...), with just a few "if" conditions (sphinx could do it in theory, but it's quite buggy and limited).
I've also put in place a continuous build system (just an ugly shell script) rebuilding the sphinx html version every commit (it's our "badly implemented readthedocs.org", but it's good enough for our needs).
In other cases we use specification tools like PowerAMC or Eclipse/EMF/CDO based solutions, the specification tool in that case works on a model, and can generate various outputs (docx, pdf, rtf, html...).
At home, for my personal projects, I use rst + sphinx + readthedocs, or if the documentation is simple, just a simple README.md at the root of my repository.
As a personal opinion, I like to keep the documentation close to the code, but not too close.
For example, I find it really annoying when the sole documentation is doxygene (or equivalent), it's necessary to document each public methods/attributes individually, but it's not sufficient, you need to have a "bigger picture documentation" on how stuff works together (software and system architecture) in most cases.
On the other side, keeping the documentation away from the code (in a wiki or worst) doesn't work that well either, it's nearly a guaranty that documentation will be out of date soon, if it's not already the case.
I found having a doc directory in the source code repository a nice middle ground.
I found wikis annoying in most cases, rarely up to date, badly organized and difficult to version coherently and properly (ex: having version of the doc matching the software version).
Ideally, I'd love to find a mechanism that:
- provides the OO principles in documents; Encapsulations, Abstraction, Polymorphism, Inheritance .
- Accessible & maintainable by non-techies.
- Allows scripting (I toyed with PlantUML, but it was a bit rigid).- 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.
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.
The rest of the systems are documented ad-hoc. Some readme files here and there, a large block of comments inside of confusing files, the occasional style guide, etc.
We also have an onboarding guide for new devs (just a PDF) which walks them through our systems, our tools, etc. Nothing fancy, about 10 pages.
I have a CVS repository of PDF and Word docs.
The business side uses docx format, so using markdown and generating docx is not really feasible. I have run into issues of people changing the filename and it creating a new entry in the version control. I have a idea I plan to implement to fix this.
What I would really like is some linux system that would make it easy to pull the text out of docx and make it searchable. I would want something that could run on the command line that does not have a ton of dependencies.
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.
As for code, auto generated docs from jsdoc etc. headers are fine but I never use them honestly. I find unit tests to be the ultimate documentation in terms of code level docs.
Beautiful documents, but it takes a decent chunk of time to create. We do extract some docs via XML to generate code, somewhat backwards from how most engineers merge docs and code.
I'm trying to gather a community of git supporters to push for git.
However, after three months I still haven't gotten a computer suitable for my job.
We are using DITA as well, in a 10 people company. Because it is so much fun to go through XML right ?
The genius in DITa, I think, is that the guys behind it have basically created a market by themselves. I mean, the main reason we don't get off it today is because we had to hire an expert long time ago to get our layout done, and we don't want to have to redo it.
Sad times :).
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...
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.
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
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...
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.