📜  markdown puce (1)

📅  最后修改于: 2023-12-03 15:17:32.757000             🧑  作者: Mango

Markdown Puce

Markdown Puce is a small but powerful library that enables you to include bullet points in your Markdown documents. It's lightweight, easy to use, and highly customizable.

Installation

You can install Markdown Puce using npm.

npm install markdown-puce
Usage

To use Markdown Puce, simply import it into your code and call the markdownPuce() function, passing in your Markdown text as a parameter. Markdown Puce will replace any bullet points in the text with the appropriate HTML tags.

import markdownPuce from 'markdown-puce';

const input = `Here are some bullet points:
- Item 1
- Item 2
- Item 3`;
const output = markdownPuce(input);

console.log(output);

The output will be:

Here are some bullet points:

  • Item 1
  • Item 2
  • Item 3
Customization

Markdown Puce provides several options to customize the appearance of your bullet points. You can specify the bullet style, size, color, and spacing.

To specify the bullet style, set the style option to one of the following values:

  • disc (default)
  • circle
  • square
const output = markdownPuce(input, { style: 'circle' });

To specify the size, set the size option to a number.

const output = markdownPuce(input, { size: 10 });

To specify the color, set the color option to a valid CSS color.

const output = markdownPuce(input, { color: '#ff0000' });

To specify the spacing between the bullet and the text, set the spacing option to a number.

const output = markdownPuce(input, { spacing: 10 });
Conclusion

Markdown Puce is a great tool for adding bullet points to your Markdown documents. It's easy to use, highly customizable, and it just works! Give it a try today and let us know what you think!