示例#1
0
 public RenderingState(string path, StringBuilder builder, ApiReferenceDocument document, Dictionary <string, ApiReferenceEntity> entityCache)
 {
     Path        = path;
     Builder     = builder;
     Document    = document;
     EntityCache = entityCache;
 }
示例#2
0
 private string GetPageTitle(ApiReferenceDocument doc, Dictionary <string, ApiReferenceEntity> entityCache)
 {
     return(ApiRenderingHelper.GetTitle(doc.Entity.Id,
                                        doc.Entity.Titles,
                                        doc.Entity.Comment,
                                        doc.Entity.Parameters,
                                        doc.Entity.Attributes,
                                        entityCache,
                                        false));
 }
示例#3
0
        private async Task RenderDocumentAsync(ApiReferenceDocument document, Dictionary <string, ApiReferenceEntity> entityCache)
        {
            // Don't render documents for swizzler types
            if (document.Entity.Id.Type == "SwizzlerType")
            {
                return;
            }

            var filename = NormalizePath($"{document.Entity.Uri.Href}.html");

            // Hack: If this is the root document, renname it to root-ns.html so we can use another
            // index document within the articles directory.
            if (document.Entity.Id.Type == "Root" && document.Entity.Id.Id == "__root__")
            {
                filename = "root-ns.html";
            }

            var state = new RenderingState(filename, new StringBuilder(), document, entityCache);

            WriteMetaData(state);
            WriteTitle(state);
            WriteSubsectionLinks(state);
            WriteNotifications(state);
            WriteAttachedAttributeDetails(state);
            await WriteCommentAsync(state);
            await WriteUxAsync(state);

            WriteLocation(state);
            await WriteParametersAsync(state);
            await WriteReturnsAsync(state);
            await WriteValuesAsync(state);
            await WriteTocAsync(state);
            await WriteInterfacesAsync(state);
            await WriteRemarksAsync(state);
            await WriteExamplesAsync(state);
            await WriteSeeAlsoAsync(state);

            await _outputPath.WriteContentAsync(filename,
                                                document.SourceFileLastModifiedAt,
                                                state.Builder.ToString(),
                                                (p, i) => ApplyDocumentPostProcessingAsync(p, i, state.MarkdownDeferredIds));

            _qualityReports.Add(new ApiDocumentQualityReport(document, state.Quality.NumberOfCommentLines, state.Quality.TableOfContentsCommentLines));
        }
示例#4
0
 public ApiDocumentWithQualityDetails(ApiReferenceDocument document, int numberOfCommentLines, List <int> tocNumberOfCommentLines)
 {
     Document                = document;
     NumberOfCommentLines    = numberOfCommentLines;
     TocNumberOfCommentLines = tocNumberOfCommentLines;
 }