diff --git a/templates/default/toc.extension.js b/templates/default/toc.extension.js index 672dd793522..0a85459080a 100644 --- a/templates/default/toc.extension.js +++ b/templates/default/toc.extension.js @@ -2,14 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. /** - * This method will be called at the start of exports.transform in toc.html.js + * This method will be called at the start of exports.transform in toc.html.js and toc.json.js */ exports.preTransform = function (model) { return model; } /** - * This method will be called at the end of exports.transform in toc.html.js + * This method will be called at the end of exports.transform in toc.html.js and toc.json.js */ exports.postTransform = function (model) { return model; diff --git a/templates/default/toc.json.js b/templates/default/toc.json.js index a59b350eed9..8c57d0016d2 100644 --- a/templates/default/toc.json.js +++ b/templates/default/toc.json.js @@ -1,11 +1,20 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +var extension = require('./toc.extension.js') exports.transform = function (model) { + if (extension && extension.preTransform) { + model = extension.preTransform(model); + } + if (model.memberLayout === 'SeparatePages') { model = transformMemberPage(model); } + + if (extension && extension.postTransform) { + model = extension.postTransform(model); + } for (var key in model) { if (key[0] === '_') {