Loyc.Syntax.Les.Les3PrettyPrinter.PrintToHtml C# (CSharp) Method

PrintToHtml() public static method

Prints an LNode as LESv3 with HTML syntax highlighting elements.
public static PrintToHtml ( IEnumerable nodes, StringBuilder output = null, bool addPreCode = true, IMessageSink sink = null, ILNodePrinterOptions options = null ) : StringBuilder
nodes IEnumerable Syntax trees to print.
output StringBuilder Output StringBuilder for HTML code.
addPreCode bool Whether to wrap the output in "<pre class='highlight'><code>" tags.
sink IMessageSink
options ILNodePrinterOptions Options to control the style for code printing.
return StringBuilder
		public static StringBuilder PrintToHtml(
				IEnumerable<ILNode> nodes, StringBuilder output = null, 
				bool addPreCode = true, IMessageSink sink = null,
				ILNodePrinterOptions options = null)
		{
			var pp = new Les3PrettyPrinter(sink, options);
			return pp.PrintToHtml(nodes, output, addPreCode);
		}

Same methods

Les3PrettyPrinter::PrintToHtml ( IEnumerable nodes, StringBuilder output = null, bool addPreCode = true ) : StringBuilder
Les3PrettyPrinter::PrintToHtml ( ILNode node, StringBuilder output = null, bool addPreCode = true ) : StringBuilder

Usage Example

示例#1
0
        /// <summary>Prints an LNode as LESv3 with HTML syntax highlighting elements.</summary>
        /// <param name="nodes">Syntax trees to print.</param>
        /// <param name="output">Output StringBuilder for HTML code.</param>
        /// <param name="addPreCode">Whether to wrap the output in "&lt;pre class='highlight'>&lt;code>" tags.</param>
        /// <param name="options">Options to control the style for code printing.</param>
        /// <returns>The output StringBuilder</returns>
        public static StringBuilder PrintToHtml(
            IEnumerable <ILNode> nodes, StringBuilder output = null,
            bool addPreCode = true, IMessageSink sink = null,
            ILNodePrinterOptions options = null)
        {
            var pp = new Les3PrettyPrinter(sink, options);

            return(pp.PrintToHtml(nodes, output, addPreCode));
        }
All Usage Examples Of Loyc.Syntax.Les.Les3PrettyPrinter::PrintToHtml