I just came up with a good idea for dealing with documentation and I wanted to post about it. One application I’m working on is fairly complex but has no real documentation. Because want users to be able to contribute to the documentation, I decided to put it in a wiki. It occurred to me that since the pages in the application have (or at least should have) good titles, I could automatically link into the specific help page by constructing a wiki URL based on the page title. We happen to use Mediawiki, so I just included the following line in the top level layout file that wraps every page:

<% if @page_title %> Help <% end%>

If a page has @page_title set, I get a dynamically generated link to the appropriate documentation in the Wiki. (The code in the example works in a Ruby RHTML file.)