public SectionStackItem(CoconaHelpRenderingContext ctx, ICoconaHelpSectioningContent section) { _ctx = ctx; _ctx.Sections.Push(this); _ctx.CurrentSection = this; Section = section; ChildPosition = 0; }
protected virtual void RenderSectioningContent(CoconaHelpRenderingContext ctx, ICoconaHelpSectioningContent section) { using (new CoconaHelpRenderingContext.SectionStackItem(ctx, section)) { var prevContentIsSection = false; foreach (var child in section.Children) { if (prevContentIsSection) { ctx.StringBuilder.AppendLine(); } RenderContent(ctx, child); ctx.CurrentSection !.Advance(); if (child is ICoconaHelpSectioningContent) { prevContentIsSection = true; } } } }