I am using NaturalDocs to self document the database objects (i.e. stored procedures, triggers, user defined functions and other horrors alike).

NaturalDocs is a documentation processor that create sets of web pages from comments inside the code.

It implies to respect _very few_ comment formatting rules. NaturalDocs, as its name states, is quite flexible about the way the comments are written.

Here are the basic rules to respect :

Documentation naming rules

As an example, I am using the following template to comment the code, in order to have Creation and Modifications nicely formatted :

/******************************************
Procedure: dbo.DoSmth
 
Do Something
 
Creation:
  2002-07-21 - rudi
 
Modifications:
  2002-08-21 - rudi - read and approved
  2002-09-21 - rudi - read again
  2002-10-21 - rudi - what is that doing ?
*******************************************/
CREATE PROCEDURE dbo.DoSmth 
AS 
/*
Topic: Particular handling
*/
BEGIN
...
Patch NaturalDocs to ignore the database/owner prefixes

( I have renamed for myself the NaturalDocs::Languages::PLSQL to NaturalDocs:: Languages::SQL) )

in naturalDocs/Modules/NaturalDocs/Languages/SQL.pm, added a

 sub RemovePrototypePrefix
   {
   my ($self, $prototype) = @_;
   return ($prototype =~ /\.([\w\$]+?)$/)[0];
   };

In naturalDocs/Modules/NaturalDocs/SymbolTable.pm, MakeIndex, Added this after <i>my @definitions = $object→Definitions();</i>

 if ((NaturalDocs::Languages::LanguageOf($definitions[0])->Name == 'SQL') && ($type == ::TOPIC_FUNCTION()))
   {
   $symbol = NaturalDocs::Languages::SQL->RemovePrototypePrefix($symbol);
   } 
 
Not safe in case of multiple definitions in different files, but ok for me.
 
sql_server/outils/naturaldocs.txt · Dernière modification: 2006/03/05 14:29 (édition externe)