@startupjs/docs
MDX documentation generator
Last updated a day ago by yska .
Original npm · Tarball · package.json
$ cnpm install @startupjs/docs 
SYNC missed versions from official npm registry.

startupjs docs

MDX Documentation generator

Prerequisites

You must be using @startupjs/app for routing.

You can create a new application with the routing system using the routing template: npx startupjs init myapp -t routing

Installation

yarn add @startupjs/docs

Usage

  1. Create the docs/ folder in your project root.

  2. Add the following entries to the forceCompileModules list:

    const getConfig = require('startupjs/bundler').webpackWebConfig
    
    module.exports = getConfig(undefined, {
      forceCompileModules: [
        '@startupjs/docs',
        '@startupjs/mdx'
      ]
    })
    
  3. Create docs/index.js file with the following content:

import docs from '@startupjs/docs'
export default docs({
  typography: {
    type: 'mdx',
    // different titles for mdx documentation in English and Russian
    title: {
      en: 'Typography',
      ru: 'Типографика'
    },
    // different components to display for English and Russian documentation
    component: {
      en: require('../components/typography/Typography.en.mdx').default,
      ru: require('../components/typography/Typography.ru.mdx').default
    }
  },
  cssGuide: {
    type: 'mdx',
    // the same title for both English and Russian mdx documentation
    title: 'Typography',
    // the same component to display for English and Russian documentation
    component: require('../components/typography/Typography.en.mdx').default
  },
  // docs in collapse
  // items have the same api as mdx docs
  components: {
    type: 'collapse',
    title: {
      en: 'Components',
      ru: 'Компоненты'
    },
    items: {
      Button: {
        type: 'mdx',
        title: {
          en: 'Button',
          ru: 'Кнопка'
        }
        component: {
          en: require('../components/Button/Button.en.mdx').default,
          ru: require('../components/Button/Button.ru.mdx').default
        }
      },
      Card: {
        type: 'mdx',
        title: 'Card',
        component: require('../components/Card/Card.en.mdx').default
      }
    }
  }
})
  1. Add client-side docs app to your Root/App.js file:

    import docs from '../docs'
    // ...
    <App
      apps={{ main, docs }}
      // ...
    />
    
  2. Add server-side docs routes to your server/index.js file:

    import getDocsRoutes from '@startupjs/docs/routes'
    // ...
    
    startupjsServer({
      getHead,
      appRoutes: [
        ...getMainRoutes(),
        ...getDocsRoutes()
      ]
    })
    
    // ...
    

Licence

MIT

Current Tags

  • 0.22.0-canary.0                                ...           canary (3 months ago)
  • 0.23.45                                ...           latest (a day ago)
  • 0.22.0-alpha.46                                ...           next (3 months ago)

