public override string ToAsciiDoc()
        {
            var builder = new StringBuilder();

            // method attribute is used to add section titles in GeneratedAsciidocVisitor
            builder.AppendLine(!string.IsNullOrEmpty(MemberName)
                                ? $"[source, {Language.ToLowerInvariant()}, method=\"{MemberName.ToLowerInvariant()}\"]"
                                : $"[source, {Language.ToLowerInvariant()}]");

            builder.AppendLine("----");

            var(code, callOuts) = BlockCallOutHelper.ExtractCallOutsFromCode(Value);

            code = code.RemoveNumberOfLeadingTabsOrSpacesAfterNewline(Depth);
            builder.AppendLine(code);

            builder.AppendLine("----");
            foreach (var callOut in callOuts)
            {
                builder.AppendLine(callOut);
            }
            return(builder.ToString());
        }
示例#2
0
        public override string ToAsciiDoc()
        {
            var builder = new StringBuilder();

            if (!string.IsNullOrEmpty(Title))
            {
                builder.AppendLine("." + Title);
            }
            builder.AppendLine(!string.IsNullOrEmpty(MemberName)
                                ? $"[source, {Language.ToLowerInvariant()}, method=\"{MemberName.ToLowerInvariant()}\"]"
                                : $"[source, {Language.ToLowerInvariant()}]");
            builder.AppendLine("----");

            var(code, callOuts) = BlockCallOutHelper.ExtractCallOutsFromCode(Value);

            builder.AppendLine(code);

            builder.AppendLine("----");
            foreach (var callOut in callOuts)
            {
                builder.AppendLine(callOut);
            }
            return(builder.ToString());
        }