marp-core icon indicating copy to clipboard operation
marp-core copied to clipboard

Support for merge cells in tables

Open josecastillolema opened this issue 1 year ago • 5 comments

First of all, thanks for the amazing tool!

I was wondering if there is a way to merge cells in a table.

If there is not, I personally found doxygen format very straighforward:

| Cell1| Cell2 | Cell3 |
|------|-------|-------|
| merge right ||       |
| merge|       |       |
| below|^      |^      |
| merge both  || value1|
|^            || value2|

josecastillolema avatar May 05 '24 09:05 josecastillolema

That syntax is not defined in the specifications for GFM (GitHub Flavored Markdown). There are only a few Markdown flavors that adopt that syntax, and if Marp adopts that, it could negatively impact interoperability with other Markdown processors. Therefore, this feature should be provided as a third-party plugin (e.g. markdown-it-multimd-table)

import { Marp } from '@marp-team/marp-core';
import markdownItMultimdTable from 'markdown-it-multimd-table';

const marp = new Marp().use(markdownItMultimdTable);

marp.render(/* ... */);

yhatt avatar May 05 '24 14:05 yhatt

Thanks for the quick response.

Where do these imports should be placed? In the markdown file?

josecastillolema avatar May 06 '24 09:05 josecastillolema

See the usage section of this repository. Marp Core is a JavaScript library so the plugin also should import in JavaScript.

Or are you using Marp Core indirectly, through other tools such as Marp CLI?

yhatt avatar May 06 '24 14:05 yhatt

Yeah, I am using Marp Core through the VSCode extension. In this scenario, where should I place this setup?

Thanks!

josecastillolema avatar May 06 '24 15:05 josecastillolema

VS Code does not support any plugins due to security reasons. Check out https://github.com/marp-team/marp-vscode/issues/135#issuecomment-611275071.

Whenever using plugins, you have to use Marp CLI instead.

yhatt avatar May 11 '24 17:05 yhatt