File tree Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Expand file tree Collapse file tree 5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -188,5 +188,6 @@ module.exports = {
188
188
// 2nd appearance: "31-good-morning-my-friend---do-you-have-5-1"
189
189
// 3rd appearance: "31-good-morning-my-friend---do-you-have-5-2"
190
190
linkifyHeaderStyle : 'keep-case' ,
191
- autoVersionCheck : true
191
+ autoVersionCheck : true ,
192
+ defaultTocDepth : 3
192
193
}
Original file line number Diff line number Diff line change @@ -147,5 +147,6 @@ module.exports = {
147
147
openID : toBooleanConfig ( process . env . CMD_OPENID ) ,
148
148
defaultUseHardbreak : toBooleanConfig ( process . env . CMD_DEFAULT_USE_HARD_BREAK ) ,
149
149
linkifyHeaderStyle : process . env . CMD_LINKIFY_HEADER_STYLE ,
150
- autoVersionCheck : toBooleanConfig ( process . env . CMD_AUTO_VERSION_CHECK )
150
+ autoVersionCheck : toBooleanConfig ( process . env . CMD_AUTO_VERSION_CHECK ) ,
151
+ defaultTocDepth : toIntegerConfig ( process . env . CMD_DEFAULT_TOC_DEPTH )
151
152
}
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ exports.getConfig = (req, res) => {
41
41
allowedUploadMimeTypes : config . allowedUploadMimeTypes ,
42
42
defaultUseHardbreak : config . defaultUseHardbreak ,
43
43
linkifyHeaderStyle : config . linkifyHeaderStyle ,
44
- useCDN : config . useCDN
44
+ useCDN : config . useCDN ,
45
+ defaultTocDepth : config . defaultTocDepth
45
46
}
46
47
res . set ( {
47
48
'Cache-Control' : 'private' , // only cache by client
Original file line number Diff line number Diff line change @@ -813,7 +813,7 @@ export function generateToc (id) {
813
813
/* eslint-disable no-unused-vars */
814
814
815
815
var tocOptions = md . meta . toc || { }
816
- var maxLevel = ( typeof tocOptions . maxLevel === 'number' && tocOptions . maxLevel > 0 ) ? tocOptions . maxLevel : 3
816
+ var maxLevel = ( typeof tocOptions . maxLevel === 'number' && tocOptions . maxLevel > 0 ) ? tocOptions . maxLevel : window . defaultTocDepth
817
817
818
818
var toc = new window . Toc ( 'doc' , {
819
819
level : maxLevel ,
@@ -1016,7 +1016,7 @@ export function renderTOC (view) {
1016
1016
/* eslint-disable no-unused-vars */
1017
1017
1018
1018
var tocOptions = md . meta . toc || { }
1019
- var maxLevel = ( typeof tocOptions . maxLevel === 'number' && tocOptions . maxLevel > 0 ) ? tocOptions . maxLevel : 3
1019
+ var maxLevel = ( typeof tocOptions . maxLevel === 'number' && tocOptions . maxLevel > 0 ) ? tocOptions . maxLevel : window . defaultTocDepth
1020
1020
1021
1021
const TOC = new window . Toc ( 'doc' , {
1022
1022
level : maxLevel ,
Original file line number Diff line number Diff line change @@ -13,3 +13,5 @@ window.linkifyHeaderStyle = '<%- linkifyHeaderStyle %>'
13
13
window.DROPBOX_APP_KEY = '<% - DROPBOX_APP_KEY %> '
14
14
15
15
window.USE_CDN = <% - useCDN %>
16
+
17
+ window.defaultTocDepth = <% - defaultTocDepth %>
You can’t perform that action at this time.
0 commit comments