示例#1
0
        void RenderMembersExpanded(IEnumerable <DocBase> memberDocs, string headerText, Func <DocBase, string> additionalInfoRenderer, Func <DocBase, string> memberNameTransform = null)
        {
            if (memberDocs.Count() <= 0)
            {
                return;
            }

            var sectionStringBuilder = new StringBuilder();

            sectionStringBuilder.Append(_renderer.RenderNewParagraph() + _renderer.RenderHeader(headerText, level: 2));

            foreach (var memberDoc in memberDocs)
            {
                var methodNameTransformed = memberNameTransform != null?memberNameTransform(memberDoc) : memberDoc.Name;

                sectionStringBuilder.Append(_renderer.RenderNewParagraph());
                sectionStringBuilder.Append(_renderer.RenderHeader(methodNameTransformed, 3));

                sectionStringBuilder.Append(_renderer.RenderNewParagraph());
                sectionStringBuilder.Append(_renderer.RenderText(_renderer.Sanitize(memberDoc.Summary)));

                if (!String.IsNullOrWhiteSpace(memberDoc.Remarks))
                {
                    var remarks = _renderer.RenderText("Remarks:", italic: true, bold: true) + " " + _renderer.RenderText(_renderer.Sanitize(memberDoc.Remarks).Trim(), italic: true);
                    sectionStringBuilder.Append(_renderer.RenderNewParagraph() + remarks);
                }

                sectionStringBuilder.Append(additionalInfoRenderer(memberDoc));
            }

            _docStringBuilder.Append(sectionStringBuilder.ToString());
        }
        public void SanitizeNullTest()
        {
            var actualText = _gitHubRenderer.Sanitize(null);

            Assert.AreEqual(String.Empty, actualText);
        }
 void RenderTypeRemarks(string typeRemarks)
 {
     _docStringBuilder.Append(_renderer.RenderLineBreak() + _renderer.RenderText(_renderer.Sanitize(typeRemarks)));
 }