An open API service indexing awesome lists of open source software.

https://github.com/sander76/markdown-columns

Column layout in markdown
https://github.com/sander76/markdown-columns

markdown python-markdown python3

Last synced: 14 days ago
JSON representation

Column layout in markdown

Awesome Lists containing this project

README

          

# Markdown columns

Python markdown plugin to create a column layout inspired by bootstrap.

input:

```markdown
%% %1 %2 %9
| ---------------------- | ----------------- | ------- |
| cell 1 | cell 2 | cell 3 |
| ++ **cell 1 line 2** | cell 2 line 2 | c3l2 |
| cell 4 | cell 5 | cell 6 |{: .extra_row_class}
```

output:

```html




cell 1


cell 1 line 2




cell 2


cell 2 line 2




cell 3


c3l2






cell 4




cell 5




cell 6





```

- First line should start with `%%` column widths are defined by following it with `%`.
So `%% %1 %2 %9` will create columns with a width of 1, 2 and 9.
- By default the table class is `instruction`. `%% %1 %2 %9 table` will replaces it
with `table` class.
- The second line `| --- | --- |` is ignored.
- `++` adds this line to the previous row definition as a new block.
- `extra_row_class` adds an extra class to the row definition.

## configuration

For usage inside python markdown:

```python
from md_columns import CssColumnsExtension

markdown.Markdown(extensions=[CssColumnsExtension()])
```

As an extension in MKDOCS:

Make sure the plugin is installed.
Create a `markdown_extensions` entry in your `mkdocs.yml` file:

```yaml
markdown_extensions:
- md_columns.md_columns

```

Optional arguments to configure the output:

- **row_class**: Default is ```row```
- **cell_width_class_template**: Default is ```col-sm-{}```