Skip to content

Commit

Permalink
updated with examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckland committed Jul 25, 2018
1 parent b98642d commit 6e3c854
Showing 1 changed file with 34 additions and 29 deletions.
63 changes: 34 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Markdown Tooling

* Supports making Markdown Tables from tabular data; YAML files and Excel/OpenOffice Spreadsheets
* Supports converting an Excel/ODS Spreadsheet to a YAML file.

provided as

Expand All @@ -23,7 +24,7 @@ provided as

## Commandline

### Excel, (XLSX, XLS, XLSM, XLSB, ODS)
### Excel, (XLSX, XLS, XLSM, XLSB, ODS) to Markdown

`md_tools table -t xlsx test/sample_multi_sheet.xslx.xlsx`

Expand All @@ -40,58 +41,63 @@ See [test/sample_multi_sheet.xslx.xlsx](test/sample_multi_sheet.xslx.xlsx) for t
| 5 | | C# |7.84 % |-0.5 %|
| 6 | | C/C++ |6.28 % |-0.8 %|
| 7 | | R |4.18 % |+0.0 %|
| 8 | |Objective-C | 3.4 % |-1.0 %|
| 9 | | Swift |2.65 % |-0.9 %|
| 10 | | Matlab |2.25 % |-0.3 %|
| 11 | | Ruby |1.59 % |-0.5 %|
| 12 | | TypeScript |1.58 % |+0.3 %|
| 13 | | VBA |1.42 % |-0.1 %|
| 14 | |Visual Basic| 1.2 % |-0.2 %|
| 15 | | Scala | 1.2 % |-0.1 %|
| 16 | | Kotlin |0.97 % |+0.5 %|
| 17 | | Go |0.93 % |+0.3 %|
| 18 | | Perl |0.78 % |-0.1 %|
| 19 | | Lua |0.42 % |-0.1 %|
| 20 | | Rust |0.36 % |+0.0 %|
| 21 | | Haskell | 0.3 % |-0.1 %|
| 22 | | Delphi |0.25 % |-0.1 %|
|( Source - http://pypl.github.io/PYPL.html - Jul 2018)| | | | |
...
**second_sheet**
| Sample XLS Data Type | The Resulting Value | Random Stuff | Heading 4 |
|-----------------------------------|----------------------------------------------------|----------------------------|--------------------------|
| >> =”Formula” | Formula | | |
| >> Simple String | Value | | << empty |
| >> Some Number | 0.0977795336595647 | | |
| >> Large Cell Value |Something longer than expected for most of the table| >> Markdown Formatting |*Some Bolding in Markdown*|
|>> Conflicting Table Markdown Text | This cell has \| pipes \| | | `escaped value` foo |
| >> Multiline | This Cell<br/>Is multi-line |>> Percentage (cell is 0.22)| 0.22 |
| >> Invalid Reference | #REF! | | |
| >> Valid Reference (=B1) | The Resulting Value | | |
| >> Unicode Characters | 😕 ← Emoticon | >> Div by 0 | #DIV/0! |
| >> Date Style | 43122 | | |
| | 43122 | >> Quotes | “This cell has quotes” |
| | -888.78 | | |
| | #VALUE! | | 😕 ← Emoticon |
...
**3rd Sheet**
|col1|col2| col3 |col4 | col5 |NULL5|
|----|----|------|-----|-------------------------------------------------------|-----|
| 1 |that| are |wider| value ‘aaa’ is in the next cell, but has no heading | aaa |
|than|the |header| row | (open the spreadsheet to see what I mean) | |
```
### YAML to Markdown

`md_tools table -t yaml test/www-sample/test.yml`

### YAML Example

```
|col3| col4 | data1 | data2 |
|----|-------|---------|--------------------|
|100 |gar gar|somevalue|someother value here|
|190x| | that | nice |
|100 | ta da | this |someother value here|
```

### Excel/ODS to YAML

```
md_tools table -t xlsx test/sample_multi_sheet.xslx.xlsx -s Sheet1 -o yaml
---
- Rank: "1"
Change: ""
Language: Python
Share: "23.59 %"
Trend: "+5.5 %"
- Rank: "2"
Change: ""
Language: Java
Share: "22.4 %"
Trend: "-0.5 %"
- Rank: "3"
Change: ""
Language: Javascript
Share: "8.49 %"
...
```

If you omit the sheet name, it will dump all sheets into an order map of array of maps.


## Rust

`TODO` - Publish on crates.io
Expand Down Expand Up @@ -156,4 +162,3 @@ And as Markdown:

### Known Issues
* A Spreadsheet Cell with a Date will come out as the "magic" Excel date number :-( - https://github.com/tafia/calamine/issues/116
* Order of columns in the YAML are not preserved. LinkedHashMap fixes it, but the serde bindings doesn't seem to work. Not sure why yet.

0 comments on commit 6e3c854

Please sign in to comment.