-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into delete-package-lock
* develop: Update build/css.js use a port for the tests that doesn't collide with common local server ports Revert "ensure that the test script runs a prod build" update outdated comment ensure that the test script runs a prod build simplify import remove some unused code and accept eslint changes remove the DOCSIFY global made by Rollup, and move Docsify into a separate file where we can import it from tests while leaving the entry point for the bundle without any exports so that Rollup will not create a global variable from it feat: update src/core/index.js to export all global APIs, deprecate old globals in favor of a single global DOCSIFY, and add tests for this add build error handling so builds don't silently fail update docs regarding configs as functions add editorconfig (tells editors which basic text format to use) add tests to make sure the global and plugin APIs are available and that configs can be functions allow the user's $docsify config to be a function that receives as input the Docsify instance
- Loading branch information
Showing
15 changed files
with
321 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { initMixin } from './init'; | ||
import { routerMixin } from './router'; | ||
import { renderMixin } from './render'; | ||
import { fetchMixin } from './fetch'; | ||
import { eventMixin } from './event'; | ||
import initGlobalAPI from './global-api'; | ||
|
||
export function Docsify() { | ||
this._init(); | ||
} | ||
|
||
const proto = Docsify.prototype; | ||
|
||
initMixin(proto); | ||
routerMixin(proto); | ||
renderMixin(proto); | ||
fetchMixin(proto); | ||
eventMixin(proto); | ||
|
||
/** | ||
* Global API | ||
*/ | ||
initGlobalAPI(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,8 @@ | ||
import { initMixin } from './init'; | ||
import { routerMixin } from './router'; | ||
import { renderMixin } from './render'; | ||
import { fetchMixin } from './fetch'; | ||
import { eventMixin } from './event'; | ||
import initGlobalAPI from './global-api'; | ||
|
||
/** | ||
* Fork https://github.com/bendrucker/document-ready/blob/master/index.js | ||
* @param {Function} callback The callbacack to be called when the page is loaded | ||
* @returns {Number|void} If the page is already laoded returns the result of the setTimeout callback, | ||
* otherwise it only attaches the callback to the DOMContentLoaded event | ||
*/ | ||
function ready(callback) { | ||
const state = document.readyState; | ||
|
||
if (state === 'complete' || state === 'interactive') { | ||
return setTimeout(callback, 0); | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', callback); | ||
} | ||
|
||
function Docsify() { | ||
this._init(); | ||
} | ||
|
||
const proto = Docsify.prototype; | ||
|
||
initMixin(proto); | ||
routerMixin(proto); | ||
renderMixin(proto); | ||
fetchMixin(proto); | ||
eventMixin(proto); | ||
|
||
/** | ||
* Global API | ||
*/ | ||
initGlobalAPI(); | ||
import { documentReady } from './util/dom'; | ||
import { Docsify } from './Docsify'; | ||
|
||
/** | ||
* Run Docsify | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
ready(_ => new Docsify()); | ||
documentReady(_ => new Docsify()); |
Oops, something went wrong.