command line tool to generate bolierplate md files for the files or folders in the current working directory,wherever this cli runs
npm install mdocifyTo automatically link mdocify to your environment variables you would need to add it as a global package,if you install to any particular project dependencies,you might need to link it by yourself by using some commands which has been described below
``bash`
$ yarn global add mdocifyor
$ npm install -g modcify
or yarn link command
$3
Cloning the project since its not availabe on npm registry
`bash
$ git clone https://github.com/vinitraj10/mdocify
`$3
Installing all dependencies
`bash
$ cd mdocify && yarn
`$3
Linking the cli to the terminal,this will add symlink or path to your environment variables
`bash
$ yarn link
`
$3
Edit your sidebars.js of docusarus-v2 for handling the updates in sidebar
`
someSideBar: {
Components: [..., / next_doc_id /],
}
`
Just make sure you add / next_doc_id / this line to make sure you get auto update in your provide key field,for example i have added in Components, you can wherever you want to add.
Working
To Make it work,Right now I am assuming you have a
React Project where you have been using docusarus-v2,Now to generate markdown file you need to run this command where you have kept all your components folder,It assumes a component will have its separate folder for now,will handle for components file also in coming work.Your directory structure should look like
`
|-- components
|-- Button
|-- index.tsx
|-- button.css
|-- Card
|-- index.tsx
|-- card.css
`So you need to run
`bash
$ /components> mdocify
`
on root directory like here its components,it will magically search for documentation directory which resides in your project root if you are using docusarus-v2.
and it will automatically generate
.md file for your components also sidebars.js will be updated automatically your directory structure would look like this`
|-- documentation
|-- docs
|-- button.md
|-- card.md
`
And at last run docusarus server to see the updates,run the following command in documentation folder,as docusarus lives there only
`bash
$ yarn start
``This might not be useful to you at first glance,but if you got an idea what i am trying to do,then you can contribute in this project anytime or if you want to discuss anything related to this or ReactJs,React-Native then you can get in touch with me at twitter vinitraj_10