Skip to content

Commit

Permalink
feat: new option hideSidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
anikethsaha committed Feb 14, 2020
1 parent d798a12 commit 9b218a1
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 50 deletions.
93 changes: 53 additions & 40 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The DOM element to be mounted on initialization. It can be a CSS selector string
```js
window.$docsify = {
el: '#app'
};
}
```

## repo
Expand All @@ -37,7 +37,7 @@ window.$docsify = {
repo: 'docsifyjs/docsify',
// or
repo: 'https://github.com/docsifyjs/docsify/'
};
}
```

## maxLevel
Expand All @@ -50,7 +50,7 @@ Maximum Table of content level.
```js
window.$docsify = {
maxLevel: 4
};
}
```

## loadNavbar
Expand All @@ -67,7 +67,7 @@ window.$docsify = {

// load from nav.md
loadNavbar: 'nav.md'
};
}
```

## loadSidebar
Expand All @@ -84,9 +84,24 @@ window.$docsify = {

// load from summary.md
loadSidebar: 'summary.md'
};
}
```

## hideSidebar

- Type : `Boolean`
- Default: `true`

This option will completely hide your sidebar and wont render any content of the side even .

````js
window.$docsify = {

hideSidebar: true,

};


## subMaxLevel

- Type: `Number`
Expand All @@ -98,7 +113,7 @@ Add table of contents (TOC) in custom sidebar.
window.$docsify = {
subMaxLevel: 2
};
```
````
## auto2top
Expand All @@ -110,7 +125,7 @@ Scrolls to the top of the screen when the route is changed.
```js
window.$docsify = {
auto2top: true
};
}
```

## homepage
Expand All @@ -128,7 +143,7 @@ window.$docsify = {
// Or use the readme in your repo
homepage:
'https://raw.githubusercontent.com/docsifyjs/docsify/master/README.md'
};
}
```

## basePath
Expand All @@ -147,7 +162,7 @@ window.$docsify = {
// Even can load files from other repo
basePath:
'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
};
}
```

## relativePath
Expand Down Expand Up @@ -187,7 +202,7 @@ window.$docsify = {
// Relative path disabled (default value)
relativePath: false
};
}
```

## coverpage
Expand All @@ -212,7 +227,7 @@ window.$docsify = {
'/': 'cover.md',
'/zh-cn/': 'cover.md'
}
};
}
```

## logo
Expand All @@ -224,7 +239,7 @@ Website logo as it appears in the sidebar, you can resize by CSS.
```js
window.$docsify = {
logo: '/_media/icon.svg'
};
}
```

## name
Expand All @@ -236,15 +251,15 @@ Website name as it appears in the sidebar.
```js
window.$docsify = {
name: 'docsify'
};
}
```

The name field can also contain custom HTML for easier customization:

```js
window.$docsify = {
name: '<span>docsify</span>'
};
}
```

## nameLink
Expand All @@ -263,7 +278,7 @@ window.$docsify = {
'/zh-cn/': '/zh-cn/',
'/': '/'
}
};
}
```

## markdown
Expand All @@ -287,9 +302,9 @@ window.$docsify = {
// function
markdown: function(marked, renderer) {
// ...
return marked;
return marked
}
};
}
```

## themeColor
Expand All @@ -301,7 +316,7 @@ Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en
```js
window.$docsify = {
themeColor: '#3F51B5'
};
}
```

## alias
Expand All @@ -319,7 +334,7 @@ window.$docsify = {
'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG',
'/.*/_sidebar.md': '/_sidebar.md' // See #301
}
};
}
```

## autoHeader
Expand All @@ -332,7 +347,7 @@ If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.m
window.$docsify = {
loadSidebar: true,
autoHeader: true
};
}
```

## executeScript
Expand All @@ -344,7 +359,7 @@ Execute the script on the page. Only parse the first script tag([demo](themes)).
```js
window.$docsify = {
executeScript: true
};
}
```

```markdown
Expand All @@ -366,7 +381,7 @@ Disabled emoji parse.
```js
window.$docsify = {
noEmoji: true
};
}
```

## mergeNavbar
Expand All @@ -378,7 +393,7 @@ Navbar will be merged with the sidebar on smaller screens.
```js
window.$docsify = {
mergeNavbar: true
};
}
```

## formatUpdated
Expand All @@ -395,9 +410,9 @@ window.$docsify = {
formatUpdated: function(time) {
// ...
return time;
return time
}
};
}
```

## externalLinkTarget
Expand All @@ -410,7 +425,7 @@ Target to open external links inside the markdown. Default `'_blank'` (new windo
```js
window.$docsify = {
externalLinkTarget: '_self' // default: '_blank'
};
}
```

## cornerExternalLinkTarget
Expand All @@ -423,7 +438,7 @@ Target to open external link at the top right corner. Default `'_blank'` (new wi
```js
window.$docsify = {
cornerExternalLinkTarget: '_self' // default: '_blank'
};
}
```

## externalLinkRel
Expand All @@ -436,7 +451,7 @@ Default `'noopener'` (no opener) prevents the newly opened external page (when [
```js
window.$docsify = {
externalLinkTarget: '' // default: 'noopener'
};
}
```

## routerMode
Expand All @@ -447,7 +462,7 @@ window.$docsify = {
```js
window.$docsify = {
routerMode: 'history' // default: 'hash'
};
}
```

## noCompileLinks
Expand All @@ -459,7 +474,7 @@ Sometimes we do not want docsify to handle our links. See [#203](https://github.
```js
window.$docsify = {
noCompileLinks: ['/foo', '/bar/.*']
};
}
```

## onlyCover
Expand All @@ -471,7 +486,7 @@ Only coverpage is loaded when visiting the home page.
```js
window.$docsify = {
onlyCover: false
};
}
```

## requestHeaders
Expand All @@ -485,7 +500,7 @@ window.$docsify = {
requestHeaders: {
'x-token': 'xxx'
}
};
}
```

Such as setting the cache
Expand All @@ -495,11 +510,9 @@ window.$docsify = {
requestHeaders: {
'cache-control': 'max-age=600'
}
};
}
```



## ext

- type: `String`
Expand All @@ -509,7 +522,7 @@ Request file extension.
```js
window.$docsify = {
ext: '.md'
};
}
```

## fallbackLanguages
Expand All @@ -527,7 +540,7 @@ Example:
```js
window.$docsify = {
fallbackLanguages: ['fr', 'de']
};
}
```
## notFoundPage
Expand All @@ -539,15 +552,15 @@ Load the `_404.md` file:
```js
window.$docsify = {
notFoundPage: true
};
}
```
Load the customised path of the 404 page:
```js
window.$docsify = {
notFoundPage: 'my404.md'
};
}
```
Load the right 404 page according to the localisation:
Expand All @@ -558,7 +571,7 @@ window.$docsify = {
'/': '_404.md',
'/de': 'de/_404.md'
}
};
}
```
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
Loading

0 comments on commit 9b218a1

Please sign in to comment.