Skip to content

Latest commit

 

History

History
125 lines (87 loc) · 8.47 KB

File metadata and controls

125 lines (87 loc) · 8.47 KB

DemoClass Class

Namespace: DemoProject
Assembly: DemoProject

A class meant to demonstrate how the generated documentation looks like.

public class DemoClass

Inheritance: object → DemoClass

Remarks

The main purpose of this class is to showcase the generated documentation.

For that purpose, the class aims to include as many code constructs relevant for the generated documentation as possible.

For every type, MdDoc will create a separate markdown page split into multiple sections.

The type page starts with the "definition" section that provides basic info about the type. This includes the type's namespace and assembly as well as the inheritance hierarchy, implemented interfaces and applied attributes. The type info will be followed by the summary provided in the xml documentation comments.

If there are any remarks for the type, a "Remarks" section is added (the section you are currently reading)

All of a types constructors will be listed in a table in the "Constructors" section. The table contains a row for every constructor displaying the constructors signature and summary. As there is a separate page generated that provides more detailed info about the constructor, a link to that page is inserted.

Similar tables are generated for a type's public fields, events, properties, indexers, methods and operator overloads

Links to other members are supported (using the xml tag see), for example a link to IDemoInterface. References to types outside the assembly are written to the output but cannot be linked to, e.g. a reference to stringTo specify the link text, insert content inside the see element, for example <see cref="IDemoInterface">Custom text</see> which is rendered like this: Custom text

Additionally, links to websites can be added using the href attribute, for example,<see href="http://example.com" /> is rendered as http://example.com/ and<see href="http://example.com">Link text</see> is rendered as Link text. Note: href is supported by mddocs but is not part of the official specification and thus not supported by Visual Studio. When both cref and href attributes are specified, the href attribute is ignored.

The last section is the "See Also" section with links provided in the xml documentation using the seealso tag. Using the cref attribute, links to other members can be added. Additionally, links to websites can be added using the href attribute. Note: href is supported by mddocs is but not part of the official specification and thus not supported by Visual Studio. When both cref and href attributes are specified, the href attribute is ignored.

Similar pages are also generated for interfaces (see IDemoInterface), structs (see DemoStruct) and enums (see DemoEnum)Documentation can also contains list and tables. See ListExample for a showcase of the different supported list formats.

Constructors

Name Description
DemoClass() Initializes a new instance of DemoClass
DemoClass(int) Initializes a new instance of DemoClass with the specified parameters

Fields

Name Description
Field1 An example of a public field.
Field2 An example of a public field.

Events

Name Description
Event1 An example of a public event.
Event2 An example of a public event.

Properties

Name Description
Property1 An example of a read-only property.
Property2 An example of a read/write property annotated with a custom attribute
Property3 An example of an obsolete property.

Indexers

Name Description
Item[int, int] An example of an indexer with two parameters.
Item[int] An example of an indexer with a single parameter.
Item[object] An example of an obsolete indexer.

Methods

Name Description
Method1() Example of an overloaded method without parameters
Method1(string) Example of an overloaded method accepting one parameter.
Method2() Example of an non-overloaded methods with a custom attribute.
Method3<T>(T) Example of a generic method.
Method4() Example of an obsolete method.
Method5(string) Example of an method with a out parameter.
Method6(string) Example of an method with a ref parameter.
Method7(string[]) Example of an method with a ref parameter.
Method8(string) Example of an method with a in parameter.
Method9(string, string, decimal?, decimal?, CancellationToken) Example of an method with a optional parameters.

Operators

Name Description
Addition(DemoClass, DemoClass) Example of an overload of the binary + operator.
Subtraction(DemoClass, DemoClass) Example of an overload of the binary - operator.

Example

Using the example tag, examples on how to use a type can be included in the documentation. To specify the language inside of a code element, use the language attribute.

// create a new instance of DemoClass
var instance = new DemoClass();

See Also


Documentation generated by MdDocs