open-index/open-npm huggingface dataset:
npm package: @markdoc/markdoc
Description: A text markup language for documentation
Author: Ryan Paul
Latest version: 0.5.7

<h1 align="center">
  <br>
    <img src="https://user-images.githubusercontent.com/62121649/167893184-a2b69260-ca9e-4a77-a5bc-63b8135ae5db.png" alt="Markdoc" width="260">
  <br>
  <br>
</h1>

<h4 align="center">A powerful, flexible, Markdown-based authoring framework.</h4>

Markdoc is a [Markdown](https://commonmark.org)-based syntax and toolchain for creating custom documentation sites and experiences.  
We designed Markdoc to power [Stripe's public docs](http://stripe.com/docs), our largest and most complex content site.

## Installation

To get started with Markdoc, first install the library:

```shell
npm install @markdoc/markdoc
```

or

```shell
yarn add @markdoc/markdoc
```

and import it in your app:

```js
const Markdoc = require('@markdoc/markdoc');
```

or if you are using ESM

```js
import Markdoc from '@markdoc/markdoc';
```

then use `Markdoc` in your app or tool:

```js
const doc = `
# Markdoc README

{% image src="/logo.svg" /%}
`;

const ast = Markdoc.parse(doc);
const content = Markdoc.transform(ast);
return Markdoc.renderers.react(content, React);
```

Check out [our docs](https://markdoc.dev/docs) for more guidance on how to use Markdoc.

### TypeScript

This is the minimal `tsconfig.json` required to use Markdoc in your TypeScript project:

```json
{
  "compilerOptions": {
    "moduleResolution": "node",
    "target": "esnext", // works with es2015 or greater
    "esModuleInterop": true
  }
}
```

### React

If you are using React, install Markdoc with:

```sh
npm install @markdoc/markdoc react @types/react
```

## Contributing

Contributions and feedback are welcome and encouraged. Check out our [contributing guidelines](.github/CONTRIBUTING.md) on how to do so.

### Development

1. Run `npm install`
1. Run `npm run build`
1. Run the tests using `npm test`

## Code of conduct

This project has adopted the Stripe [Code of conduct](.github/CODE_OF_CONDUCT.md).

## License

This project uses the [MIT license](LICENSE).

## Credits

Special shout out to:

- [@marcioAlmada](https://github.com/marcioAlmada) for providing us with the [@markdoc](https://github.com/markdoc) GitHub org.
- [@koomen](https://github.com/koomen) for gifting us https://markdoc.dev.
npm package: @markdoc/next.js
Description: Markdoc plugin for Next.js
Author: Stripe, Inc.
Latest version: 0.5.0

# `@markdoc/next.js`

> **Note**: this plugin will be treated as a beta version until `v1.0.0` is released.

Using the `@markdoc/next.js` plugin allows you to create custom `.md` and `.mdoc` pages in your Next.js apps, and automatically render them with [`markdoc`](https://github.com/markdoc/markdoc).

## Setup

The first thing you'll need to do is install `@markdoc/next.js` and add it to your project's config.

1. From your project, run this command to install `@markdoc/next.js`:
   ```sh
   npm install @markdoc/next.js @markdoc/markdoc
   ```
2. Open `next.config.js` and add the following code:

   When using Webpack:

   ```js
   // next.config.js

   const withMarkdoc = require('@markdoc/next.js');

   module.exports = withMarkdoc(/* options */)({
     pageExtensions: ['js', 'md'],
   });
   ```

   For [Turbopack support](https://nextjs.org/docs/app/api-reference/turbopack), add the following configuration:

   ```js
   // next.config.js
   module.exports = withMarkdoc({
     dir: process.cwd(), // Required for Turbopack file resolution
   })({
     pageExtensions: ['js', 'md'],
   });
   ```

3. Create a new Markdoc file in `pages/docs` named `getting-started.md`.

   ```
   pages
   ├── _app.js
   ├── docs
   │   └── getting-started.md
   ├── index.js
   ```

4. Add some content to `getting-started.md`:

   ```md
   ---
   title: Get started with Markdoc
   description: How to get started with Markdoc
   ---

   # Get started with Markdoc
   ```

See [our docs](https://markdoc.dev/docs/nextjs) for more options.

## Contributing

Contributions and feedback are welcomed and encouraged. Feel free to open PRs here, or open issues in the [Markdoc core repo](https://github.com/markdoc/markdoc).

Follow these steps to set up the project:

1. Run `npm install`
1. Run `npm test`

## Code of conduct

This project has adopted the Stripe [Code of conduct](https://github.com/markdoc/markdoc/blob/main/.github/CODE_OF_CONDUCT.md).

## License

This project uses the [MIT license](LICENSE).
npm package: @markdomkan/wall_e
Description: Errors gestor for ts/js apps
Author: Marc Domenech
Latest version: 1.0.1

# Wall-e

## Description

Wall-e is a exception gestor for TS/JS apps. The name is inspired by the Pixar Wall-e movie that was based on a robot that managed garbage.

## Installation
```
yarn add @markdomkan/wall_e
```

## Usage

1. Register a custom error that extends from Wall_eError. This class must have message and can have 3 methods beforeAction action and afterAction. These methods all called syncronously with async/await and recibe by parameter serviceBundle object that is optional.


*CustomErrors.ts*

```ts
import { Wall_eError } from "wall_e";

export class CustomError extends Wall_eError {
  message = "Custom message for show at user";

  // optional
  beforeAction = async (serviceBundle: T) => {
    await serviceBundle.showErrorMessageInToast(this.message);
  };

  // optional
  action = async (serviceBundle: T) => {
    await serviceBundle.saveLogOnApi(
      `New error in user ${serviceBundle.getUser()}`
    );
  };

  // optional
  afterAction = async (serviceBundle: T) => {
    console.log("Error");
  };
}
```

2. Register your custom errors and give, if you want, your serviceBundle that help you to handle errors in action hooks.


*main.ts*
```ts
import { registerWalle } from "wall_e";
import { CustomError } from "./CustomErrors";

// can be object, class, array... you will recive in action hooks
const serviceBundle = {
  showErrorMessageInToast: () => {
    //
  },
  saveLogOnApi: () => {
    //
  },
  getUser: () => {
    //
  },
  //
};

// order is important, if more than one function return an error, only first will be executed.
function registerErrors(walle: Wall_e) {
  walle
    .register((error: Error) => {
      if (error.message.contains("something")) {
        return new CustomError();
      }
    })
    //register function returns Wall_e object to chain register calls.
    .register((error: Error) =>
      error.networkError?.status == 401 ? new Unauthenticated() : null
    );
  //
}

const showConsoleErrorWhenCapureError = true;

registerWalle(registerErrors, serviceBundle, showConsoleErrorWhenCapureError);
```

3. Use w_catch fuction to catch your errors.

```ts
import { w_catch } from "wall_e";

try {
    //
} catch (error) {
  w_catch(error);
}
```