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
- Host: GitHub
- URL: https://github.com/sander76/markdown-columns
- Owner: sander76
- Created: 2016-11-11T12:52:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-29T08:05:27.000Z (about 7 years ago)
- Last Synced: 2024-08-10T23:44:14.443Z (over 1 year ago)
- Topics: markdown, python-markdown, python3
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
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-{}```