Document! X fully supports documentation of Javascript libraries. A comprehensive documentation set is generated providing an instant reference documentation set that the users of your Javascript library can use.
You can use JSDoc tags in order to provide extra structural information and documentation content in the source code. Document! X supports the following JSDoc tags: @constructor, @class, @enum, @interface, @struct, @namespace, @returns, @param, @protected, @private, @extends, @see
You can also use .NET standard Xml source comments in order to author content in the source code and / or use the Document! X Content File editor to author additional content outside of the source.
Create a new Javascript Reference Documentation Project
The new empty documentation project will be created and opened for edit. You can now add the Javascript Libraries that you wish to document:
Non-Constructable
Types that have been automatically found by Document! X but can't be constructed using a default constructor (without parameters). You can specify a custom constructor for each type in the textbox below the type name. The custom constructor statement can be any valid Javascript statement that returns an object of the required type, for example:
new MyObject("parametervalue")
Non-constructable types without a custom constructor will not be included in the documentation.
Automatic
Automatically found objects are objects that Document! X has inferred type information for either based on XML / JSDoc tags or by analyzing the runtime javascript object.
The inferred type can be overriden by selecting a different type in the combobox next to the name of the object.
Ambiguous
Ambiguous objects are objects that Document! X cannot automatically infer type information for.
A specific type can be selected in combobox next to the name of the object.
Excluded Global Objects
The selected Javascript library will be added to the Project Explorer under the Javascript Libraries node. You can expand down through each child node to tick / untick individual namespaces or types in order to include / exclude them from the generated output.
A Content File will be created and added to the project under the Content Files node for each Ajax Component you add to the project. You can use this Content File to author additional content in the pages that Document! X will automatically generate.
Author content is source code
You can use the .NET standard Xml comments or JSDoc tags in Javascript source code to provide structural and / or documentation content that will be used in the generated output.
function myType(p1, p2) { ///<summary>constructs a new myType object</summary> ///<param name="p1" type="string">p1 summary</param> ///<param name="p2" type="number">p2 summary</param> } ///<summary>field summary</summary> myType.prototype.field = 0; ///<summary>method summary</summary> ///<param name="p1" type="string">p1 summary</param> ///<returns type="number">method returns</returns> myType.prototype.method = function(p1) { }
/** * constructs a new myType object * @constructor * @param {string} p1 p1 summary * @param {number} p2 p2 summary */ function myType(p1, p2) { } /** field summary */ myType.prototype.field = 0; /** * method summary * @param {string} p1 p1 summary * @returns {number} method returns */ myType.prototype.method = function(p1) { }
Author content outside of the source code
If you would like to supplement the content of the pages automatically generated by Document! X outside of the source code, you can do so using the Document! X Content File 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 Document! X.
You can find more information on Topic Editing in the Topic Editor topic.
Change Javascript documentation settings
The settings that govern Javascript 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 Javascript documentation settings:
In the Build Profile editor, you can find the Javascript Settings pages under the Reference Documentation section.
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.
To identify undocumented items:
See the Undocumented Items topic for more information.
Build and deploy Javascript Reference Documentation
Click the Build Ribbon button on the Project ribbon tab to build your Javascript Reference Documentation.
Refer to the Deployment topic for more information on how to deploy your documentation to other machines.