diff --git a/docs/docfx.json b/docs/docfx.json index eb3320a08..b22927779 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -22,6 +22,9 @@ } ], "build": { + "postProcessors": [ + "ExtractSearchIndex" + ], "resource": [ { "files": ["README.md"] diff --git a/docs/template/api_wiki/ManagedReference.extension.js b/docs/template/api_wiki/ManagedReference.extension.js new file mode 100644 index 000000000..a59b870c4 --- /dev/null +++ b/docs/template/api_wiki/ManagedReference.extension.js @@ -0,0 +1,78 @@ + +exports.postTransform = function (model) { + console.log("ManagedReference.extension.js EXECUTED"); + console.log("Root model: " + JSON.stringify(model)); + + setMemberFlags(model); + + return model; +}; + +function setMemberFlags(item, inheritedType) { + if (!item || typeof item !== 'object') return; + + // Determine the current item's declaration type. + var t = item.type + ? String(item.type).toLowerCase() + : inheritedType; + + // DocFX member-group containers identify their children + // through properties such as inMethod, inProperty, etc. + if (item.typePropertyName) { + var groupType = String(item.typePropertyName) + .replace(/^in/, '') + .toLowerCase(); + + if (groupType) { + t = groupType; + } + } + + // Container / Type declarations + item.isNamespace = (t === 'namespace'); + item.isClass = (t === 'class'); + item.isStruct = (t === 'struct'); + item.isInterface = (t === 'interface'); + item.isEnum = (t === 'enum'); + item.isDelegate = (t === 'delegate'); + + // Member declarations + item.isConstructor = (t === 'constructor'); + item.isMethod = (t === 'method'); + item.isProperty = (t === 'property'); + item.isField = (t === 'field'); + item.isEvent = (t === 'event'); + item.isOperator = (t === 'operator'); + + // Useful grouped helpers + item.isType = ( + item.isClass || + item.isStruct || + item.isInterface || + item.isEnum || + item.isDelegate + ); + + item.isMember = ( + item.isConstructor || + item.isMethod || + item.isProperty || + item.isField || + item.isEvent || + item.isOperator + ); + + // Recursively process nested models. + // Pass the current group type down to its children. + if (Array.isArray(item.children)) { + item.children.forEach(function (child) { + setMemberFlags(child, t); + }); + } + + if (Array.isArray(item.items)) { + item.items.forEach(function (child) { + setMemberFlags(child, t); + }); + } +} diff --git a/docs/template/api_wiki/layout/_master.tmpl b/docs/template/api_wiki/layout/_master.tmpl index 045682c3b..c5cbedd63 100644 --- a/docs/template/api_wiki/layout/_master.tmpl +++ b/docs/template/api_wiki/layout/_master.tmpl @@ -4,159 +4,475 @@ {{!include(logo.svg)}} - + + {{#redirect_url}} - + {{/redirect_url}} + {{^redirect_url}} - {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} - - - {{#_description}}{{/_description}} - {{#description}}{{/description}} - - - - - - {{#_description}}{{/_description}} - {{^_description}}{{#description}}{{/description}}{{/_description}} - - - - - - {{#_description}}{{/_description}} - {{^_description}}{{#description}}{{/description}}{{/_description}} - - - - - - - - {{#_noindex}}{{/_noindex}} - {{#_enableSearch}}{{/_enableSearch}} - {{#_disableNewTab}}{{/_disableNewTab}} - {{#_disableTocFilter}}{{/_disableTocFilter}} - {{#docurl}}{{/docurl}} - - - - - - - - - - - - - - - - - - {{#_googleAnalyticsTagId}} - - + + + + + + {{#_googleAnalyticsTagId}} + + + - {{/_googleAnalyticsTagId}} + + {{/_googleAnalyticsTagId}} {{/redirect_url}} - + - {{^redirect_url}} - +{{^redirect_url}} +
- {{^_disableNavbar}} - - {{/_disableNavbar}} + + {{/_disableNavbar}}
- {{^_disableToc}} -
-
-
-
Table of Contents
- -
-
- -
-
-
- {{/_disableToc}} - -
-
- {{^_disableToc}} - - {{/_disableToc}} - - {{^_disableBreadcrumb}} - - {{/_disableBreadcrumb}} -
+ {{^_disableToc}} +
+
+
+
Table of Contents
-
- {{!body}} -
- - {{^_disableContribution}} -
- {{#sourceurl}} - {{__global.improveThisDoc}} - {{/sourceurl}} - {{^sourceurl}}{{#docurl}} - {{__global.improveThisDoc}} - {{/docurl}}{{/sourceurl}} + +
+ +
+ +
+
- {{/_disableContribution}} + {{/_disableToc}} + +
+
+ {{^_disableToc}} + + {{/_disableToc}} + + {{^_disableBreadcrumb}} + + {{/_disableBreadcrumb}} +
+ +
+ {{!body}} +
- {{^_disableNextArticle}} - - {{/_disableNextArticle}} + {{^_disableContribution}} +
+ {{#sourceurl}} + {{__global.improveThisDoc}} + {{/sourceurl}} + + {{^sourceurl}} + {{#docurl}} + {{__global.improveThisDoc}} + {{/docurl}} + {{/sourceurl}} +
+ {{/_disableContribution}} -
+ {{^_disableNextArticle}} + + {{/_disableNextArticle}} +
- {{^_disableAffix}} -
- -
- {{/_disableAffix}} + {{^_disableAffix}} +
+ +
+ {{/_disableAffix}}
{{#_enableSearch}} @@ -164,12 +480,276 @@ {{/_enableSearch}} - - {{/redirect_url}} + + + + + + + + + + + +{{/redirect_url}} \ No newline at end of file diff --git a/docs/template/api_wiki/partials/class.header.tmpl.partial b/docs/template/api_wiki/partials/class.header.tmpl.partial index be8f4aeda..1405c1ff5 100644 --- a/docs/template/api_wiki/partials/class.header.tmpl.partial +++ b/docs/template/api_wiki/partials/class.header.tmpl.partial @@ -6,16 +6,38 @@
-
{{__global.namespace}}
{{{namespace.specName.0.value}}}
- {{#assemblies.0}}
{{__global.assembly}}
{{assemblies.0}}.dll
{{/assemblies.0}} +
+
{{__global.namespace}}
+
{{{namespace.specName.0.value}}}
+
+ {{#assemblies.0}} +
+
{{__global.assembly}}
+
{{assemblies.0}}.dll
+
+ {{/assemblies.0}}
-
{{{summary}}}
-
{{{conceptual}}}
+{{#summary}} +
+

Summary

+

The following is a brief description of what this type does, and what it is meant for:

+ {{{summary}}} +
+{{/summary}} + +{{#conceptual}} +
+

Conceptual

+

The following is some brief conceptual information on how this type should be used:

+ {{{conceptual}}} +
+{{/conceptual}} {{#inClass}}
-
{{__global.inheritance}}
+

Inheritance

+

The following is the full inheritance tree for this type:

{{#inheritance}} @@ -39,7 +61,8 @@ {{#implements.0}}
-
{{__global.implements}}
+

Implements

+

The following are all of the interfaces implemented by this type:

{{/implements.0}} {{#implements}} @@ -53,9 +76,10 @@ {{/implements.0}} {{#syntax.content.0.value}} -
- {{__global.syntax}} -
+

+ Syntax +

+

The following codeblock is the declaration syntax of this type found in the code:

{{syntax.content.0.value}}
@@ -63,9 +87,10 @@ {{/syntax.content.0.value}} {{#syntax.parameters.0}} -
- {{__global.parameters}} -
+

+ Parameters +

+

The following table is a full list of parameters used by this type, in the form of type, name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -98,9 +123,10 @@ {{/syntax.parameters.0}} {{#syntax.return}} -
- {{__global.returns}} -
+

+ Returns +

+

The following table is a full list of returns used by this type, in the form of type, name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -120,9 +146,11 @@ {{/syntax.return}} {{#syntax.typeParameters.0}} -
- {{__global.typeParameters}} -
+

+ Type Parameters +

+ +

The following table is a full list of Type Parameters used by this type, in the form of type, name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -150,48 +178,59 @@ {{/syntax.typeParameters.0}} {{#inheritedMembers.0}} -
-
{{__global.inheritedMembers}}
-
+
+ +

Inherited Members (Click me to Expand)

+
+

The following are inherited members derived from this type's inheritence:

+
{{/inheritedMembers.0}} + {{#inheritedMembers}} -
- {{#definition}} - - {{/definition}} - {{^definition}} - - {{/definition}} -
+
+ {{#definition}} + + {{/definition}} + {{^definition}} + + {{/definition}} +
{{/inheritedMembers}} + {{#inheritedMembers.0}} -
-
+ + {{/inheritedMembers.0}} {{#extensionMethods.0}} -
-
{{__global.extensionMethods}}
-
+
+ +

Extension Methods (Click me to Expand)

+
+

The following are methods in which you can use that act as extensions to this type:

+
{{/extensionMethods.0}} + {{#extensionMethods}} -
- {{#definition}} - - {{/definition}} - {{^definition}} - - {{/definition}} -
+
+ {{#definition}} + + {{/definition}} + {{^definition}} + + {{/definition}} +
{{/extensionMethods}} + {{#extensionMethods.0}} -
-
+ + {{/extensionMethods.0}} {{#isEnum}} {{#children}}

{{>partials/classSubtitle}}

+

The following table is a full list of enumerations used by this type, in the form of name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -220,13 +259,32 @@ {{/isEnum}} {{#example.0}} -

{{__global.examples}}

+

Examples

+

The following is an example of how you can use this type:

{{/example.0}} {{#example}} {{{.}}} {{/example}} {{#remarks}} -

{{__global.remarks}}

+

Remarks

+

The following is additional information related to this type:

{{{remarks}}}
-{{/remarks}} \ No newline at end of file +{{/remarks}} + +{{#seealso.0}} +

See Also

+
+

References related types, members, and external resources that provide additional information.

+{{/seealso.0}} +{{#seealso}} + {{#isCref}} +
{{{type.specName.0.value}}}
+ {{/isCref}} + {{^isCref}} +
{{{url}}}
+ {{/isCref}} +{{/seealso}} +{{#seealso.0}} +
+{{/seealso.0}} \ No newline at end of file diff --git a/docs/template/api_wiki/partials/class.tmpl.partial b/docs/template/api_wiki/partials/class.tmpl.partial index 723686d83..dbf8b9e5f 100644 --- a/docs/template/api_wiki/partials/class.tmpl.partial +++ b/docs/template/api_wiki/partials/class.tmpl.partial @@ -19,16 +19,36 @@ {{#sourceurl}}{{/sourceurl}} -
{{{summary}}}
-
{{{conceptual}}}
+{{#summary}} +
+

Summary

+

The following is a brief description of what this member does, and what it is meant for:

+ {{{summary}}} +
+{{/summary}} + +{{#conceptual}} +
+

Conceptual

+

The following is some brief conceptual information on how this member should be used:

+ {{{conceptual}}} +
+{{/conceptual}} {{#syntax}} +

+ Syntax +

+

The following codeblock is the declaration syntax of this member found in the code:

+
{{syntax.content.0.value}}
+{{/syntax}} {{#syntax.parameters.0}} -

{{__global.parameters}}

+

Parameters

+

The following table is a full list of parameters used by this member, in the form of type, name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -61,7 +81,8 @@ {{/syntax.parameters.0}} {{#syntax.return}} -

{{__global.returns}}

+

Returns

+

The following table is a full list of returns used by this member, in the form of type, name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -81,7 +102,8 @@ {{/syntax.return}} {{#syntax.typeParameters.0}} -

{{__global.typeParameters}}

+

Type Parameters

+

The following table is a full list of Type Parameters used by this member, in the form of type, name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -108,10 +130,12 @@
{{/syntax.typeParameters.0}} +{{#inEnum}} {{#fieldValue}} -

{{__global.fieldValue}}

+

Field Value

+

The following table is a full list of enumerations used by this member, in the form of name | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

- +
@@ -127,63 +151,53 @@
{{__global.type}}
{{/fieldValue}} +{{/inEnum}} {{#propertyValue}} -

{{__global.returns}}

- - - - - - - - - - - - - - - -
{{__global.type}}{{__global.description}}
{{{type.specName.0.value}}}{{{description}}}
+

Property Value

+

The following is the type associated with this member:

+ +
+
+ {{{type.specName.0.value}}} +
+
+ {{{description}}} +
+
{{/propertyValue}} {{#eventType}} -

{{__global.eventType}}

- - - - - - - - - - - - - - - -
{{__global.type}}{{__global.description}}
{{{type.specName.0.value}}}{{{description}}}
+

Event Type

+

The following is the event type associated with this member:

+ +
+
+ {{{type.specName.0.value}}} +
+
+ {{{description}}} +
+
{{/eventType}} -{{/syntax}} - {{#example.0}} -

{{__global.examples}}

+

Examples

+

The following is an example of how you can use this member:

{{/example.0}} {{#example}} {{{.}}} {{/example}} {{#remarks}} -

{{__global.remarks}}

+

Remarks

+

The following is additional information related to this member:

{{{remarks}}}
{{/remarks}} {{#exceptions.0}} -

{{__global.exceptions}}

+

Exceptions

+

The following table is a full list of Exceptions used by this member, in the form of type | description for your ease of convenience, if you don't know what a given type is, you can click it and it will link to its definition at the associated documentation. The table is below:

@@ -210,8 +224,9 @@ {{#seealso.0}}
-
{{__global.seealso}}
+
See Also
+

References in which have additional information related to how you can use this member, or functions and utilities that use this member:

{{/seealso.0}} {{#seealso}} {{#isCref}} @@ -227,20 +242,4 @@ {{/seealso.0}} {{/children}} -{{/children}} - -{{#seealso.0}} -

{{__global.seealso}}

-
-{{/seealso.0}} -{{#seealso}} - {{#isCref}} -
{{{type.specName.0.value}}}
- {{/isCref}} - {{^isCref}} -
{{{url}}}
- {{/isCref}} -{{/seealso}} -{{#seealso.0}} -
-{{/seealso.0}} \ No newline at end of file +{{/children}} \ No newline at end of file diff --git a/docs/template/api_wiki/public/main.css b/docs/template/api_wiki/public/main.css index b31e1abbd..023126588 100644 --- a/docs/template/api_wiki/public/main.css +++ b/docs/template/api_wiki/public/main.css @@ -6,10 +6,110 @@ } :root { - --bs-font-sans-serif: 'DPComic', system-ui, -apple-system, sans-serif; - --bs-body-font-family: var(--bs-font-sans-serif); - --bs-font-monospace: 'DPComic', system-ui, -apple-system, sans-serif; --page-gutter: clamp(1rem, 4vw, 5rem); + + --document-font: 'DPComic', system-ui, sans-serif; + --code-font: 'DPComic', system-ui, sans-serif; + + --bs-font-sans-serif: var(--document-font); + --bs-body-font-family: var(--document-font); + --bs-font-monospace: var(--code-font); + + --document-font-size: 20px; + --code-font-size: 18px; + + --document-line-height: 1.5; + --code-line-height: 1.4; + + --h1-font-size: 3.25em; + --h2-font-size: 2.25em; + --h3-font-size: 1.70em; + --h4-font-size: 1.50em; + --h5-font-size: 1.20em; + --h6-font-size: 1.00em; + --heading-line-height: 1.2; +} + +html[data-document-font="dpcomic"] { + --document-font: 'DPComic', system-ui, sans-serif; +} + +html[data-document-font="comic-sans"] { + --document-font: 'Comic Sans MS', 'Comic Sans', cursive; +} + +html[data-document-font="sans-serif"] { + --document-font: sans-serif; +} + +html[data-document-font="monospace"] { + --document-font: monospace; +} + +html[data-document-font="system"] { + --document-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; +} + +html[data-code-font="dpcomic"] { + --code-font: 'DPComic', system-ui, sans-serif; +} + +html[data-code-font="comic-sans"] { + --code-font: 'Comic Sans MS', 'Comic Sans', cursive; +} + +html[data-code-font="sans-serif"] { + --code-font: sans-serif; +} + +html[data-code-font="monospace"] { + --code-font: monospace; +} + +html[data-code-font="system"] { + --code-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; +} + +body { + font-family: var(--document-font); +} + +.font-settings-menu { + display: flex; + align-items: center; +} + +.font-settings-menu > button { + font-size: 1.25rem; + padding: 0.5rem 0.75rem; +} + +.font-settings-menu .dropdown-menu { + min-width: 18rem; +} + +.font-settings-menu .dropdown-header { + padding-left: 0; + font-size: 1.5rem; +} + +.font-settings-menu .form-label { + margin-bottom: 0.35rem; + font-size: 1.25rem; +} + +.font-settings-menu input, +.font-settings-menu select { + width: 100%; +} + +.font-settings-menu [hidden] { + display: none !important; +} + +#reset-settings { + font-size: 1.25rem; + font-weight: normal; } * { @@ -20,10 +120,6 @@ b, strong { font-weight: normal; } -code { - font-size: 18px !important; -} - :not(pre) > code { background-color: var(--bs-tertiary-bg, #e9ecef); padding: 0.15em 0.35em; @@ -58,20 +154,165 @@ body > footer, body[data-layout="landing"] > footer { --bs-navbar-brand-font-size: 1.5rem; } +.navbar-toggle-label { + font-size: 0.9rem; + white-space: nowrap; +} + +#navbar { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.5rem; +} + +#navbar .search { + flex: 1 1 12rem; + min-width: 0; +} + +#navbar .navbar-nav { + flex: 0 0 auto; +} + +#navbar form.icons { + display: flex; + align-items: center; + flex: 0 0 auto; + gap: 0.25rem; + margin: 0; +} + +#navbar form.icons .dropdown { + display: flex; + align-items: center; +} + +#navbar .dropdown-menu { + max-height: calc(100dvh - 6rem); + overflow-y: auto; + overscroll-behavior: contain; +} + +@media (max-width: 767.98px) { + #navpanel, + #navbar { + overflow: visible; + } + + #navbar { + width: 100%; + align-items: stretch; + gap: 0.75rem; + padding: 0.75rem 0; + } + + #navbar .search { + flex: 1 1 100%; + width: 100%; + } + + #navbar form.icons { + display: flex; + flex-wrap: wrap; + align-items: center; + width: 100%; + gap: 0.25rem; + } + + #navbar form.icons > .dropdown { + display: flex; + flex-wrap: wrap; + align-items: center; + width: auto; + flex: 0 0 auto; + } + + #navbar form.icons > .dropdown > .dropdown-menu { + position: static !important; + transform: none !important; + inset: auto !important; + float: none; + width: 100%; + max-width: 100%; + min-width: 0; + margin: 0.5rem 0 0; + border-radius: var(--bs-border-radius); + } + + #navbar form.icons > .dropdown > .dropdown-menu.show { + display: block; + } +} + #logo { padding-right: 1.5rem; } -.content { - font-size: 20px !important; +.content, .facts { + font-size: var(--document-font-size) !important; + line-height: var(--document-line-height); +} + +.content h1, +.content .h1 { + font-size: var(--h1-font-size) !important; +} + +.content h2, +.content .h2 { + font-size: var(--h2-font-size) !important; +} + +.content h3, +.content .h3 { + font-size: var(--h3-font-size) !important; +} + +.content h4, +.content .h4 { + font-size: var(--h4-font-size) !important; +} + +.content h5, +.content .h5 { + font-size: var(--h5-font-size) !important; +} + +.content h6, +.content .h6 { + font-size: var(--h6-font-size) !important; +} + +.content h1, +.content .h1, +.content h2, +.content .h2, +.content h3, +.content .h3, +.content h4, +.content .h4, +.content h5, +.content .h5, +.content h6, +.content .h6 { + line-height: var(--heading-line-height); } .toc ul { - font-size: 20px !important; + font-size: var(--document-font-size) !important; + line-height: var(--document-line-height); } .affix { - font-size: 20px; + font-size: var(--document-font-size); + line-height: var(--document-line-height); +} + +code, kbd, samp, pre, .hljs, .facts code { + font-family: var(--code-font); + font-size: var(--code-font-size) !important; + line-height: var(--code-line-height); } body[data-yaml-mime="ManagedReference"] article h2.section, @@ -93,7 +334,7 @@ body[data-yaml-mime="ApiPage"] article h2.section { } .inheritance-level { - line-height: 1.4; + line-height: var(--document-line-height); padding-left: calc(var(--inheritance-level, 0) * 1.25rem); } @@ -118,7 +359,9 @@ body[data-yaml-mime="ApiPage"] article h2.section { html.api-documentation h1, html.api-documentation .h1, html.community-documentation h1, -html.community-documentation .h1 { +html.community-documentation .h1, +html.apispec-documentation h1, +html.apispec-documentation .h1 { border-bottom: 1px solid currentColor; padding-bottom: 0.35rem; } @@ -126,7 +369,9 @@ html.community-documentation .h1 { html.api-documentation h3, html.api-documentation .h3, html.community-documentation h3, -html.community-documentation .h3 { +html.community-documentation .h3, +html.apispec-documentation h3, +html.apispec-documentation .h3 { border-bottom: 1px solid currentColor; padding-bottom: 0.35rem; } @@ -134,4 +379,26 @@ html.community-documentation .h3 { a.active { font-style: italic; text-decoration: underline; +} + +.typelist details { + margin-bottom: 1rem; +} + +.typelist summary { + cursor: pointer; + padding: 0.5rem 0; + user-select: none; +} + +.typelist summary:hover { + text-decoration: underline; +} + +.typelist-content { + padding: 0.5rem 0 0.5rem 1.25rem; +} + +.typelist-content > div { + padding: 0.2rem 0; } \ No newline at end of file diff --git a/docs/template/api_wiki/public/main.js b/docs/template/api_wiki/public/main.js index 688fe3efb..2561fe374 100644 --- a/docs/template/api_wiki/public/main.js +++ b/docs/template/api_wiki/public/main.js @@ -4,14 +4,18 @@ export default { const docUrl = document.querySelector('meta[name="docfx:docurl"]')?.content || ''; -if (docUrl.includes('/docs/api/')) { +if (docUrl.includes('/api/')) { document.documentElement.classList.add('api-documentation'); } -if (docUrl.includes('/docs/community/')) { +if (docUrl.includes('/community/')) { document.documentElement.classList.add('community-documentation'); } -if (docUrl.includes('/docs/wiki/')) { +if (docUrl.includes('/wiki/')) { document.documentElement.classList.add('wiki-documentation'); +} + +if (docUrl.includes('/apiSpec/')) { + document.documentElement.classList.add('apispec-documentation'); } \ No newline at end of file