clean api
This commit is contained in:
parent
5cc9f0514c
commit
fef969f55d
9 changed files with 26 additions and 149 deletions
10
src/index.js
10
src/index.js
|
|
@ -7,11 +7,8 @@ const OPTIONS = merge({
|
|||
repo: '',
|
||||
maxLevel: 6,
|
||||
subMaxLevel: 0,
|
||||
sidebar: '',
|
||||
sidebarToggle: false,
|
||||
loadSidebar: null,
|
||||
loadNavbar: null,
|
||||
router: false,
|
||||
homepage: 'README.md',
|
||||
coverpage: '',
|
||||
basePath: '',
|
||||
|
|
@ -33,7 +30,6 @@ if (script) {
|
|||
if (OPTIONS.coverpage === true) OPTIONS.coverpage = '_coverpage.md'
|
||||
if (OPTIONS.repo === true) OPTIONS.repo = ''
|
||||
if (OPTIONS.name === true) OPTIONS.name = ''
|
||||
if (OPTIONS.sidebar) OPTIONS.sidebar = window[OPTIONS.sidebar]
|
||||
}
|
||||
|
||||
// utils
|
||||
|
|
@ -109,10 +105,8 @@ const Docsify = function () {
|
|||
// Render app
|
||||
render.renderApp(dom, replace)
|
||||
main()
|
||||
if (OPTIONS.router) {
|
||||
if (!/^#\//.test(window.location.hash)) window.location.hash = '#/'
|
||||
window.addEventListener('hashchange', main)
|
||||
}
|
||||
if (!/^#\//.test(window.location.hash)) window.location.hash = '#/'
|
||||
window.addEventListener('hashchange', main)
|
||||
}
|
||||
|
||||
export default Docsify()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue