# doc.mdx

> A static site generator on top of Markdown and React

Latest version **0.2.3** (published 2018-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install doc.mdx
pnpm add doc.mdx
yarn add doc.mdx
bun add doc.mdx
```

Provides the command `doc`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2018-07-02 |
| First published | 2018-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 379.2 KB |
| Known vulnerabilities | 0 (+9 in 2 direct dependencies) |
| Install scripts | no |
| Author | Yoshihide Shiono |
| Maintainers | saltyshiomix |
| Keywords | markdown, md, mdx, blog, blogging, static-site-generator, next, nextjs, react, reactjs |

## Links

- npm: https://www.npmjs.com/package/doc.mdx
- Repository: https://github.com/saltyshiomix/doc.mdx
- Issues: https://github.com/saltyshiomix/doc.mdx/issues
- npm.io page: https://npm.io/package/doc.mdx

## Dependencies (16)

- [ora](https://npm.io/package/ora.md) ^2.1.0
- [next](https://npm.io/package/next.md) 6.1.1
- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [react](https://npm.io/package/react.md) ^16.4.1
- [webpack](https://npm.io/package/webpack.md) 3.10.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^6.0.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.4.1
- [babel-core](https://npm.io/package/babel-core.md) 6.*
- [typescript](https://npm.io/package/typescript.md) ^2.9.2
- [@babel/core](https://npm.io/package/@babel/core.md) 7.0.0-beta.42
- [@mdx-js/mdx](https://npm.io/package/@mdx-js/mdx.md) ^0.10.1
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^6.0.5
- [babel-loader](https://npm.io/package/babel-loader.md) 7.*
- [@zeit/next-mdx](https://npm.io/package/@zeit/next-mdx.md) ^1.1.0
- [@zeit/next-typescript](https://npm.io/package/@zeit/next-typescript.md) ^1.1.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.2.3 (latest) — 2018-07-02
- 0.2.2 — 2018-06-29
- 0.2.1 — 2018-06-29
- 0.2.0 — 2018-06-28
- 0.1.1 — 2018-06-27
- 0.1.0 — 2018-06-25
- 0.0.14 — 2018-06-25
- 0.0.13 — 2018-06-24
- 0.0.12 — 2018-06-24
- 0.0.9 — 2018-06-24
- 0.0.8 — 2018-06-24
- 0.0.7 — 2018-06-24
- 0.0.6 — 2018-06-24
- 0.0.5 — 2018-06-24
- 0.0.4 — 2018-06-20
- … 3 more at https://npm.io/package/doc.mdx/versions

## README

[![npm](https://img.shields.io/npm/v/doc.mdx.svg)](https://npm.im/doc.mdx)
[![downloads](https://img.shields.io/npm/dt/doc.mdx.svg)](https://npm.im/doc.mdx)

A static site generator on top of Markdown and React ✍️

It supports not only Markdown, but also JavaScript and TypeScript.

## Basic Usage

### Install

```bash
$ npm install --save doc.mdx
```

### Configuration

Add a script to your package.json like this:

```json
{
  "scripts": {
    "dev": "doc",
    "build": "doc build"
  }
}
```

### Writing Markdown

Populate `./pages/index.md` inside your project:

```md
# Hello World
```

### Development Mode

Just run `npm run dev` and go to `http://localhost:4000`.

### Production Build

```bash
$ npm run build
```

By default, build output is `docs` folder.

To change this, run `npm run build -o <outdir>` or edit `package.json`.

## CLI Usage

### Install

```bash
$ npm install --global doc.mdx
```

### Create Application

To create `<MY-APP>`, just run the command below:

```bash
$ doc init <MY-APP>
```

Then, run `npm run dev` and go to `http://localhost:4000`

### Create Application with Template

You can use `examples/*` sample apps as templating.

To create the `example/with-typescript` app, run the command below:

```bash
$ doc init <MY-APP> --template with-typescript
```

## CLI Reference

### `doc init`

```bash
$ doc init --help

    Description
      Create the doc.mdx application

    Usage
      $ doc init <name> -t <template name>

    <name> represents your application name (default to 'my-app').
    <template name> is listed on examples/* folder.

    Options
      --template, -t  Which example to use as default template
      --help, -h      Displays this message
```

### `doc dev` (alias of `doc`)

```bash
$ doc dev --help

    Description
      Starts the application in development mode

    Usage
      $ doc dev <dir> -p <port number>

    <dir> represents where the compiled folder should go.
    If no directory is provided, the folder will be created in the current directory.

    Options
      --port, -p      A port number on which to start the application
      --hostname, -H  Hostname on which to start the application
      --help, -h      Displays this message
```

### `doc build`

```bash
$ doc build --help

    Description
      Exports the application for production deployment

    Usage
      $ doc build [options] <dir>

    <dir> represents where the compiled dist folder should go.
    If no directory is provided, the 'docs' folder will be created in the current directory.

    Options
      -o - set the output dir (defaults to 'docs')
      -s - do not print any messages to console
      -h - list this help
```

## Examples

See [examples](./examples) folder for more information.

Or you can start the example app by `doc init <app-name> --template <example-dirname>`.

## Custom Configuration

Doc.mdx is a [Next.js](https://github.com/zeit/next.js) wrapper specialized for writing markdown.

So you can customize it using `next.config.js`.

## Develop

### Basic

```bash
$ git clone https://github.com/saltyshiomix/doc.mdx
$ cd doc.mdx
$ yarn
$ yarn dev # default is examples/hello-world
```

### Developing `examples/*`

```bash
$ yarn dev <EXAMPLE-FOLDER-NAME>
```

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