102 Versions

  • 0.23.45                                ...           a day ago
  • 0.23.44                                ...           a day ago
  • 0.23.42                                ...           23 days ago
  • 0.23.41                                ...           23 days ago
  • 0.23.40                                ...           24 days ago
  • 0.23.39                                ...           a month ago
  • 0.23.38                                ...           a month ago
  • 0.23.34                                ...           a month ago
  • 0.23.33                                ...           a month ago
  • 0.23.31                                ...           a month ago
  • 0.23.30                                ...           2 months ago
  • 0.23.29                                ...           2 months ago
  • 0.23.28                                ...           2 months ago
  • 0.23.27                                ...           2 months ago
  • 0.23.26                                ...           2 months ago
  • 0.23.25                                ...           2 months ago
  • 0.23.24                                ...           2 months ago
  • 0.23.23                                ...           2 months ago
  • 0.23.22                                ...           2 months ago
  • 0.23.20                                ...           2 months ago
  • 0.23.19                                ...           2 months ago
  • 0.23.18                                ...           2 months ago
  • 0.23.17                                ...           3 months ago
  • 0.23.16                                ...           3 months ago
  • 0.23.15                                ...           3 months ago
  • 0.23.10                                ...           3 months ago
  • 0.23.9                                ...           3 months ago
  • 0.23.8                                ...           3 months ago
  • 0.23.7                                ...           3 months ago
  • 0.23.6                                ...           3 months ago
  • 0.23.5                                ...           3 months ago
  • 0.23.4                                ...           3 months ago
  • 0.23.3                                ...           3 months ago
  • 0.23.2                                ...           3 months ago
  • 0.23.1                                ...           3 months ago
  • 0.23.0                                ...           3 months ago
  • 0.22.12                                ...           3 months ago
  • 0.22.11                                ...           3 months ago
  • 0.22.10                                ...           3 months ago
  • 0.22.9                                ...           3 months ago
  • 0.22.8                                ...           3 months ago
  • 0.22.7                                ...           3 months ago
  • 0.22.6                                ...           3 months ago
  • 0.22.5                                ...           3 months ago
  • 0.22.4                                ...           3 months ago
  • 0.22.3                                ...           3 months ago
  • 0.22.2                                ...           3 months ago
  • 0.22.1                                ...           3 months ago
  • 0.22.0                                ...           3 months ago
  • 0.22.0-canary.0                                ...           3 months ago
  • 0.22.0-alpha.46                                ...           3 months ago
  • 0.22.0-alpha.45                                ...           3 months ago
  • 0.22.0-alpha.44                                ...           3 months ago
  • 0.22.0-alpha.43                                ...           3 months ago
  • 0.22.0-alpha.42                                ...           3 months ago
  • 0.22.0-alpha.41                                ...           3 months ago
  • 0.22.0-alpha.40                                ...           4 months ago
  • 0.22.0-alpha.39                                ...           4 months ago
  • 0.22.0-alpha.38                                ...           4 months ago
  • 0.22.0-alpha.37                                ...           4 months ago
  • 0.22.0-alpha.36                                ...           4 months ago
  • 0.22.0-alpha.35                                ...           4 months ago
  • 0.22.0-alpha.34                                ...           4 months ago
  • 0.22.0-alpha.33                                ...           4 months ago
  • 0.22.0-alpha.32                                ...           4 months ago
  • 0.22.0-alpha.31                                ...           4 months ago
  • 0.22.0-alpha.30                                ...           4 months ago
  • 0.22.0-alpha.29                                ...           4 months ago
  • 0.22.0-alpha.28                                ...           4 months ago
  • 0.22.0-alpha.27                                ...           4 months ago
  • 0.22.0-alpha.26                                ...           4 months ago
  • 0.22.0-alpha.25                                ...           4 months ago
  • 0.22.0-alpha.24                                ...           4 months ago
  • 0.22.0-alpha.23                                ...           4 months ago
  • 0.22.0-alpha.22                                ...           4 months ago
  • 0.22.0-alpha.20                                ...           4 months ago
  • 0.22.0-alpha.18                                ...           5 months ago
  • 0.22.0-alpha.17                                ...           5 months ago
  • 0.22.0-alpha.16                                ...           5 months ago
  • 0.22.0-alpha.15                                ...           5 months ago
  • 0.22.0-alpha.14                                ...           5 months ago
  • 0.22.0-alpha.13                                ...           5 months ago
  • 0.22.0-alpha.12                                ...           5 months ago
  • 0.22.0-alpha.11                                ...           5 months ago
  • 0.22.0-alpha.10                                ...           5 months ago
  • 0.22.0-alpha.9                                ...           5 months ago
  • 0.22.0-alpha.8                                ...           5 months ago
  • 0.22.0-alpha.7                                ...           5 months ago
  • 0.22.0-alpha.6                                ...           5 months ago
  • 0.22.0-alpha.5                                ...           5 months ago
  • 0.22.0-alpha.4                                ...           5 months ago
  • 0.22.0-alpha.3                                ...           5 months ago
  • 0.22.0-alpha.2                                ...           5 months ago
  • 0.22.0-alpha.1                                ...           5 months ago
  • 0.22.0-alpha.0                                ...           5 months ago
  • 0.21.1                                ...           5 months ago
  • 0.21.0                                ...           5 months ago
  • 0.20.0                                ...           5 months ago
  • 0.19.3                                ...           5 months ago
  • 0.19.2                                ...           5 months ago
  • 0.19.1                                ...           5 months ago
  • 0.19.0                                ...           6 months ago
Downloads
Today 0
This Week 23
This Month 0
Last Day 23
Last Week 0
Last Month 68
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |