markdown_table_formatter/
lib.rs

1#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
2
3mod ast;
4mod table_formatter;
5
6use table_formatter::format;
7
8#[cfg(target_arch = "wasm32")]
9use wasm_bindgen::prelude::*;
10
11/// Format the GitHub Flavored Markdown tables in the `doc` string.
12#[cfg(not(target_arch = "wasm32"))]
13pub fn format_tables<T: AsRef<str>>(doc: T) -> String {
14    format(doc)
15}
16
17/// Format the GitHub Flavored Markdown tables in the `doc` string.
18#[cfg(target_arch = "wasm32")]
19#[wasm_bindgen]
20pub fn format_tables(doc: String) -> String {
21    format(doc)
22}