项目作者: janryWang

项目描述 :
React Document Build Tool Scripts , Like react-scripts of create react app
高级语言: JavaScript
项目地址: git://github.com/janryWang/doc-scripts.git
创建时间: 2018-12-27T02:22:12Z
项目社区:https://github.com/janryWang/doc-scripts

开源协议:MIT License

下载








Features 🦑

  • 🛠 No config
  • 😆 Based on Markdown,Merge and Show all markdown files
  • 👩‍💻 Code Highlighting And JSX Code is Runnable
  • 💯 Emoji Support
  • 🍖 React Props Table Support
  • ✨ Creates Static files (only JS is prism)
  • 🏳️‍🌈 Pretty Pages
  • 🦄 Customizable
  • 🇳🇱 CodeSandbox and iframe Support

Install 🦅

  1. npm install --save doc-scripts

Usage 🌈

1. Node cli

  1. doc-scripts start --input docs
  2. doc-script build --input docs --output doc-site

2. Markdown Usage

examples

3. Javascript api

  1. import {execute} from 'doc-scripts'
  2. const options = {
  3. title:'xxxx',
  4. header:'<link rel="stylesheet" href="//xxxxxx">',
  5. footer:'<script>xxxxx</script>',
  6. renderer:'./doc-renderer.js',
  7. requires:[]
  8. }
  9. const webpackConfig = {
  10. module:{
  11. rules:[...]
  12. }
  13. }
  14. execute('start',options,webpackConfig) or execute('build',options,webpackConfig)

4. Webpack extended configuration

Create a new file named doc-scripts.config.js in the root directory. The
following is the specific format specification.

  1. module.exports = {
  2. module: {
  3. rules: []
  4. },
  5. plugins: []
  6. }
  7. //or
  8. module.exports = function(config) {
  9. return {
  10. ...config,
  11. module: {
  12. rules: []
  13. },
  14. plugins: []
  15. }
  16. }

5. Demo HTML Template extended configuration

Create a new file named doc-scripts.header.html or doc-scripts.footer.html in
the root directory. The following is the specific format specification.

  1. <!-- this is doc-scripts.header.html -->
  2. <link rel="stylesheet" href="//unpkg.com/@alifd/next/dist/next.min.css" />

6. Customize Doc Renderer

Create a new file named doc-scripts.renderer.js in
the root directory. The following is the specific format specification.

  1. import DocRenderer from 'react-doc-renderer'
  2. //react-doc-renderer default render engien in doc-scripts, so ,you can continue to reuse this component in doc-scripts.renderer.js, or you can completely override its behavior.
  3. export default ({docs = []})=>(
  4. <div>
  5. <DocRenderer docs={docs}></DocRenderer>
  6. </div>
  7. )

Contributors 💪🏻

Janry
Janry

📖 💻 👀 🤔

LICENSE

Doc scripts is open source software licensed as MIT.