Skip to content

Commit 9735f40

Browse files
committed
[build] 4.2.3
1 parent b8a96b8 commit 9735f40

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](_media/icon.svg)
22

3-
# docsify <small>4.2.2</small>
3+
# docsify <small>4.2.3</small>
44

55
> A magical documentation site generator.
66

lib/docsify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3802,7 +3802,7 @@ initGlobalAPI();
38023802
/**
38033803
* Version
38043804
*/
3805-
Docsify.version = '4.2.2';
3805+
Docsify.version = '4.2.3';
38063806

38073807
/**
38083808
* Run Docsify

lib/docsify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/plugins/search.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function saveData (maxAge) {
4141
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS));
4242
}
4343

44-
function genIndex (path, content, router) {
44+
function genIndex (path, content, router, depth) {
4545
if ( content === void 0 ) content = '';
4646

4747
var tokens = window.marked.lexer(content);
@@ -50,7 +50,7 @@ function genIndex (path, content, router) {
5050
var slug;
5151

5252
tokens.forEach(function (token) {
53-
if (token.type === 'heading' && token.depth <= 2) {
53+
if (token.type === 'heading' && token.depth <= depth) {
5454
slug = router.toURL(path, { id: slugify(token.text) });
5555
index[slug] = { slug: slug, title: token.text, body: '' };
5656
} else {
@@ -161,7 +161,7 @@ function init$1 (config, vm) {
161161
helper
162162
.get(vm.router.getFile(path))
163163
.then(function (result) {
164-
INDEXS[path] = genIndex(path, result, vm.router);
164+
INDEXS[path] = genIndex(path, result, vm.router, config.depth);
165165
len === ++count && saveData(config.maxAge);
166166
});
167167
});
@@ -262,6 +262,7 @@ var CONFIG = {
262262
placeholder: 'Type to search',
263263
noData: 'No Results!',
264264
paths: 'auto',
265+
depth: 2,
265266
maxAge: 86400000 // 1 day
266267
};
267268

@@ -276,6 +277,7 @@ var install = function (hook, vm) {
276277
CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge;
277278
CONFIG.placeholder = opts.placeholder || CONFIG.placeholder;
278279
CONFIG.noData = opts.noData || CONFIG.noData;
280+
CONFIG.depth = opts.depth || CONFIG.depth;
279281
}
280282

281283
var isAuto = CONFIG.paths === 'auto';

lib/plugins/search.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docsify-server-renderer/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docsify-server-renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsify-server-renderer",
3-
"version": "4.2.2",
3+
"version": "4.2.3",
44
"description": "docsify server renderer",
55
"author": {
66
"name": "qingwei-li",

0 commit comments

Comments
 (0)