Bodoconsult.Core.Text
1.0.3
dotnet add package Bodoconsult.Core.Text --version 1.0.3
NuGet\Install-Package Bodoconsult.Core.Text -Version 1.0.3
<PackageReference Include="Bodoconsult.Core.Text" Version="1.0.3" />
paket add Bodoconsult.Core.Text --version 1.0.3
#r "nuget: Bodoconsult.Core.Text, 1.0.3"
// Install Bodoconsult.Core.Text as a Cake Addin #addin nuget:?package=Bodoconsult.Core.Text&version=1.0.3 // Install Bodoconsult.Core.Text as a Cake Tool #tool nuget:?package=Bodoconsult.Core.Text&version=1.0.3
What does the library
Bodoconsult.Core.Text is a simple tool to generate structured text documents in a C# project and export it finally to a HTML or ASCII plain text file.
We use Bodoconsult.Core.Text for creating unit test logfiles intended for presentation to auditors. Another usage at Bodoconsult is creating an automated documentation for an app based on unit tests.
How to use the library
The source code contain NUnit test classes, the following source code is extracted from. The samples below show the most helpful use cases for the library.
Export as HTML without template (HtmlTextFormatter class)
var sr = new StructuredText();
sr.AddHeader1("Überschrift 1 '& &&&' ");
sr.AddParagraph(MassText, "CssTestFixture");
sr.AddDefinitionListLine("Def1", "Value1");
sr.AddDefinitionListLine("Definition 2", "Value1234");
sr.AddDefinitionListLine("Defini 3", "Value234556666");
sr.AddParagraph("");
sr.AddParagraph(FormattedMasstext,
"CssTestFixture");
sr.AddCode(MassText, "CssTestFixture");
sr.AddParagraph(MassText);
sr.AddListItem("Bahnhof");
sr.AddListItem("HauptBahnhof");
sr.AddListItem("SüdBahnhof");
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 1");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 1");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
var f = new HtmlTextFormatter { StructuredText = sr };
f.GetFormattedText();
f.SaveAsFile(fileName);
Export as HTML with a individual template (HtmlTextFormatter class)
var sr = new StructuredText();
sr.AddHeader1("Überschrift 'Databanka'");
sr.AddParagraph(MassText);
sr.AddDefinitionListLine("Def1", "Value1");
sr.AddDefinitionListLine("Definition 2", "Value1234");
sr.AddDefinitionListLine("Defini 3", "Value234556666");
sr.AddParagraph("");
sr.AddParagraph(MassText);
sr.AddListItem("Bahnhof");
sr.AddListItem("HauptBahnhof");
sr.AddListItem("SüdBahnhof");
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 1");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader2("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 1");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
var f = new HtmlTextFormatter
{
StructuredText = sr,
Template = "<<<Start>>>{0}<<<Ende>>>",
AddTableOfContent = true
};
var result = f.GetFormattedText();
f.SaveAsFile(fileName);
Export as plain ASCII file (PlainTextFormatter class)
var sr = new StructuredText(); sr.AddHeader1("Überschrift 1"); sr.AddParagraph(MassText); sr.AddDefinitionListLine("Def1", "Value1"); sr.AddDefinitionListLine("Definition 2", "Value1234"); sr.AddDefinitionListLine("Defini 3", "Value234556666"); sr.AddParagraph(""); sr.AddParagraph(MassText);
sr.AddListItem("Bahnhof");
sr.AddListItem("HauptBahnhof");
sr.AddListItem("SüdBahnhof");
sr.AddHeader1("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 1");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 2");
sr.AddParagraph(MassText);
sr.AddHeader1("Überschrift 1");
sr.AddParagraph(MassText);
sr.AddParagraph(MassText);
var f = new PlainTextFormatter { StructuredText = sr };
var result = f.GetFormattedText();
f.SaveAsFile(fileName);
About us
Bodoconsult (http://www.bodoconsult.de) is a Munich based software company.
Robert Leisner is senior software developer at Bodoconsult. See his profile on http://www.bodoconsult.de/Curriculum_vitae_Robert_Leisner.pdf.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bodoconsult.Core.Text:
Package | Downloads |
---|---|
Bodoconsult.Core.Text.Pdf
Enhances Bodoconsult.Core.Text, a simple class for collecting structured text in an app, with an export of the text to PDF. Use library to create simple reports from apps or from unit testing i.e. for auditors or as documentation. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Test project migrtated to .NET 6