# zandoc-react-loader

> React loader for zandoc-loader

Latest version **1.0.10** (published 2017-03-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install zandoc-react-loader
pnpm add zandoc-react-loader
yarn add zandoc-react-loader
bun add zandoc-react-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2017-03-24 |
| First published | 2017-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 21 |
| Known vulnerabilities | 0 (+8 in 3 direct dependencies) |
| Install scripts | no |
| Author | Li Chen |
| Maintainers | youzan-lc |
| Keywords | webpack, loader, zanui, doc, React |

## Links

- npm: https://www.npmjs.com/package/zandoc-react-loader
- npm.io page: https://npm.io/package/zandoc-react-loader

## Dependencies (21)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [pinyin](https://npm.io/package/pinyin.md) ^2.8.2
- [precss](https://npm.io/package/precss.md) ^1.4.0
- [babylon](https://npm.io/package/babylon.md) ^6.16.1
- [postcss](https://npm.io/package/postcss.md) ^5.2.16
- [unified](https://npm.io/package/unified.md) ^6.1.1
- [babel-types](https://npm.io/package/babel-types.md) ^6.23.0
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^6.7.7
- [highlight.js](https://npm.io/package/highlight.js.md) ^9.10.0
- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0
- [rehype-parse](https://npm.io/package/rehype-parse.md) ^3.1.0
- [unist-builder](https://npm.io/package/unist-builder.md) ^1.0.2
- [unist-util-is](https://npm.io/package/unist-util-is.md) ^2.0.0
- [babel-template](https://npm.io/package/babel-template.md) ^6.23.0
- [babel-traverse](https://npm.io/package/babel-traverse.md) ^6.23.1
- [babel-generator](https://npm.io/package/babel-generator.md) ^6.24.0
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^1.1.1
- [hast-util-to-html](https://npm.io/package/hast-util-to-html.md) ^3.0.0
- [mdast-util-to-hast](https://npm.io/package/mdast-util-to-hast.md) ^2.4.0
- [zandoc-loader-utils](https://npm.io/package/zandoc-loader-utils.md) ^1.0.0
- [mdast-util-to-string](https://npm.io/package/mdast-util-to-string.md) ^1.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2017-03-24
- 1.0.9 — 2017-03-23
- 1.0.8 — 2017-03-23
- 1.0.7 — 2017-03-22
- 1.0.6 — 2017-03-21
- 1.0.5 — 2017-03-20
- 1.0.4 — 2017-03-20
- 1.0.3 — 2017-03-20
- 1.0.2 — 2017-03-20
- 1.0.1 — 2017-03-20
- 1.0.0 — 2017-03-20

## README

## zandoc-react-loader

A webpack loader to convert `zandoc-loader`'s output to React component.

### Usage

Use as a webpack loader

```
{
	module: {
		rules: [
			{
			test: /\.md$/,
			use: [
				'babel-loader',
				'zandoc-react-loader',
				'zandoc-loader'
			]
			}
		]
	}
}
```

### Options

* `jsTemplate`: path to js template file, uses `babel-template`. 

Note: `babel-generator` has trouble with jsx generation, it will escape
all unicode sequences resulting in incorrect jsx code.

Available properties in the template: 

* `SECTIONS`: All sections in the file, `style`, `demo` and `markdown`. 
Styles are compiled to css with `precss`
demos are code fragments that return a React node
markdowns are compiled to html

* `IMPORTS`: All imports from demos

* `DEMO_DECLARATIONS`: Declarations for demos

Take a look at `sample/template.js`.

---
_Source: https://npm.io/package/zandoc-react-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
