Automatically Generate MediaWiki Documentation of MS SQL Database Values

This is part 2 of the description of automating MediaWiki documentation using dbscript, and deals with documenting table data.

First, we need to specify which tables are to be documented: Go to the Project’s Value Scripts menu item, click New, select Script Type “XML”, enter an identifier for the script, and press Insert.

Next, go to the Tables item of the new Value Script. Select a table from the dropdown at the bottom of the page, and select Script Mode “Field Elements” (default).

I included the following tables of AdventureWorks in the documentation:

AddressType, AWBuildVersion, ContactType, CountryRegion, Culture, Currency, Location, SalesReason, SalesTerritory, ScrapReason, Shift, ShipMethod, UnitMeasure.

After you added the desired tables, they are displayed in the list Tables. Click each table name, and then its Columns menu.

From the Column dropdown, select the columns you want to add in your documentation, or press Insert All to include all columns. Columns can be deleted from the list by clicking Delete.

As the Value Script definition is complete, navigate to the Documentation Generator created in the previous post, and display its Parts page.

Under New Part, select Value Script, and click Create.

Enter a Sequence number, select an XSL (default “MediaWiki ValueScript DocGen”), select the newly created value script, and the database you imported the AdventureWorks schema from.

Specify an Alternate Page Section (e.g. “wikivalues”) to avoid overwriting the table definition in the default Page Section. Click Insert.

In the Documentation Generators menu click Generate, and generate the whole documentation, or just the newly created Part containing the data values.

Select the tables listed above to view data documentation samples on this project overview page. dbscript is available for download here.

One Response to Automatically Generate MediaWiki Documentation of MS SQL Database Values

  1. […] steps to setup the documentation generator are essentially the same as described here and here for MediaWiki wikis, except that the respective ScrewTurn alternatives (generator type, XSLs) have […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: