-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
Trais McAllister edited this page Aug 15, 2024
·
1 revision
Explore practical examples of using MtconnectTranspiler.CodeGenerators.ScribanTemplates.
Use the VisualStudioSummaryInterpreter to generate XML code documentation from custom markdown.
var generator = serviceProvider.GetRequiredService<IScribanTemplateGenerator>();
var items = new List<CodeClass>
{
new CodeClass { Name = "ExampleClass", Summary = "This is an example class." }
};
generator.ProcessTemplate(items, "output/path");Automatically format Python code using the PythonCodeFormatter.
var pythonFormatter = new PythonCodeFormatter();
var formattedCode = pythonFormatter.FormatPublicMethodName("my_method");Implement a custom markdown interpreter to convert markdown to plain text.
public class PlainTextInterpreter : MarkdownInterpreter
{
public override string Interpret(string input)
{
return input.Replace("**", "").Replace("*", "");
}
}