Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patarapolw/indent-utils
Indented filter utilities, including Showdown extensions / HyperPug filters' maker
https://github.com/patarapolw/indent-utils
hyperpug pug showdownjs
Last synced: 27 days ago
JSON representation
Indented filter utilities, including Showdown extensions / HyperPug filters' maker
- Host: GitHub
- URL: https://github.com/patarapolw/indent-utils
- Owner: patarapolw
- License: mit
- Created: 2020-01-10T20:39:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T04:59:25.000Z (almost 2 years ago)
- Last Synced: 2024-10-08T18:23:06.440Z (about 1 month ago)
- Topics: hyperpug, pug, showdownjs
- Language: TypeScript
- Size: 1.38 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eqdict
[![npm version](https://badge.fury.io/js/indent-utils.svg)](https://badge.fury.io/js/indent-utils)
Indented filter utilities, including Showdown extensions / HyperPug filters' maker
## Usage
```typescript
import { createIndentedFilter } from "indent-utils";
const filterFn = createIndentedFilter("x1", (coveredText, attrs) => {
return customFn(coveredText, attrs)
});
const showdownX1Extension = {
type: "lang",
filter: filterFn
};
```Example matched cases,
```markdown
^^x1 hello
``````markdown
^^x1(source="github") hello
``````markdown
![](^^x1(source="github") hello^^)
``````markdown
^^x1(source="github").
thank you
verymuch
```For more test cases, see [/tests/index.spec.yaml](/tests/index.spec.yaml)
## Usage on the browser
```html
const filterFn = createIndentedFilter("x1", (coveredText, attrs) => {
return customFn(coveredText, attrs)
})
const showdownX1Extension = {
type: "lang",
filter: filterFn
}```