Skip to content

Commit

Permalink
updated the README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
“talatkuyuk” committed Mar 24, 2024
1 parent ac0b1a7 commit fafba80
Showing 1 changed file with 64 additions and 34 deletions.
98 changes: 64 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# recma-mdx-escape-missing-components

[![NPM version][npm-image]][npm-url]
[![Build][github-build]][github-build-url]
![npm-typescript]
[![License][github-license]][github-license-url]
[![NPM version][badge-npm-version]][npm-package-url]
[![NPM downloads][badge-npm-download]][npm-package-url]
[![Build][badge-build]][github-workflow-url]
[![codecov](https://codecov.io/gh/ipikuka/recma-mdx-escape-missing-components/graph/badge.svg?token=F89TVSB5MU)](https://codecov.io/gh/ipikuka/recma-mdx-escape-missing-components)
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fipikuka%2Frecma-mdx-escape-missing-components%2Fmaster%2Fpackage.json)](https://github.com/ipikuka/recma-mdx-escape-missing-components)
[![typescript][badge-typescript]][typescript-url]
[![License][badge-license]][github-license-url]

This package provides escaping the components in the MDX, which are missing or not provided.
This package is a [unified][unified] ([recma][recma]) plugin to provide an opportunity for escaping mdx components which are missing or not provided in a MDX document.

It is compatible with [MDX][MDX] version 3.

**This plugin is a [recma][recma] plugin that transforms the ESAST which stands for Ecma Script Abstract Syntax Tree (AST) that is used in production of compiled source for the MDX.**
**[unified][unified]** is a project that transforms content with abstract syntax trees (ASTs) using the new parser **[micromark][micromark]**. **[recma][recma]** adds support for producing a javascript code by transforming the **[esast][esast]** which stands for Ecma Script Abstract Syntax Tree (AST) that is used in production of compiled source for the **[MDX][MDX]**.

## When should I use this?

**This plugin is useful if you want to escape the components you did not provide in MDX.** You don't receive an error for missing / not provided components since the `recma-mdx-escape-missing-components` sets the default value `() => null` for the components.
**This plugin is useful if you want to escape the mdx components you did not provide in MDX.** You don't receive an error for missing or not provided mdx components since the `recma-mdx-escape-missing-components` sets the default value `() => null` for the mdx components.

## Installation

Expand All @@ -33,7 +32,7 @@ yarn add recma-mdx-escape-missing-components

## Usage

Say we have the following file, `example.mdx`, which consists some Components.
Say we have the following file, `example.mdx`, which consists some mdx components.

```mdx
# Hi
Expand Down Expand Up @@ -169,48 +168,79 @@ This plugin only modifies the ESAST (Ecma Script Abstract Syntax Tree) as explai

## Types

This package is fully typed with [TypeScript][typeScript]. Function type for the `test` option is exported as `TestFunction`.
This package is fully typed with [TypeScript][typescript]. Test function in the option is exported as type `TestFunction`.

## Compatibility

This plugin works with unified version 6+ and estree version 2+. **It is compatible with mdx version 3**.
This plugin works with `unified` version 6+. It is compatible with `mdx` version 3+.

## Security

Use of `recma-mdx-escape-missing-components` does not involve user content so there are no openings for cross-site scripting (XSS) attacks.
Use of `recma-mdx-escape-missing-components` doesn't involve user content so there are no openings for cross-site scripting (XSS) attacks.

## My Plugins

I like to contribute the Unified / Remark / MDX ecosystem, so I recommend you to have a look my plugins.

### My Remark Plugins

- [`remark-flexible-code-titles`](https://www.npmjs.com/package/remark-flexible-code-titles)
– Remark plugin to add titles or/and containers for the code blocks with customizable properties
- [`remark-flexible-containers`](https://www.npmjs.com/package/remark-flexible-containers)
– Remark plugin to add custom containers with customizable properties in markdown
- [`remark-ins`](https://www.npmjs.com/package/remark-ins)
– Remark plugin to add `ins` element in markdown
- [`remark-flexible-paragraphs`](https://www.npmjs.com/package/remark-flexible-paragraphs)
– Remark plugin to add custom paragraphs with customizable properties in markdown
- [`remark-flexible-markers`](https://www.npmjs.com/package/remark-flexible-markers)
– Remark plugin to add custom `mark` element with customizable properties in markdown
- [`remark-flexible-toc`](https://www.npmjs.com/package/remark-flexible-toc)
– Remark plugin to expose the table of contents via `vfile.data` or via an option reference
- [`remark-mdx-remove-esm`](https://www.npmjs.com/package/remark-mdx-remove-esm)
– Remark plugin to remove import and/or export statements (mdxjsEsm)

## My Recma Plugins
### My Rehype Plugins

+ [`recma-mdx-escape-missing-components`](https://www.npmjs.com/package/recma-mdx-escape-missing-components)
– Recma plugin to set the default value `() => null` for the Components in MDX in case of missing or not provided
+ [`recma-mdx-change-props`](https://www.npmjs.com/package/recma-mdx-change-props)
– Recma plugin to change the 'props' parameter into '_props' in the function '_createMdxContent' in the compiled source in order to be able to use {props.foo} like expressions. It is useful for the `next-mdx-remote` or `next-mdx-remote-client` users in `nextjs` applications.
- [`rehype-pre-language`](https://www.npmjs.com/package/rehype-pre-language)
– Rehype plugin to add language information as a property to `pre` element

### My Recma Plugins

- [`recma-mdx-escape-missing-components`](https://www.npmjs.com/package/recma-mdx-escape-missing-components)
– Recma plugin to set the default value `() => null` for the Components in MDX in case of missing or not provided so as not to throw an error
- [`recma-mdx-change-props`](https://www.npmjs.com/package/recma-mdx-change-props)
– Recma plugin to change the `props` parameter into the `_props` in the `function _createMdxContent(props) {/* */}` in the compiled source in order to be able to use `{props.foo}` like expressions. It is useful for the `next-mdx-remote` or `next-mdx-remote-client` users in `nextjs` applications.

## License

[MIT][license] © ipikuka
[MIT License](./LICENSE) © ipikuka

### Keywords

[unified][unifiednpm] [recma][recmanpm] [recma-plugin][recmapluginnpm] [esast][esastnpm] [MDX][MDXnpm]
🟩 [unified][unifiednpm] 🟩 [recma][recmanpm] 🟩 [recma plugin][recmapluginnpm] 🟩 [esast][esastnpm] 🟩 [MDX][MDXnpm] 🟩 [recma escape missing components][recmamissingcomponentnpm]

[unified]: https://github.com/unifiedjs/unified
[unifiednpm]: https://www.npmjs.com/search?q=keywords:unified
[recma]: https://mdxjs.com/docs/extending-mdx/#list-of-plugins
[recmanpm]: https://www.npmjs.com/search?q=keywords:recma
[recmapluginnpm]: https://www.npmjs.com/search?q=keywords:recma%20plugin
[esast]: https://github.com/syntax-tree/esast
[esastnpm]: https://www.npmjs.com/search?q=keywords:esast
[MDX]: https://mdxjs.com/
[MDXnpm]: https://www.npmjs.com/search?q=keywords:mdx
[recmamissingcomponentnpm]: https://www.npmjs.com/search?q=keywords:recma%20escape%20missing%20components

[unified]: https://github.com/unifiedjs/unified
[recma]: https://mdxjs.com/docs/extending-mdx/#list-of-plugins
[esast]: https://github.com/syntax-tree/esast
[MDX]: https://mdxjs.com/
[typescript]: https://www.typescriptlang.org/
[license]: https://github.com/ipikuka/recma-mdx-escape-missing-components/blob/main/LICENSE
[markdownnpm]: https://www.npmjs.com/search?q=keywords:markdown
[recmaEMCnpm]: https://www.npmjs.com/search?q=keywords:recma%20custom%20escape%20missing%20components
[npm-url]: https://www.npmjs.com/package/recma-mdx-escape-missing-components
[npm-image]: https://img.shields.io/npm/v/recma-mdx-escape-missing-components
[github-license]: https://img.shields.io/github/license/ipikuka/recma-mdx-escape-missing-components
[github-license-url]: https://github.com/ipikuka/recma-mdx-escape-missing-components/blob/master/LICENSE
[github-build]: https://github.com/ipikuka/recma-mdx-escape-missing-components/actions/workflows/publish.yml/badge.svg
[github-build-url]: https://github.com/ipikuka/recma-mdx-escape-missing-components/actions/workflows/publish.yml
[npm-typescript]: https://img.shields.io/npm/types/recma-mdx-escape-missing-components

[badge-npm-version]: https://img.shields.io/npm/v/recma-mdx-escape-missing-components
[badge-npm-download]:https://img.shields.io/npm/dt/recma-mdx-escape-missing-components
[npm-package-url]: https://www.npmjs.com/package/recma-mdx-escape-missing-components

[badge-license]: https://img.shields.io/github/license/ipikuka/recma-mdx-escape-missing-components
[github-license-url]: https://github.com/ipikuka/recma-mdx-escape-missing-components/blob/main/LICENSE

[badge-build]: https://github.com/ipikuka/recma-mdx-escape-missing-components/actions/workflows/publish.yml/badge.svg
[github-workflow-url]: https://github.com/ipikuka/recma-mdx-escape-missing-components/actions/workflows/publish.yml

[badge-typescript]: https://img.shields.io/npm/types/recma-mdx-escape-missing-components
[typescript-url]: https://www.typescriptlang.org/

0 comments on commit fafba80

Please sign in to comment.