Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/default/toc.extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions templates/default/toc.json.js
Original file line number Diff line number Diff line change
@@ -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] === '_') {
Expand Down