Document! X & HelpStudio Bundle 2022.1
Creating and Editing Content / Reusing Reference Content
In This Topic
    Reusing Reference Content
    In This Topic

    If you are authoring content for reference documentation items, you may find that the same content is usable in several places. There are several ways in which you can minimize duplication by re-using content associated with reference documentation items:

    For .NET method or property overrides, use the content from the base member

    If you have an overriden member for which the base documentation content is valid, you can tell Document! X and HelpStudio Bundle to use the base member content rather than duplicating the content.

    To automatically use the base member content for all overriden members that don't have any specific content defined:

    1. Open the Build Profile editor.
    2. Select the .NET Source Comments option under Reference Documentation.
    3. Select the For overriden members without content, use the content from the base member option.

    The overriden members without any specific content will automatically use the content from the base member when you build your project for output.

    To use the base member content just for a specific overriden member:

    1. In the Content File editor, select the override member.
    2. Select the Content From content item type (either from the toolbar or page menu on the right side of the Content File Editor).
    3. Click the  New toolbar button to create a new Content From item.
    4. Leave the Copy content from field blank - Document! X and HelpStudio Bundle will automatically use the content from the member in the base type.
    You can also do this for specific override members in a .NET Xml source comment by using an <inheritdoc/> or <contentfrom/> comment. An <inheritdoc/> comment applied to a type will apply this behavior to all overrides in that type.
           

    For .NET documentation, automatically use the content from inherited members

    For members inherited from types that are contained in assemblies within the project, the Document! X and HelpStudio Bundle will automatically use the content defined for the inherited member in the base type - that behavior is always enabled.

    For members inherited from types that are contained in assemblies that are not included in the current project, including .NET Framework assemblies, the Document! X and HelpStudio Bundle can use the content (contained in xml comment files) from the member as defined in the base type by enabling a specific option in the Build Profile editor.

    To enable using content from other assemblies for inherited members:

    1. Open the Build Profile editor.
    2. Select the .NET Source Comments page.
    3. Select the Find and integrate XML Documentation for members inherited from other assemblies option.           

    Use the Content From Content Item Type to use content from another item in the project

    You can use the Content From content item type to specifically identify another item from which you would like to use the content when the generated documentation is built.

    1. In the Content File editor, select the item in which you would like to re-use another items content.
    2. Select the Content From content item type (either from the toolbar or page menu on the right hand side of the Content File editor).
    3. Click the  New toolbar button to create a new Content From item;
    4. Click the Build button and identify the source item that contains the content you would like to re-use.

    When the documentation is built (or when you Preview in the Content File editor) the content from the identified source item will be used.

    You can use the Filter list in the Content From editor to specific particular parts of the content to re-use. For example you might want to use just the summary content, or just the Examples.
           

    Define a Project Property for short pieces of common content

    If you have a short phrase or description that you want to make use of in several locations, you can define a Project Property to contain the text so that you can avoid duplication and are able to manage that text in one place.

    To create a Project Property:

    1. Select the Project Settings option on the Project ribbon menu.
    2. Select the Project Properties.
    3. Select the  New toolbar option to create a new project property.
    4. Enter the project property name and description (optional). You will use this name to reference the project property in your content.
    5. Select project property type as Text, Number, HTML, Date & Time, or Color.
    6. Click Ok to save the new Project Property.
    7. Click the ... button next to the newly created Property to define the value associated with the Project Property (e.g. the text you want to use in multiple locations in your content).

    You can now reference the Project Property anywhere in the content editors by surrounding the Project Property name with %% symbols - e.g. %%MyProjectProperty%%. The placeholder will be replaced with the Project Property when you Preview a page or build the project.

    If you are generating multiple outputs, you can define different values for your Project Property in each Build Profile using the Project Properties page in the Build Profile Editor.

    Applying content to multiple items automatically by creating an AutoDoc file

    AutoDoc is a powerful Document! X feature that allows you to author content that is used in the generated output according to rules that you define. For example you might want to author some specific remarks for inclusion in every method with a particular name in order to prevent duplicating the same content in many places.

    See the AutoDoc Topic for more information on creating and using AutoDoc files. 

    See Also