We use SQL queries to do most of analytical work at our company (PostgreSQL). Currently there are 250+ queries stored in fixed directory structure (there is also a lot of DDL/DML files). 

Is there any autodoc tool to create documentation of all those *queries* and produce some output (e.g. html)?

I know there are some tools that can be used for functions/tables/procedures documentation, but none (as far as I understand it) is suitable for queries, e.g.:

* [HyperSQL](http://projects.izzysoft.de/trac/hypersql)
* [Doxygen](http://www.doxygen.nl/)
* [NaturalDocs](http://www.naturaldocs.org)

In documentation, I would like to track the following:

* file name
* sql description
* author(s)
* project(s)
* tags

Limitation of fixed directory structure is obvious - there are many times where the query belongs logically to more folders, but you have too choose one. We have tried to use trac wiki, but it is to complicated (you have to copy/paste every version of your query to wiki). On the other hand you can use tags, it is easily searchable and you have versioning. I've also tried using some query tools with advanced built-in search (e.g. toad plugin for eclipse), but you have to write pretty complex regexs to get files your are interested in.

This is why I believe that autodoc approach is the only possible way for this task.