Definition
Assembly: CloudNimble.DotNetDocs.Core.dll Namespace: CloudNimble.DotNetDocs.Core.RenderersSyntax
Summary
Base class for documentation renderers providing common functionality.Constructors
.ctor Inherited
Inherited from
objectSyntax
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
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
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
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
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:
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.
GeneratePlaceholdersAsyncwrites the standard namespace and type placeholders first, then calls each registered renderer’sRenderPlaceholdersAsyncone at a time, in registration order.CreateConceptualFilesAsyncandGeneratePlaceholdersAsyncalways call it.ProcessAsynccalls it only whenConceptualDocsEnabledis true, before conceptual content is loaded, so files written here show up in the same run.ConceptualPathis always set by the time it’s called.
- What gets loaded. Conceptual content is read only from the folders that
GetConceptualNamespacePath,GetConceptualTypePathandGetConceptualMemberPathreturn, and only from files with theDocConstantsnames:summary.mdz(namespaces only),usage.mdz,examples.mdz,best-practices.mdz,patterns.mdz,considerations.mdzandrelated-apis.mdz. The loader ignores any other file, which suits files that only your renderer reads inRenderAsync. - Don’t overwrite. A file that already exists may hold hand-written content, so check for it first, as
DocumentationManagerdoes. - Mark placeholders. Start each placeholder with
<!-- TODO: REMOVE THIS COMMENT AFTER YOU CUSTOMIZE THIS CONTENT -->. Projects that setShowPlaceholderstofalsethen leave it out of the output until someone edits it. - Don’t change the model.
modelis 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
objectSyntax
Returns
Type:string?