Documentation Generation

Status
Not open for further replies.

drogin

Ars Tribunus Angusticlavius
8,283
Subscriptor++
I'm trying to work a documentation generator into my team's workflow and I'm looking for a recommendation on tooling.

I've used Doxygen pretty extensively in the past, but all it really does it generate a static set of files for your API. This isn't bad in and of itself, but I'm looking for something a bit more dynamic.

Ideally, I'd want something like doxygen that can be automated to regenerate the docs, but I'd like more of a wiki than just a flat API listing. I want the developers to be able to edit the documentation, but not lose it when it's regenerated.

For instance:

Developer adds a new class library to the project and it's fully commented. They run doxygen against it and wind up with some HTML files that describe the API. I'd then like the developer to go in and write some overhead content like a tutorial for using the library, maybe some graphics where appropriate (e.g. where does it really fit into the application).

Over time we'll have to regenerate the docs, but I don't want the developers to have to be overly burdened with the other non-generated documentation and it's maintenance.
 

rain shadow

Ars Tribunus Angusticlavius
6,680
Subscriptor++
it's been my experience that accurate comments are a rarity. documents sourced from comments don't increase the accuracy in any way.

it's been my experience that comments formatted to appease javadoc or doxygen end up being somewhat "forced" and don't say much beyond "the 2nd parameter is an integer and is named foo".

it's been my experience that developers are not interested in editing documentation. they want to write code, that's what they do best, that's what they get paid for, and it's reasonable when they have an RTFS mindset instead of an RTFM mindset.

it's been my experience that paying a real human being to generate documentation that has useful sample code, cross-references, indexes, and an actual narrative is so superior to generated documentation that you might as well not even bother. pay someone to do it right or don't do it at all.
 

drogin

Ars Tribunus Angusticlavius
8,283
Subscriptor++
nofundsleft":8d5hvjmp said:
it's been my experience that accurate comments are a rarity. documents sourced from comments don't increase the accuracy in any way.

it's been my experience that comments formatted to appease javadoc or doxygen end up being somewhat "forced" and don't say much beyond "the 2nd parameter is an integer and is named foo".

it's been my experience that developers are not interested in editing documentation. they want to write code, that's what they do best, that's what they get paid for, and it's reasonable when they have an RTFS mindset instead of an RTFM mindset.

it's been my experience that paying a real human being to generate documentation that has useful sample code, cross-references, indexes, and an actual narrative is so superior to generated documentation that you might as well not even bother. pay someone to do it right or don't do it at all.

I'm sorry about your experiences. I've been training this team for over a year so the comments and document is typically quite good. These are platform level APIs so it's important that the documentation be accurate and useful. RTFS is a good way to understand how one function works, but it's a bad way to understand how an application this large works.

I think what developers love better than writing code is writing code that works well and is useful. Code that doesn't cause them to get yelled at or asked why it only works some of the time. They also don't like to dig through everyone else's code in order to find the useful bits.
 

rain shadow

Ars Tribunus Angusticlavius
6,680
Subscriptor++
drogin":46h6p9dc said:
I'm sorry about your experiences. I've been training this team for over a year so the comments and document is typically quite good. These are platform level APIs so it's important that the documentation be accurate and useful. RTFS is a good way to understand how one function works, but it's a bad way to understand how an application this large works.

I think what developers love better than writing code is writing code that works well and is useful. Code that doesn't cause them to get yelled at or asked why it only works some of the time. They also don't like to dig through everyone else's code in order to find the useful bits.
okay, maybe i overstated it. but if i might be allowed to phrase it less alarmingly...if your need for high quality documentation is taking away time from people who can and should be writing high quality code, consider hiring a specialist to offload what seems to be a minor burden.

either way, you are lucky to have a team full of people capable of writing good comments.
 

drogin

Ars Tribunus Angusticlavius
8,283
Subscriptor++
nofundsleft":2j93bi51 said:
drogin":2j93bi51 said:
I'm sorry about your experiences. I've been training this team for over a year so the comments and document is typically quite good. These are platform level APIs so it's important that the documentation be accurate and useful. RTFS is a good way to understand how one function works, but it's a bad way to understand how an application this large works.

I think what developers love better than writing code is writing code that works well and is useful. Code that doesn't cause them to get yelled at or asked why it only works some of the time. They also don't like to dig through everyone else's code in order to find the useful bits.
okay, maybe i overstated it. but if i might be allowed to phrase it less alarmingly...if your need for high quality documentation is taking away time from people who can and should be writing high quality code, consider hiring a specialist to offload what seems to be a minor burden.

either way, you are lucky to have a team full of people capable of writing good comments.

It wasn't luck, it was a hell of a lot of work to convince them it was necessary :)

But, when the team went from 2 developers creating a prototype to eventually having two teams of five running parallel sprints, everyone started to see why it was necessary :)

Yes, we would definitely see some benefit from having a dedicated BA.
 

devjames

Wise, Aged Ars Veteran
107
I looked into this a while ago for the system I maintain. My system is in C#, mostly, so it came down to Sandcastle or Doxygen. I chose doxygen.

Did you know that the doxygen website was generated with doxygen? It can, a bit cruftily, generate pretty much anything you want it to with the downside of risking becoming tied to the doxygen formatting system.

That said, I've documented our scheduled tasks, workflow, build system, automatically-generated (scripts by me) database diagrams, workflow diagrams (dotfiles and graphviz), servers, administrative user-ids, etc. in doxygen such that it gets rebuilt and republished every time we commit to trunk.

I haven't had to try my hand at user documentation as our users decided to write their own - their cost-per-hour is lower than that of my group.

If I had to do user documentation, however, I'd probably choose to do it in doxygen just to avoid having another system to maintain. There's only three of us. Two programmers who consume all of the documentation and one system admin who consumes the non-API documentation.

Doxygen pros: it will do just about everything you wish; you can do it in either the source or separate files for other documents; generates pretty quickly

Doxygen cons: it has its own formatting system, plus some html-ish stuff; once built in doxygen moving to something else might not be so easy.

edit: check out the @ref and @subpage commands to get more of a 'web site' look. Outside-of-API documentation shows up in its own area in the tree on the left.
 
You can add much more to Doxygen output than just API calls. You can add pages of hyper-linked documents with graphics. You can also have it create sequence diagrams, etc.

You should be using source control so you already have a history of the documentation. Have it regenerated in the nightly build or on a commit. If you want to preserve the previously generated documentation it would be trivial to write a script to save it.
 
Status
Not open for further replies.