Giter Site home page Giter Site logo

wooodhead / docusaurus-plugin-auto-sidebars Goto Github PK

View Code? Open in Web Editor NEW

This project forked from acrobit/docusaurus-plugin-auto-sidebars

0.0 1.0 0.0 3.43 MB

A docusaurus plugin that generates the sidebar items automatically by filesystem structure

JavaScript 46.30% TypeScript 44.32% CSS 9.39%

docusaurus-plugin-auto-sidebars's Introduction

npm version

Installation

yarn add docusaurus-plugin-auto-sidebars

or

npm install docusaurus-plugin-auto-sidebars --save

Usage

  1. Create an empty sidebars.auto.js in the root of the project

  2. Add this plugin to the plugins array in docusaurus.config.js :

module.exports = {
  // ...
  plugins: [
    'docusaurus-plugin-auto-sidebars'
  ],
}

Or, if you want to specify a custom docs folder:

module.exports = {
  // ...
  plugins: [
    ['docusaurus-plugin-auto-sidebars', {
      docs:'mydocs'
    }]
  ],
}
How to change the title of the folders?

Just add a sidebars.yaml in your docs folder:

- folder1: 
  - Parent Folder One # First element is the title of parent, next elements are sub directories
  - subfolder1: Sub Folder One
  - subfolder2: Sub Folder Two
  - subfolder3: false # Hide it!
  
- folder2: 
  - Parent Folder Two # First element is the title
  - subfolder1: Sub Folder One
  - subfolder2: Sub Folder Two
How to change the order of the files and the folders?

Method 1: By adding a number to the beggining of files and folders

1.fileX.md
2.fileY.md
3.fileX.md

Note : You can also use negative numbers to display them in reverse order : -1. fileX.md

Method 2: Define them in the sidebars.yaml file

- folder1: 
  - Parent Folder One: 1 # the order number beside the title
  - subfolder1: Sub Folder One
  - subfolder2: Sub Folder Two
  
- folder2: 
  - Parent Folder Two: 2 # the order number beside the title
  - subfolder1: Sub Folder One
  - subfolder2: Sub Folder Two

docusaurus-plugin-auto-sidebars's People

Contributors

cjoy avatar ghominejad avatar

Watchers

 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.