Skip to main content

Definition

Assembly: CloudNimble.DotNetDocs.Core.dll Namespace: CloudNimble.DotNetDocs.Core.Renderers

Syntax

Summary

Base class for documentation renderers providing common functionality.

Constructors

.ctor Inherited

Inherited from object

Syntax

Properties

Enabled

When more than one Renderer is registered, allows a renderer to be turned off.

Syntax

Property Value

Type: bool

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetNamespaceFileName

Gets a safe file name for a namespace, suitable for use in file systems.

Syntax

Parameters

Returns

Type: string A safe file name for the namespace.

Remarks

This method is deprecated. Use GetNamespaceFilePath instead.

GetSafeNamespaceName

Gets a safe namespace name for use in file names and display.

Syntax

Parameters

Returns

Type: string A safe namespace name, using “global” for the global namespace.

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

RenderPlaceholdersAsync Virtual

Adds this renderer’s own files to the conceptual content folder. The default implementation does nothing.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task A completed task.

Examples

DocumentationManager writes the standard placeholders for every namespace and type. Members don’t get any, so a renderer that wants member-level placeholders can add them by overriding RenderPlaceholdersAsync. This one adds an examples file for every method:
Register the renderer as usual. CreateConceptualFilesAsync and ProcessAsync then write the method placeholders after the standard ones. ProcessAsync loads them into each member’s Examples in the same run.

Remarks

DocumentationManager.GeneratePlaceholdersAsync writes the standard namespace and type placeholders, then calls this method on each registered renderer. Override it to add files that a renderer needs beyond the standard placeholders; files written into the conceptual folder are loaded with the rest of the content.

Considerations

  • When it runs. GeneratePlaceholdersAsync writes the standard namespace and type placeholders first, then calls each registered renderer’s RenderPlaceholdersAsync one at a time, in registration order.
    • CreateConceptualFilesAsync and GeneratePlaceholdersAsync always call it.
    • ProcessAsync calls it only when ConceptualDocsEnabled is true, before conceptual content is loaded, so files written here show up in the same run.
    • ConceptualPath is always set by the time it’s called.
  • What gets loaded. Conceptual content is read only from the folders that GetConceptualNamespacePath, GetConceptualTypePath and GetConceptualMemberPath return, and only from files with the DocConstants names: summary.mdz (namespaces only), usage.mdz, examples.mdz, best-practices.mdz, patterns.mdz, considerations.mdz and related-apis.mdz. The loader ignores any other file, which suits files that only your renderer reads in RenderAsync.
  • Don’t overwrite. A file that already exists may hold hand-written content, so check for it first, as DocumentationManager does.
  • Mark placeholders. Start each placeholder with <!-- TODO: REMOVE THIS COMMENT AFTER YOU CUSTOMIZE THIS CONTENT -->. Projects that set ShowPlaceholders to false then leave it out of the output until someone edits it.
  • Don’t change the model. model is the merged model the whole run renders from, so treat it as read-only here.
  • You don’t need to override it. The default implementation does nothing, and renderers that only write output don’t need to change it.

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?