Skip to content

Commit 40b0ec5

Browse files
committed
Added extra notes to readme
1 parent 35eda6f commit 40b0ec5

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

readme.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ This library aims to provide helpers for creating tabular data with minimal fuss
44

55
Easily create *tab* or *comma* separated values (via `CsvDefinition`), or padded and aligned columns of plain text (with `PlainTextTable`).
66

7-
This library is available on [NuGet](https://www.nuget.org/packages/csharpvitamins.tabulation/). To install, run the following command in the Package Manager Console:
7+
Available on [NuGet](https://www.nuget.org/packages/csharpvitamins.tabulation/). To install, run the following command in the Package Manager Console:
88

99
PM> Install-Package CSharpVitamins.Tabulation
1010

1111

1212

1313
## Usage: `CsvDefinition`
1414

15-
`CsvDefinition` is designed for quick production of CSV style text - it aims to keep the column header and *how* to produce the value close together.
15+
`CsvDefinition` is designed for quick production of CSV style text - it aims to keep the *column header* and *how* to produce the value close together.
1616

1717
// vars to be used inside column value funcs
1818
const decimal VIP_SPEND = 1000000M;
@@ -58,15 +58,14 @@ At its heart, `CsvDefinition<T>` is a wrapper around `List<KeyValuePair<string,
5858
fields.Remove("Spend $");
5959

6060

61-
#### Create from a class
61+
**Or have the definition created for you, from a class**
6262

63-
You can also create a a definition from a model/class
6463

6564
var fields = new CsvDefinitionFactory().CreateFromModel<MyEntity>();
6665

6766
... get data, create writer, etc...
6867

69-
fields.Write(writer, rows, "\t");
68+
fields.Write(writer, rows, ",");
7069

7170
If you want more control over the production of the results, you can specify `Func<PropertyInfo, object, string>` converters for the type.
7271

@@ -87,7 +86,12 @@ If you want more control over the production of the results, you can specify `Fu
8786

8887
## Usage: `PlainTextTable`
8988

90-
A `PlainTextTable` allows padding of tabular data so it can be displayed easily as text.
89+
A `PlainTextTable` allows padding of tabular data so it can be displayed easily as text.
90+
91+
* Works best with small to medium length strings of data
92+
* Does not support *multi-line text* (newlines) or *tabs*
93+
* Since columns are padded using spaces, output from this class is best presented using a **fixed-wdith font**
94+
9195

9296
#### Example 1: classic
9397

@@ -107,9 +111,9 @@ A `PlainTextTable` allows padding of tabular data so it can be displayed easily
107111

108112
which might return
109113

110-
Name Enabled? Job
111-
Dave Y Developer
112-
Sarah Y Designer
114+
Name Enabled? Job
115+
Dave Y Developer
116+
Sarah Y Designer
113117
Mustafa N Data Analysis
114118

115119

@@ -133,6 +137,5 @@ which might produce something like this
133137
TPS Report final | 0 bytes | late
134138

135139

136-
137140

138141
Happy coding!

0 commit comments

Comments
 (0)