Coder Social home page Coder Social logo

esdoc-importpath-dedupe-plugin's Introduction

ESDoc Import Path Dedupe Plugin

This is a plugin that converts the import path in documentation. It removes duplicate last parts in import paths, which is useful for components that have a folder and a file with the same name, but are imported using the index.js file anyways. For example, consider this structure:

src/
  components/
    MyComponent/
      index.js
      MyComponent.js

In your codebase, you will do import MyComponent from 'components/MyComponent'. ESDoc will generate docs with import MyComponent from 'components/MyComponent/MyComponent.js'. Using this plugin, the docs will be generated with import MyComponent from 'components/MyComponent' because the plugin detects that the last two segments of the path are equal when applying the js extension.

Install

npm install esdoc-importpath-dedupe-plugin

Config

In the default configuration, only paths to files with the extension js are handled, but you can change that using the extensions option. The extensions option can be a comma-separated string or an array of extension strings.

{
  "source": "./src",
  "destination": "./doc",
  "plugins": [
    {
      "name": "esdoc-importpath-dedupe-plugin",
      "option": {
        "extensions": ["js"]
      }
    }
  ]
}

LICENSE

MIT

Author

Jovica Aleksic

esdoc-importpath-dedupe-plugin's People

Watchers

Jovica Aleksic avatar James Cloos avatar

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.