Skip to content

Commit c63c0b6

Browse files
committed
chore: new example
Signed-off-by: Manfred Touron <[email protected]>
1 parent 952f7a3 commit c63c0b6

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ generate: install
1313

1414
echo 'foo@bar:~$$ cat testdata/file2.csv' > .tmp/usage-csv.txt
1515
cat testdata/file2.csv >> .tmp/usage-csv.txt
16+
echo >> .tmp/usage-csv.txt
1617
echo 'foo@bar:~$$ cat testdata/file2.csv | mdtable csv' >> .tmp/usage-csv.txt
1718
(cat testdata/file2.csv | go run . csv 2>&1 || true) >> .tmp/usage-csv.txt
19+
echo >> .tmp/usage-csv.txt
20+
echo 'foo@bar:~$$ cat testdata/file2.csv | mdtable csv -csv-no-header' >> .tmp/usage-csv.txt
21+
(cat testdata/file2.csv | go run . csv -csv-no-header 2>&1 || true) >> .tmp/usage-csv.txt
22+
echo >> .tmp/usage-csv.txt
23+
echo 'foo@bar:~$$ cat testdata/file2.csv | mdtable csv -md-header="foo\\tbar\\tbaz\\t" -md-body="{{range .Cols}}<<{{.}}>>\\t{{end}}"' >> .tmp/usage-csv.txt
24+
(cat testdata/file2.csv | go run . csv -md-header="foo\\tbar\\tbaz\\t" -md-body="{{range .Cols}}<<{{.}}>>\\t{{end}}" 2>&1 || true) >> .tmp/usage-csv.txt
25+
1826

1927
go run github.com/campoy/embedmd -w README.md
2028
rm -rf .tmp

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,25 @@ foo@bar:~$ cat testdata/file2.csv
4040
Name,Age,Email
4141
John Doe,30,[email protected]
4242
Jane Smith,25,[email protected]
43+
4344
foo@bar:~$ cat testdata/file2.csv | mdtable csv
4445
|Name |Age |Email |
4546
|---- |--- |----- |
4647
|John Doe |30 |[email protected] |
4748
|Jane Smith |25 |[email protected] |
49+
50+
foo@bar:~$ cat testdata/file2.csv | mdtable csv -csv-no-header
51+
|<!-- --> |<!-- --> |<!-- --> |
52+
|-------- |-------- |-------- |
53+
|Name |Age |Email |
54+
|John Doe |30 |[email protected] |
55+
|Jane Smith |25 |[email protected] |
56+
57+
foo@bar:~$ cat testdata/file2.csv | mdtable csv -md-header="foo\tbar\tbaz\t" -md-body="{{range .Cols}}<<{{.}}>>\t{{end}}"
58+
|foo |bar |baz |
59+
|--- |--- |--- |
60+
|<<John Doe>> |<<30>> |<<[email protected]>> |
61+
|<<Jane Smith>> |<<25>> |<<[email protected]>> |
4862
```
4963

5064
## Install

0 commit comments

Comments
 (0)