Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jiangweixian/functional-md
render markdown functional
https://github.com/jiangweixian/functional-md
functional-programming github markdown
Last synced: about 1 month ago
JSON representation
render markdown functional
- Host: GitHub
- URL: https://github.com/jiangweixian/functional-md
- Owner: JiangWeixian
- License: mit
- Created: 2021-04-26T15:31:27.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-08T16:37:35.000Z (over 3 years ago)
- Last Synced: 2024-08-09T23:24:04.515Z (5 months ago)
- Topics: functional-programming, github, markdown
- Language: TypeScript
- Homepage:
- Size: 390 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# functional-md
> render markdown content functional[![npm](https://img.shields.io/npm/v/functional-md)](https://github.com/JiangWeixian/functional-md) [![NPM](https://img.shields.io/npm/l/functional-md)](https://github.com/JiangWeixian/functional-md)
## install
```console
npm install functional-md
```## usage
### `table`
```ts
import { table } from 'functional-md'table({
columns: [
{
dataIndex: 'id',
title: 'ID'
},
{
dataIndex: '',
title: 'NAME',
render: (v) => v.name
}
],
dataSource: [
{
id: 1,
name: 'jw'
},
{
id: 2,
name: 'jiangweixian'
}
]
})
```will output
|ID|NAME|
|-----|-----|
|1|jw|
|2|jiangweixian|### `menu`
```ts
menu({
dataSource: [
{
title: 'jw',
items: ["1.1", "1.2"]
},
{
title: 'jiangweixian',
items: [
{
title: "2.1"
},
]
},
]
})
```will output
- jw
- 1.1
- 1.2
- jiangweixian
- 2.1### `list`
```ts
list({ dataSource: ['1', '2'], limit: 1 })
```will output
- 1
- ...### `overflow-list`
```ts
overflowList({ list: ['a', 'b', 'c'], max: 2 })
```will output
a, b `+1`
### `badge`
```ts
badge({ value: 1 }
```will output
`+1`
### `code`
```ts
code({ language: 'tsx', value: 'const a = 1' })
```will output
```tsx
const a = 1
```### `image`
```ts
image({ alt: 'alt', src: 'https://github.com' })
```### `link`
```ts
link({ alt: 'alt', href: 'https://github.com' })
```## features
- table
- menu
- list
- overflow-list
- badge
- code
- image
- link