markdown-tables-extended


Namemarkdown-tables-extended JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryThis is an extended version of the tables extension of Python-Markdown. It contains addtions from the cell_row_span extension and allows to create tables without header.
upload_time2023-11-10 17:38:26
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords markdown_grid_tables extension plugin markdown mkdocs
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tables-Extended

## Summary

This fork is created just to create a pip package
`pip install markdown-tables-extended`
- In mkdocs.yaml `- markdown_tables_extended` goes in the  `markdown_extension:` section

----

This is an extended version of the [tables](https://python-markdown.github.io/extensions/tables/) extension of [Python-Markdown](https://python-markdown.github.io/). It contains addtions from the [cell_row_span](https://github.com/Neepawa/cell_row_span) extension and allows to create tables without header.

`tables_extended` is backward compatible to `tables` and nearly backward compatible to `cell_row_span`.

## Syntax

### Basic  table creation

The `tables_extended` extension can be used to create tables using markdown like the default [tables](https://python-markdown.github.io/extensions/tables/) extension:

```text
First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell
```

renders as

```text
.-------------------------------.
| First Header  | Second Header |
| ------------- | ------------- |
| Content Cell  | Content Cell  |
| Content Cell  | Content Cell  |
`-------------------------------`
```

The separator row can be used to specify the horizontal alignment of the cells' content:

```text
Header 1 | Header 2 | Header 3
:------- | :------: | -------:
Cell 1   | Cell 2   | Cell 3
```

renders as

```text
.-------------------------------------------.
| Header 1    |   Header 2   |     Header 3 |
| ----------- | ------------ | ------------ |
| Cell 1      |    Cell 2    |       Cell 3 |
`-------------------------------------------`
```

### Tables without header

If no row is provided above the separator line, no header is generated:

```text
------ | ------
Cell 1 | Cell 2
Cell 3 | Cell 4
```

becomes

```text
.-----------------.
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |
`-----------------`
```

### Merging of columns or rows

```text
| Column 1                | Col 2 | Big row span   |
|:-----------------------:|-------| -------------- |
| r1_c1 spans two cols           || One large cell |
| r2_c1 spans two rows    | r2_c2 |                |
|_^                      _| r3_c2 |                |
|    ______          | r4_c2 |_              _|
```

The example renders as:

```text
.--------------------------------------------------.
|        Column 1         | Col 2 |  Big row span  |
|---------------------------------+----------------|
|      r1_c1 spans two cols       |                |
|---------------------------------|                |
|  r2_c1 spans two rows   | r2_c2 |                |
|                         |-------| One large cell |
|                         | r3_c2 |                |
|-------------------------+-------|                |
|          ____           | r4_c2 |                |
`--------------------------------------------------'
```

To span cells across multiple columns, end them with two or more consecutive
vertical bars. Cells to the left will be merged together, as many cells are
there are bars. In the example above, there are two bars at the end of cell
2 on row 1, so the two cells to the left of it (numbers 1 and 2) are merged.

To span cells across rows, fill the cell on the last row with at least two
underscores, one at the start and the other at the end of its content, and no
other characters than spaces, underscores, `^`, `-` or `=`. This is referred to as
the *marker.* The cell with the marker and all the empty cells above it to the
first non-empty cell will be made into a single cell, with the content of the
non-empty cell. See column 3 ("Big row span") in the example.

By default the contents are vertically aligned using `baseline` alignment, which
is the default used by browsers. To
align to the top, include at least one `^` character in the marker between the
two underscores; for example, `|_^^^_|` or simply `|_^   _|`. See row 2 in
column 1 of the example, which is merged with row 3 and aligned at the top. To
align to the bottom, use at least one `=` character between the underscores;
for example, `|_ = _|`. To align in the middle of the cell, include at least
one `-` character in the marker row. Including more than one of `^`, `-` and `=`
in a marker raises a `ValueError` exception.

Vertical alignment codes:
* `^` sets an alignment to the top
* `-` sets middle alignment (new with `tables_extended`)
* `=` sets bottom aligment

Note: If this extension finds a cell with at least two underscores and no other
characters other than spaces, `^` or `=`, it assumes it's a row span marker and
attempts to process it. If you need a cell that looks like a marker (generally
one with only underscores in it), add the text `` as well --- this extension
won't process it as a row span marker and Markdown will change the `` to a
space.


## Installation

Either clone this repository or download the released package from github and unpack it.

Change into the new directory. `tables_extended` can now be installed using `install.sh`,
which installs the package using `pip`:
```bash
pip install .
```
or use the `setup.py` script:
```bash
python setup.py install --user
```


## Usage

See [Extensions](https://python-markdown.github.io/extensions/) for general extension usage. Use `tables_extended`
as the name of the extension.

This extension does not accept any special configuration options.

The extension can be used by either providing the markdown processor with an extension instance
```python
from markdown_tables_extended import TableExtension

markdown.markdown(some_text, extensions=[TableExtension()])
```
or by using the extension name
```python
markdown.markdown(some_text, extensions=['markdown_tables_extended'])
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "markdown-tables-extended",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "markdown_grid_tables,extension,plugin,markdown,mkdocs",
    "author": "",
    "author_email": "Daniel Riggins <danielr.riggins@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/af/47/6bd6d9192ea3916bd59596ecf0300a5ef0141f5822e0d781efe3608b0544/markdown_tables_extended-0.1.3.tar.gz",
    "platform": null,
    "description": "# Tables-Extended\n\n## Summary\n\nThis fork is created just to create a pip package\n`pip install markdown-tables-extended`\n- In mkdocs.yaml `- markdown_tables_extended` goes in the  `markdown_extension:` section\n\n----\n\nThis is an extended version of the [tables](https://python-markdown.github.io/extensions/tables/) extension of [Python-Markdown](https://python-markdown.github.io/). It contains addtions from the [cell_row_span](https://github.com/Neepawa/cell_row_span) extension and allows to create tables without header.\n\n`tables_extended` is backward compatible to `tables` and nearly backward compatible to `cell_row_span`.\n\n## Syntax\n\n### Basic  table creation\n\nThe `tables_extended` extension can be used to create tables using markdown like the default [tables](https://python-markdown.github.io/extensions/tables/) extension:\n\n```text\nFirst Header  | Second Header\n------------- | -------------\nContent Cell  | Content Cell\nContent Cell  | Content Cell\n```\n\nrenders as\n\n```text\n.-------------------------------.\n| First Header  | Second Header |\n| ------------- | ------------- |\n| Content Cell  | Content Cell  |\n| Content Cell  | Content Cell  |\n`-------------------------------`\n```\n\nThe separator row can be used to specify the horizontal alignment of the cells' content:\n\n```text\nHeader 1 | Header 2 | Header 3\n:------- | :------: | -------:\nCell 1   | Cell 2   | Cell 3\n```\n\nrenders as\n\n```text\n.-------------------------------------------.\n| Header 1    |   Header 2   |     Header 3 |\n| ----------- | ------------ | ------------ |\n| Cell 1      |    Cell 2    |       Cell 3 |\n`-------------------------------------------`\n```\n\n### Tables without header\n\nIf no row is provided above the separator line, no header is generated:\n\n```text\n------ | ------\nCell 1 | Cell 2\nCell 3 | Cell 4\n```\n\nbecomes\n\n```text\n.-----------------.\n| Cell 1 | Cell 2 |\n| Cell 3 | Cell 4 |\n`-----------------`\n```\n\n### Merging of columns or rows\n\n```text\n| Column 1                | Col 2 | Big row span   |\n|:-----------------------:|-------| -------------- |\n| r1_c1 spans two cols           || One large cell |\n| r2_c1 spans two rows    | r2_c2 |                |\n|_^                      _| r3_c2 |                |\n|    ______ &#20;         | r4_c2 |_              _|\n```\n\nThe example renders as:\n\n```text\n.--------------------------------------------------.\n|        Column 1         | Col 2 |  Big row span  |\n|---------------------------------+----------------|\n|      r1_c1 spans two cols       |                |\n|---------------------------------|                |\n|  r2_c1 spans two rows   | r2_c2 |                |\n|                         |-------| One large cell |\n|                         | r3_c2 |                |\n|-------------------------+-------|                |\n|          ____           | r4_c2 |                |\n`--------------------------------------------------'\n```\n\nTo span cells across multiple columns, end them with two or more consecutive\nvertical bars. Cells to the left will be merged together, as many cells are\nthere are bars. In the example above, there are two bars at the end of cell\n2 on row 1, so the two cells to the left of it (numbers 1 and 2) are merged.\n\nTo span cells across rows, fill the cell on the last row with at least two\nunderscores, one at the start and the other at the end of its content, and no\nother characters than spaces, underscores, `^`, `-` or `=`. This is referred to as\nthe *marker.* The cell with the marker and all the empty cells above it to the\nfirst non-empty cell will be made into a single cell, with the content of the\nnon-empty cell. See column 3 (\"Big row span\") in the example.\n\nBy default the contents are vertically aligned using `baseline` alignment, which\nis the default used by browsers. To\nalign to the top, include at least one `^` character in the marker between the\ntwo underscores; for example, `|_^^^_|` or simply `|_^   _|`. See row 2 in\ncolumn 1 of the example, which is merged with row 3 and aligned at the top. To\nalign to the bottom, use at least one `=` character between the underscores;\nfor example, `|_ = _|`. To align in the middle of the cell, include at least\none `-` character in the marker row. Including more than one of `^`, `-` and `=`\nin a marker raises a `ValueError` exception.\n\nVertical alignment codes:\n* `^` sets an alignment to the top\n* `-` sets middle alignment (new with `tables_extended`)\n* `=` sets bottom aligment\n\nNote: If this extension finds a cell with at least two underscores and no other\ncharacters other than spaces, `^` or `=`, it assumes it's a row span marker and\nattempts to process it. If you need a cell that looks like a marker (generally\none with only underscores in it), add the text `&#20;` as well --- this extension\nwon't process it as a row span marker and Markdown will change the `&#20;` to a\nspace.\n\n\n## Installation\n\nEither clone this repository or download the released package from github and unpack it.\n\nChange into the new directory. `tables_extended` can now be installed using `install.sh`,\nwhich installs the package using `pip`:\n```bash\npip install .\n```\nor use the `setup.py` script:\n```bash\npython setup.py install --user\n```\n\n\n## Usage\n\nSee [Extensions](https://python-markdown.github.io/extensions/) for general extension usage. Use `tables_extended`\nas the name of the extension.\n\nThis extension does not accept any special configuration options.\n\nThe extension can be used by either providing the markdown processor with an extension instance\n```python\nfrom markdown_tables_extended import TableExtension\n\nmarkdown.markdown(some_text, extensions=[TableExtension()])\n```\nor by using the extension name\n```python\nmarkdown.markdown(some_text, extensions=['markdown_tables_extended'])\n```\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This is an extended version of the tables extension of Python-Markdown. It contains addtions from the cell_row_span extension and allows to create tables without header.",
    "version": "0.1.3",
    "project_urls": {
        "documentation": "https://github.com/fumbles/tables_extended",
        "homepage": "https://github.com/fumbles/tables_extended",
        "repository": "https://github.com/fumbles/tables_extended"
    },
    "split_keywords": [
        "markdown_grid_tables",
        "extension",
        "plugin",
        "markdown",
        "mkdocs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13b8d0de942938d404bdabfdde59b071a2fdf1ca458964074cfe47bc73f35bb9",
                "md5": "f067d06108c1fa8e80957e9f4a3c9b05",
                "sha256": "27614ab7bb35920c8eaf85dddf081edbfed12f15ac2176e1a439f9216f0117cb"
            },
            "downloads": -1,
            "filename": "markdown_tables_extended-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f067d06108c1fa8e80957e9f4a3c9b05",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8481,
            "upload_time": "2023-11-10T17:38:24",
            "upload_time_iso_8601": "2023-11-10T17:38:24.701382Z",
            "url": "https://files.pythonhosted.org/packages/13/b8/d0de942938d404bdabfdde59b071a2fdf1ca458964074cfe47bc73f35bb9/markdown_tables_extended-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "af476bd6d9192ea3916bd59596ecf0300a5ef0141f5822e0d781efe3608b0544",
                "md5": "430a49fe832a2aafc65a9c21fda82121",
                "sha256": "4b4224220e71c4566503bd1b15584afacec869bb173b65a363e51ce9a972651c"
            },
            "downloads": -1,
            "filename": "markdown_tables_extended-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "430a49fe832a2aafc65a9c21fda82121",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7783,
            "upload_time": "2023-11-10T17:38:26",
            "upload_time_iso_8601": "2023-11-10T17:38:26.523184Z",
            "url": "https://files.pythonhosted.org/packages/af/47/6bd6d9192ea3916bd59596ecf0300a5ef0141f5822e0d781efe3608b0544/markdown_tables_extended-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-10 17:38:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fumbles",
    "github_project": "tables_extended",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "markdown-tables-extended"
}
        
Elapsed time: 0.13419s