-
Notifications
You must be signed in to change notification settings - Fork 689
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
547 additions
and
5 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
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
33 changes: 33 additions & 0 deletions
33
docfx/plugins/memberpage-extras/ManagedReference.extension.js
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,33 @@ | ||
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
var common = require('./ManagedReference.common.js'); | ||
|
||
exports.preTransform = function (model) { | ||
transform(model); | ||
|
||
function transform(item) { | ||
if (item.children) item.children.forEach(function(i) { | ||
transform(i); | ||
}); | ||
} | ||
|
||
return model; | ||
} | ||
|
||
exports.postTransform = function (model) { | ||
var type = model.type.toLowerCase(); | ||
var category = common.getCategory(type); | ||
if (category == 'class') { | ||
var typePropertyName = common.getTypePropertyName(type); | ||
if (typePropertyName) { | ||
model[typePropertyName] = true; | ||
} | ||
if (model.children && model.children.length > 0) { | ||
model.isCollection = true; | ||
common.groupChildren(model, 'class'); | ||
} else { | ||
model.isItem = true; | ||
} | ||
} | ||
|
||
return model; | ||
} |
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,79 @@ | ||
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
exports.transform = function (model) { | ||
var groupNames = { | ||
"constructor": { key: "constructorsInSubtitle" }, | ||
"field": { key: "fieldsInSubtitle" }, | ||
"property": { key: "propertiesInSubtitle" }, | ||
"method": { key: "methodsInSubtitle" }, | ||
"event": { key: "eventsInSubtitle" }, | ||
"operator": { key: "operatorsInSubtitle" }, | ||
"eii": { key: "eiisInSubtitle" }, | ||
}; | ||
|
||
groupChildren(model); | ||
transformItem(model, 1); | ||
return model; | ||
|
||
function groupChildren(item) { | ||
if (!item || !item.items || item.items.length == 0) { | ||
return; | ||
} | ||
var grouped = {}; | ||
var items = []; | ||
item.items.forEach(function (element) { | ||
groupChildren(element); | ||
if (element.type) { | ||
var type = element.isEii ? "eii" : element.type.toLowerCase(); | ||
if (!grouped.hasOwnProperty(type)) { | ||
if (!groupNames.hasOwnProperty(type)) { | ||
groupNames[type] = { | ||
name: element.type | ||
}; | ||
console.log(type + " is not predefined type, use its type name as display name.") | ||
} | ||
grouped[type] = []; | ||
} | ||
grouped[type].push(element); | ||
} else { | ||
items.push(element); | ||
} | ||
}, this); | ||
|
||
// With order defined in groupNames | ||
for (var key in groupNames) { | ||
if (groupNames.hasOwnProperty(key) && grouped.hasOwnProperty(key)) { | ||
items.push({ | ||
name: model.__global[groupNames[key].key] || groupNames[key].name, | ||
items: grouped[key] | ||
}) | ||
} | ||
} | ||
|
||
item.items = items; | ||
} | ||
|
||
function transformItem(item, level) { | ||
// set to null in case mustache looks up | ||
item.topicHref = item.topicHref || null; | ||
item.tocHref = item.tocHref || null; | ||
item.name = item.name || null; | ||
|
||
item.level = level; | ||
|
||
// Add word break opportunities before dots | ||
|
||
if (item.name) | ||
item.name = item.name.replace(/\./g, "\u200B."); | ||
|
||
if (item.items && item.items.length > 0) { | ||
item.leaf = false; | ||
var length = item.items.length; | ||
for (var i = 0; i < length; i++) { | ||
transformItem(item.items[i], level + 1); | ||
}; | ||
} else { | ||
item.items = []; | ||
item.leaf = true; | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
docfx/plugins/memberpage.2.59.4/ManagedReference.extension.js
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,20 @@ | ||
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
var common = require('./ManagedReference.common.js'); | ||
|
||
exports.postTransform = function (model) { | ||
var type = model.type.toLowerCase(); | ||
var category = common.getCategory(type); | ||
if (category == 'class') { | ||
var typePropertyName = common.getTypePropertyName(type); | ||
if (typePropertyName) { | ||
model[typePropertyName] = true; | ||
} | ||
if (model.children && model.children.length > 0) { | ||
model.isCollection = true; | ||
common.groupChildren(model, 'class'); | ||
} else { | ||
model.isItem = true; | ||
} | ||
} | ||
return model; | ||
} |
10 changes: 10 additions & 0 deletions
10
docfx/plugins/memberpage.2.59.4/ManagedReference.overwrite.js
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,10 @@ | ||
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
var common = require('./ManagedReference.common.js'); | ||
|
||
exports.getOptions = function (model) { | ||
var ignoreChildrenBookmarks = model._splitReference && model.type && common.getCategory(model.type) === 'ns'; | ||
|
||
return { | ||
"bookmarks": common.getBookmarks(model, ignoreChildrenBookmarks) | ||
}; | ||
} |
59 changes: 59 additions & 0 deletions
59
docfx/plugins/memberpage.2.59.4/partials/class.tmpl.partial
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,59 @@ | ||
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} | ||
|
||
{{>partials/class.header}} | ||
{{#children}} | ||
{{#overload}} | ||
<a id="{{id}}" data-uid="{{uid}}"></a> | ||
{{/overload}} | ||
<h3 id="{{id}}">{{>partials/classSubtitle}}</h3> | ||
{{#children.0}} | ||
<table class="table table-bordered table-striped table-condensed"> | ||
<thead> | ||
<tr> | ||
<th>{{__global.name}}</th> | ||
<th>{{__global.description}}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{{/children.0}} | ||
{{#children}} | ||
<tr> | ||
<td id="{{id}}" data-uid="{{uid}}"> | ||
<xref uid="{{uid}}" altProperty="fullName" displayProperty="name"/> | ||
</td> | ||
<td class="markdown level1 summary">{{{summary}}}</td> | ||
</tr> | ||
{{/children}} | ||
{{#children.0}} | ||
</tbody> | ||
</table> | ||
{{/children.0}} | ||
{{/children}} | ||
{{#extensionMethods.0}} | ||
<h3 id="extensionmethods">{{__global.extensionMethods}}</h3> | ||
{{/extensionMethods.0}} | ||
{{#extensionMethods}} | ||
<div> | ||
{{#definition}} | ||
<xref uid="{{definition}}" altProperty="fullName" displayProperty="nameWithType"/> | ||
{{/definition}} | ||
{{^definition}} | ||
<xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/> | ||
{{/definition}} | ||
</div> | ||
{{/extensionMethods}} | ||
{{#seealso.0}} | ||
<h3 id="seealso">{{__global.seealso}}</h3> | ||
<div class="seealso"> | ||
{{/seealso.0}} | ||
{{#seealso}} | ||
{{#isCref}} | ||
<div>{{{type.specName.0.value}}}</div> | ||
{{/isCref}} | ||
{{^isCref}} | ||
<div>{{{url}}}</div> | ||
{{/isCref}} | ||
{{/seealso}} | ||
{{#seealso.0}} | ||
</div> | ||
{{/seealso.0}} |
Oops, something went wrong.