This package has been deprecated

Author message:

Use @paperis/remark-caption

@paperist/remark-table-caption
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@paperist/remark-table-caption

LICENSE NPM standard-readme compliant

wooorm/remark plugin for table caption

Support Pandoc's table caption at wooorm/remark.

Table of Contents

Install

npm i remark @paperist/remark-table-caption

Usage

const unified = require('unified');
const parser = require('remark-parse');
const tableCaption = require('@paperist/remark-table-caption');

const markdown = `
| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

Table: Demonstration of pipe table syntax.
`;

const processor = unified().use(parser).use(tableCaption);
const ast = processor.parse(markdown);

processor.run(ast).then(ast => {
  console.dir(ast, { depth: null });
});

AST

See also mdast, unist.

TableCaption

TableCaption extends [Parent][unist-parnet].

interface TableCaption extends Parent {
  type: 'tableCaption';
}

For example, the following markdown:

Table: Caption {#tbl:label}

Yields:

{
  "type": "tableCaption",
  "children": [
    {
      "type": "text",
      "value": "Caption "
    },
    {
      "type": "crossReferenceLabel",
      "value": "{#tbl:lable}",
      "label": "tbl:label",
      "options": {}
    }
  ]
}

Contribute

PRs accepted.

License

3846masa MIT (c) 3846masa

Readme

Keywords

Package Sidebar

Install

npm i @paperist/remark-table-caption

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • 3846masa
  • paperist-owner