madato   ![Build Status] ![Latest Version]

madato is a library and command line tool for working tabular data, and Markdown


The tools is primarly centered around getting tabular data (spreadsheets, CSVs) into Markdown.

It currently supports: - Reading a XLS, ODS Spreadsheet or YAML file -- to --> Markdown - Reading a XLS, ODS Spreadsheet -- to --> Markdown

When generating the output: - Filter the Rows using basic Regex over Key/Value pairs - Limit the columns to named headings - Re-order the columns, or repeat them using the same column feature - Only generate a table for a named "sheet" (applicable for the XLS/ODS formats)

Madato is: - Command Line Tool (Windows, Mac, Linux) - good for CI/CD preprocessing - Rust Library - Good for integration into Rust Markdown tooling - Node JS WASM API - To be used later for Atom and VSCode Extensions

Madato expects that every column has a heading row. That is, the first row are headings/column names. If a cell in that first row is blank, it will create NULL0..NULLn entries as required.

Examples

08:48 $ target/debug/madato table --type xlsx test/sample_multi_sheet.xlsx --sheetname second_sheet -c "Heading 4" -f 'Heading 4=[a-zA-Z0-9]' | Heading 4 | |--------------------------| | << empty | |*Some Bolding in Markdown*| | `escaped value` foo | | 0.22 | | #DIV/0! | | “This cell has quotes” | | 😕 ← Emoticon |

09:00 $ target/debug/madato table --type xlsx test/sample_multi_sheet.xlsx --sheetname Sheet1 -c Rank -c Language -c Trend -f "Trend=\+" | Rank | Language |Trend | |------------------------------------------------------|------------|------| | 1 | Python |+5.5 %| | 3 | Javascript |+0.2 %| | 7 | R |+0.0 %| | 12 | TypeScript |+0.3 %| | 16 | Kotlin |+0.5 %| | 17 | Go |+0.3 %| | 20 | Rust |+0.0 %|

Internals

madato uses: - calamine for reading XLS and ODS sheets - wasm bindings to created JS API versions of the Rust API - regex for filtering, and serde for serialisation.

Tips

Rust API

JS API

More Commandline

Sheet List

You can list the "sheets" of an XLS*, ODS file with

$ madato sheetlist test/sample_multi_sheet.xlsx Sheet1 second_sheet 3rd Sheet

YAML to Markdown

Madato reads a "YAML" file, in the same way it can a Spreadsheet. This is useful for "keeping" tabular data in your source repository, and perhaps not the XLS.

madato table -t yaml test/www-sample/test.yml

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

Please see the test/www-sample/test.yml file for the expected layout of this file

Excel/ODS to YAML

Changing the output from default "Markdown (MD)" to "YAML", you get a Markdown file of the Spreadsheet.

```

madato table -t xlsx test/samplemultisheet.xslx.xlsx -s Sheet1 -o yaml

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

Features

Future Goals

Known Issues

License

Serde is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.