Getting Started with Database Documentation
Document! X is a combination of an automated database documentation tool and a full documentation authoring environment which can be used to create accurate, professional quality database documentation for SQL Server, Access, or other OLEDB databases.
Document! X is not just an automated database documentation build tool - it also includes a fully-featured documentation authoring environment allowing you to author supplementary content (descriptions of database elements, hyperlinks to related pages or web sites etc.) where required.
Leverage your Existing Content
Document! X uses the content of Access and SQL Server description properties in the generated database documentation where available. This means that you can continue to use SQL Server Management Tools or the Access Table Designer to define descriptions for your tables, columns, triggers, indexes etc. and Document! X uses them automatically.
In addition, you can include specifically-formatted comments in your T-SQL code and views. Document! X extracts the comments and uses them in the generated SQL documentation.
Example Source Comments (single line comment style)
-- ##SUMMARY This procedure is an example of using various Document! X comment types -- ##REMARKS Single line and multi-line comments can be used and comments can include <strong>HTML Markup</strong> -- ##RETURNS Documents the return type of a procedure CREATE PROCEDURE ExampleTaggedComments @Param1 int = NULL, --##PARAM @Param1 The first parameter @Param2 varchar, --##PARAM @Param2 The second parameter @Param3 tinyint, --##PARAM @Param3 The third parameter AS ...
Example Source Comments (multi line comment style)
/* ##SUMMARY This procedure is an example of using various Document! X comment types ##REMARKS Single line and multi-line comments can be used with tagged comments in a single or separate multi line comment blocks and comments can include <strong>HTML Markup</strong> ##RETURNS Documents the return type of a procedure */ /* ##PARAM @Param1 The first parameter ##PARAM @Param2 The second parameter ##PARAM @Param3 The third parameter */ CREATE PROCEDURE ExampleTaggedComments @Param1 int = NULL, @Param2 varchar, @Param3 tinyint, AS ...
Database Documentation Fundamentals
Create a New Database Reference Documentation Project
Create an Empty Project
Creating an empty project creates a project without any content. You can customize its settings according to your needs.
To create an empty project:
- Click the Application Button at the upper-left of the Ribbon Menu.
- Click New and then select Empty Project.
- Enter a project name in the Project Name field.
The project is created in the default directory, which is configurable in the Options Editor (Paths page). However, you can optionally choose a specific directory to save your project by browsing the Project Directory field.
- Click Create.
The new empty documentation project is created and opened for edit. You can now add the Databases that you would like to document:
- Click the Add Database button on the Project tab.
- Use the displayed dialog to define the properties of the Database that you would like to document in this project.
- Click Ok.
The selected Database is added to the Project Explorer under the Databases node. You can expand down through the database node to select / deselect individual database elements in order to include / exclude them from the generated output. Repeat the process above if you would like to include additional Databases in the project.
A Content File is created and added to the project under the Content Files node for each Database you add to the project. You can use this Content File to author additional content in the pages that Document! X automatically generates.
Author Content in the Database
In Access and SQL Server you can use the various database item properties editors in Access or SQL Management Studio to author descriptions directly. In SQL Server you can also use the extended properties stored procedures to do this programmatically (see http://msdn.microsoft.com/en-us/library/ms190243.aspx).
See Author Content using the Content File Editor for authoring content outside of the source code.
Custom SQL Server Extended Properties
For SQL Server, you can define new Content Item Types in Document! X in order to store custom content types in extended properties - e.g. Author or Creation Date. The XML Tag Name of your custom Content Item Type is used to find the right extended property in SQL Server.
Tagged Source Comments
For database elements with source code (Views, Stored Procedures, Functions) you can also embed specifically tagged source comments that Document! X then uses in the generated output.
Example
-- ##SUMMARY This procedure is an example of using various Document! X comment types -- ##REMARKS Single line and multi-line comments can be used -- ##RETURNS Documents the return type of a procedure CREATE PROCEDURE ExampleTaggedComments @Param1 int = NULL, --##PARAM @Param1 The first parameter @Param2 varchar, --##PARAM @Param2 The second parameter @Param3 tinyint, --##PARAM @Param3 The third parameter AS ...
XSL Transformation
HelpStudio supports transforming source comments and extended properties to HTML using XSLT. Using XSLT to transform your database content allows more complicated and structured source content, the output of which can be customized without making changes to the original content itself.
See Transforming Content Item Type Content for more information.
Author content outside of the source code
If you would like to supplement the content of the pages automatically generated by Document! X and HelpStudio outside of the source code, you can do so using the Document! X and HelpStudio Content File Editor.
The Content File Editor allows you to review and author content for any item for which a reference documentation page is generated.
To open the Content File Editor:
- Expand the Content Files node on the Project Explorer.
- Locate the Content File for the item you wish to author content for.
- Right-click the Content File and select Edit.
- The Content File opened for editing. The tree on the left side of the editor shows you a hierarchical view of the item you are documenting.
- Drill down and select an item from the tree, the related documentation pages are shown on the right side of the editor.
- Select a specific content type from the toolbar/vertical menu to edit a specific type of content, for example, Summary, See Also, and Keywords.
- Type directly in the editable portions of the page on the right side of the editor.
Add Conceptual Topics
Conceptual information is a key part of reference documentation, providing a high level introduction, tutorials, or other conceptual information. You can easily create conceptual topics in HelpStudio.
- Click the New Topic button on the Project tab or use the Ctrl+T shortcut key.
- The new Topic will be created in the currently-selected Topic Category on the Project Explorer (or under the (Un-categorized) node if no category is selected) and will be opened for edit.
- Enter your conceptual content directly in the editable area of the Topic Editor.
You can find more information on Topic Editing in the Topic Editor topic.
Change Database Documentation Settings
The settings that govern Database Documentation generation are defined in the Build Profile editor. In a new project there is a single Build Profile but you can define many build profiles if you want to create multiple outputs with different settings.
To edit Database documentation settings:
- On the Project Explorer, expand the Build Profiles node.
- Double-click the required Build Profile to edit the properties.
Alternatively, you can also right-click the required Build Profile and select Edit to open the Build Profile editor.
In the Build Profile editor, you can find the Database Settings page under the Reference Documentation section.
You can change the Template used for Database documentation (which defines the look and feel of generated pages) on the Templates page.
Identify Undocumented Items
An essential part of delivering a complete documentation set is ensuring that all the items have been documented. Document! X includes the Undocumented Items tool to quickly and easily identify undocumented items.
- On the Tools tab, select the Undocumented Items option.
- Select the profile in the Project Profile field for which you want to find the undocumented items.
If your project contains only one Build Profile then it appears in the Project Profile field by default.
- Select Item Types, for example, Class, Method, Schema, and Column, that you want to check for undocumented items.
- Select Content Types to indicate the items that must be considered documented (just Summary by default).
- Select the Content Sources that should be used when checking for content.
- Select Execute. Any undocumented items will be listed in the results grid.
Build and Deploy Database Reference Documentation
Click the Build button on the Project tab to build your Database reference documentation.
Refer to the Deployment topic for more information on how to deploy your documentation to other machines.