RoslynCodeBlockPreprocessor Pennington.Roslyn.Preprocessing
Preprocesses code blocks with :xmldocid, :path, and :xmldocid-diff modifiers.
Properties
Priorityint- Priority — higher runs first.
Constructors
.ctor
#public RoslynCodeBlockPreprocessor(
ISymbolExtractionService symbolService,
SyntaxHighlighter highlighter,
HighlightingService highlightingService,
RoslynOptions options,
IHttpContextAccessor httpContextAccessor);Creates a new preprocessor wired to the symbol extraction service, Roslyn highlighter, shared highlighting service, options, and per-request diagnostics accessor.
Parameters
symbolServiceISymbolExtractionServicehighlighterSyntaxHighlighterhighlightingServiceHighlightingServiceoptionsRoslynOptionshttpContextAccessorIHttpContextAccessor
Methods
TryProcess
#public CodeBlockPreprocessResult? TryProcess(string code, string languageId);Attempts to preprocess a code block. Returns a result if handled, or null to pass through.
Parameters
codestringlanguageIdstring
Returns
CodeBlockPreprocessResult?Pennington.Roslyn.Preprocessing.RoslynCodeBlockPreprocessor
namespace Pennington.Roslyn.Preprocessing;
/// Preprocesses code blocks with :xmldocid, :path, and :xmldocid-diff modifiers.
public class RoslynCodeBlockPreprocessor
{
/// Creates a new preprocessor wired to the symbol extraction service, Roslyn highlighter, shared highlighting service, options, and per-request diagnostics accessor.
public RoslynCodeBlockPreprocessor(
ISymbolExtractionService symbolService,
SyntaxHighlighter highlighter,
HighlightingService highlightingService,
RoslynOptions options,
IHttpContextAccessor httpContextAccessor);
/// Priority — higher runs first.
public int Priority => 100;
/// Attempts to preprocess a code block. Returns a result if handled, or null to pass through.
public CodeBlockPreprocessResult? TryProcess(string code, string languageId);
}