0.0.23 • Published 2 months ago

@golden-tiger/markdown v0.0.23

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

#golden-tiger/markdown

Transform markdown text to html element.

How to use

import { transform } from '@golden-tiger/markdown'; // mjs
const { transform } = require('@golden-tiger/markdown'); // cjs

transform('# Title\n- Content');
  • transform function has 2 parameters:

    • param 1 mdText: To transformed markdown text content.
    • param 2 transformOptions: Options of output.
      • output: options or dom. options means return value of transform function will be an object, which describes the HTML structure of the mdText. dom means return value of transform function will be a DOM object, which can be inserted to HTML directly.
      • indent: A number, which is the pixel value of indent.
  • The basic syntax of mdText is same as normal markdown, such as # indicates a header, > indicates a quota, and so on.

  • Basic tables are made by separating each cell with the pipe | symbol, and can be enhanced further with additional options to create advanced table layouts. This online markdown editor supports rowspan and colspan markdown table. Use |(-m)...| to create a m column span table cell <td colspan="m">. Use |(=n)...| to create a n row span table cell <td rowspan="n">.

// Example:
|(=2)align center|align left|align right|
|a|b|
|:-:|:--|--:|
|c|d|e|
|(-2)f|g|
|h|(-2)(=3)i|
|j|
|k|

markdown-example

0.0.22

2 months ago

0.0.23

2 months ago

0.0.24

2 months ago

0.0.21

4 months ago

0.0.19

4 months ago

0.0.16

9 months ago

0.0.17

9 months ago

0.0.18

9 months ago

0.0.13

11 months ago

0.0.14

11 months ago

0.0.15

11 months ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago