4.7.1 • Published 11 months ago

playland v4.7.1

Weekly downloads
6
License
MIT
Repository
-
Last release
11 months ago

Playland

A React document tool.

Features

  • Zero config
  • React
  • TypeScript
  • PostCSS, CSS Modules
  • MDX (front matter, table of contents, syntax highlighting)

Install

npm i playland --save-dev
# Or
# yarn add playland --dev

Usage

File structures

Use md/mdx docs, see examples/basic:

.
├── README.md
├── package.json
└── docs # mdx pages
    ├── Foo.mdx
    └── Bar.mdx

Use jsx docs, see examples/with-jsx-pages:

.
├── .playland
│   └── config.js
├── README.md
├── package.json
├── docs # mdx pages
│   ├── Foo.mdx
│   └── bar.mdx
└── api # jsx pages
    ├── FooPage.jsx
    └── BarPage.jsx

Config file

Optional .playland/config.js:

/** @type {import('playland/types/cli').UserConfig} */
module.exports = {
  vite(config) {},
}

Optional index.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My App</title>
  </head>

  <body>
    <div id="root"></div>
    <script type="module">
      import React from 'react'
      import ReactDOM from 'react-dom'
      import {App} from 'playland/theme'

      const entries = import.meta.glob(['./**/*.{mdx,md}'], {eager: true})
      ReactDOM.render(
        React.createElement(App, {entries}),
        document.getElementById('root')
      )
    </script>
  </body>
</html>

Scripts

Add npm scripts to package.json:

{
  ...
  "scripts": {
    "start": "playland start",
    "build": "playland build"
  }
}
4.7.1

11 months ago

4.5.0

11 months ago

4.7.0

11 months ago

4.6.0

11 months ago

4.4.1

2 years ago

4.4.0

2 years ago

4.3.1

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

4.3.0

2 years ago

4.2.1

2 years ago

4.2.0

2 years ago

4.1.1

2 years ago

3.0.0-beta.0

3 years ago

3.0.0

3 years ago

2.2.0

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.2-cra

5 years ago

2.0.1-cra

5 years ago

2.0.0

5 years ago

1.3.0

5 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago