コード例 #1
0
        public void Visit(MdAdmonition admonition)
        {
            m_Writer.RequestBlankLine();

            var title = admonition.Title.ToString();

            if (String.IsNullOrEmpty(title))
            {
                m_Writer.WriteLine($"!!! {admonition.Type.ToLower()}");
            }
            else
            {
                m_Writer.WriteLine($"!!! {admonition.Type.ToLower()} \"{title}\"");
            }

            m_Writer.PushPrefixHandler(new AdmonitionPrefixHandler());

            if (admonition.Any())
            {
                m_Writer.SuppressNextBlankLine();
            }

            foreach (var block in admonition)
            {
                block.Accept(this);
            }

            m_Writer.PopPrefixHandler();
            m_Writer.RequestBlankLine();
        }
コード例 #2
0
 public void Visit(MdAdmonition admonition) => VisitContainer(admonition);
コード例 #3
0
 /// <summary>
 /// Creates a new instance of <see cref="MdDocument"/> with the specified content.
 /// </summary>
 /// <remarks>
 /// MdAdmonition implements <see cref="IEnumerable{MdBlock}"/> so this constructor is necessary to prevent ambiguities.
 /// </remarks>
 public static MdDocument Document(MdAdmonition admonition) => new MdDocument(admonition);