markdown-it-table-references> Table referencing for markdown-it .
Installation ``sh yarn add markdown-it-table-references`
or
`sh npm install markdown-it-table-references`
Example `mdHello World
| Name | Client | | ----- | ------- | | Alice | Mobile | | Bob | Desktop |
.Client overview `
`htmlHello World Name Client Alice Mobile Bob Desktop
§ Table 1 : Client overview List of Tables Table 1 : Client overview`
Plain HTML figures and tables are supported too.
`mdHello World
Name Client Alice Mobile Bob Desktop
Client overview `
`htmlHello World Name Client Alice Mobile Bob Desktop
§ Table 1 : Client overview List of Tables Table 1 : Client overview`
Usage `js const md = require("markdown-it")().use(require("markdown-it-table-references"), opts);`
See a demo as JSFiddle .
The opts object can contain:
| Name | Description | Default | | -------- | ----------------------------------------------- | ---------- | | after | Rule name to insert new rules after. | false | | ns | Namespace for saving registered tables (env). | "tables" | | wrap | Wrap
in element. | true | | anchor | Anchor options. | see below | | label | Label options. | see below | | list | List options. | see below |
The
anchor object can contain:| Name | Description | Default | | --------- | --------------------------------- | ---------- | |
enable | Insert anchor before table label. | true | | content | Anchor content. | "§" | | class | Anchor class. | "anchor" |
The
label object can contain:| Name | Description | Default | | ------------- | ----------------------------------------- | ----------- | |
enable | Insert table label before figure caption. | true | | text | Table label text. | "Table #" | | placeholder | Table number placeholder. | "#" | | class | Table label class. | "label" |
The
list object can contain:| Name | Description | Default | | -------- | ---------------------- | ------------------ | |
enable | Append list of tables. | true | | class | List of tables class. | "list" | | title | List title. | "List of Tables" | | tag | HTML tag for list. | "ol" | | item | List item options | see below |
The
item object can contain:| Name | Description | Default | | ------- | --------------------------------- | -------- | |
tag | HTML tag for list item. | "li" | | href | Add target id to list item label. | true | | class | List item class. | "item" | | label | Insert table label. | true | | title | Insert table title. | true` |
License GPL-3.0 © StudyATHome Internationally