Giter VIP home page Giter VIP logo

doc-scripts's Introduction

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 🦅

npm install --save doc-scripts

Usage 🌈

1. Node cli

doc-scripts start --input docs

doc-script build --input docs --output doc-site

2. Markdown Usage

examples

3. Javascript api

import {execute} from 'doc-scripts'

const options = {
  title:'xxxx',
  header:'<link rel="stylesheet" href="//xxxxxx">',
  footer:'<script>xxxxx</script>',
  renderer:'./doc-renderer.js',
  requires:[]
}

const webpackConfig = {
  module:{
    rules:[...]
  }
}

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.

module.exports = {
  module: {
    rules: []
  },
  plugins: []
}

//or

module.exports = function(config) {
  return {
    ...config,
    module: {
      rules: []
    },
    plugins: []
  }
}

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.

<!-- this is doc-scripts.header.html -->
<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.

import DocRenderer from 'react-doc-renderer'

//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.

export default ({docs = []})=>(
  <div>
    <DocRenderer docs={docs}/>
  </div>
)

Contributors 💪🏻

Janry
Janry

📖 💻 👀 🤔

LICENSE

Doc scripts is open source software licensed as MIT.

doc-scripts's People

Contributors

inier avatar janrywang avatar sanwei-alibaba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

doc-scripts's Issues

可以支持一下 disableHostCheck

new WebpackDevServer(complier, {
        publicPath: '/',
        quiet: true,
        hot: true,
        disableHostCheck: true // add this line
      }).listen(DEFAULT_PORT, HOST, function (err) {
        if (err) {
          return log.error(err);
        }

        openBrowser("http://" + HOST + ":" + DEFAULT_PORT);
      });

memo 能力

类似 React.useMemo, 如果这个组件文档没有更新, doc-scripts build 就不需要重新build

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.