Skip to content

Commit

Permalink
Add schema templates to documentations (dotnet#2461)
Browse files Browse the repository at this point in the history
* Add schema templates to documentations

* change template name
  • Loading branch information
vicancy authored Feb 27, 2018
1 parent f5175e5 commit 1280fcb
Show file tree
Hide file tree
Showing 18 changed files with 207 additions and 133 deletions.
15 changes: 15 additions & 0 deletions Documentation/apispec/overwriteSdp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
uid: att1
title: 1
description: *content
---

This is invalid overwrite test

---
uid: apt1
title: 1
description: *content
---

This is invalid overwrite test
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
<a href="{{contributionLink}}" class="contribution-link">Add Your Own Template</a>
</span>
{{rawTitle}}
{{conceptual}}
{%- if templates -%}
{{description}}
{%- if items -%}
<ul id="template-container">
{%- for template in templates -%}
{%- for template in items -%}
<li class="template-item">
<div class="template-screenshot">
<img src= "{{template.thumbnail}}" class="template-screenshot-img"/>
Expand Down
File renamed without changes.
File renamed without changes.
45 changes: 45 additions & 0 deletions Documentation/custom_template/schemas/Dashboard.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"title": "Dashboard",
"$schema": "https://dotnet.github.io/docfx/schemas/v1.0/schema.json#",
"version": "1.0.0",
"description": "Schema for dashboard",
"id": "https://github.com/dotnet/docfx/schemas/Dashboard.schema.json",
"type": "object",
"properties": {
"uid": {
"type": "string",
"contentType": "uid"
},
"title": {
"type": "string",
"tags": [
"localizable"
]
},
"description": {
"type": "string",
"contentType": "markdown",
"tags": [
"localizable"
]
},
"items": {
"items": {
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"contentType": "markdown",
"tags": [
"localizable"
]
}
},
"type": "object"
},
"type": "array"
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion Documentation/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"markdownEngineName": "dfm-latest",
"template": [
"default",
"template"
"custom_template"
]
}
}
4 changes: 2 additions & 2 deletions Documentation/spec/docfx_document_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ An object to describe the schema of the value of the property.
| contentType | string | Defines the content type of the property. Refer to [contentType](#63-contenttype) for detailed explanation.
| tags | array | Defines the tags of the property. Refer to [tags](#64-tags) for detailed explanation.
| mergeType | string | Defines how to merge the property. Omitting this keyword has the same behavior as `merge`. Refer to [mergeType](#65-mergetype) for detailed explanation.
| xrefProperties | array | Defines the properties of current object when it is cross referenced by others. Each item is the name of the property in the instance. Refer to [xrefProperties](#66-xrefProperties) for detailed description of how to leverage this property.
| xrefProperties | array | Defines the properties of current object when it is cross referenced by others. Each item is the name of the property in the instance. Refer to [xrefProperties](#66-xrefproperties) for detailed description of how to leverage this property.

##### Patterned Field
| Field Name | Type | Description
Expand Down Expand Up @@ -151,7 +151,7 @@ To leverage this feature, a new `xref` syntax with `template` attribute is suppo
```
For the parital template, the input model is the object containing properties `xrefProperties` defines.

For example, in the sample schema defined by [7. Samples](7-samples), ` "xrefProperties": [ "title", "description" ],`, `title` and `description` are `xrefProperties` for uid `webapp`. A partial template to render this xref, for example, named `partials/overview.tmpl`, looks like:
For example, in the sample schema defined by [7. Samples](#7-samples), ` "xrefProperties": [ "title", "description" ],`, `title` and `description` are `xrefProperties` for uid `webapp`. A partial template to render this xref, for example, named `partials/overview.tmpl`, looks like:
```mustache
{{title}}: {{{description}}}
```
Expand Down
45 changes: 0 additions & 45 deletions Documentation/templates-and-plugins/plugins-dashboard.md

This file was deleted.

46 changes: 46 additions & 0 deletions Documentation/templates-and-plugins/plugins-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### YamlMime:Dashboard
---
uid: apt
title: 'Available plugins and templates'
documentType: dashboard
contributionLink: ~/templates-and-plugins/contribute-your-template.md
items:
- name: memberpage
description: It splits the *YAML* data model into member level. Currently it supports ManagedReference document type. With this template enabled, the class page contains lists of method overloads, fields, events and so on, while every method overload, field or event displays in a separated page.
type: Internal
thumbnail: ~/templates-and-plugins/images/memberpage.default.screenshot.png
homepage: https://www.nuget.org/packages/memberpage/
repository:
type: git
url: "https://github.com/dotnet/docfx/tree/master/plugins/Microsoft.DocAsCode.Build.MemberLevelManagedReference"
usage:
init: "nuget install memberpage -OutputDirectory <output>"
command: "-t default,<output>/memberpage.<version>/content"
config: 'template: ["statictoc", "<output>/memberpage.<version>/content"]'
- name: rest.tagpage
description: It splits the *REST* model into tag level model. With this plugin enabled, operations with the same tag are grouped into one page. If the operation is in multiple tags, it would be included in first tag level page.
type: Internal
thumbnail: ~/templates-and-plugins/images/rest.tagpage.default.screenshot.png
homepage: https://www.nuget.org/packages/rest.tagpage/
repository:
type: git
url: "https://github.com/dotnet/docfx/tree/master/plugins/Microsoft.DocAsCode.Build.TagLevelRestApi"
usage:
init: "nuget install rest.tagpage -OutputDirectory <output>"
command: "-t default,<output>/rest.tagpage.<version>/content"
config: 'template: ["default", "<output>/rest.tagpage.<version>/content"]'
- name: rest.operationpage
description: It splits the *REST* model into operation level model. If it's enabled together with `rest.tagpage`, the *REST* model will split to tag level first, then split to operation level.
type: Internal
thumbnail: ~/templates-and-plugins/images/rest.operationpage.default.screenshot.png
homepage: https://www.nuget.org/packages/rest.operationpage/
repository:
type: git
url: "https://github.com/dotnet/docfx/tree/master/plugins/Microsoft.DocAsCode.Build.OperationLevelRestApi"
usage:
init: "nuget install rest.operationpage -OutputDirectory <output>"
command: "-t default,<output>/rest.operationpage.<version>/content"
config: 'template: ["default", "<output>/rest.operationpage.<version>/content"]'
description: |
# Dashboard for Plugins
The plugins listed here mainly focus on the functionality of the generated website, it often contains a *plugins* folder containing assemblies for advanced processing of the data model. It usually also contains corresponding renderer files to further transform the processed data model to web pages. You can follow [How to Create Custom Document Processors](../tutorial/howto_build_your_own_type_of_documentation_with_custom_plug-in.md) and [How to Create Custom PostProcessor](../tutorial/howto_add_a_customized_post_processor.md) to create your own plugins. Add your own customized templates and plugins here for others to view and use!
6 changes: 6 additions & 0 deletions Documentation/templates-and-plugins/plugins-dashboard.yml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# `apt`
```yml
title: 1
```
## `description`
This is invalid markdown fragment test data
79 changes: 0 additions & 79 deletions Documentation/templates-and-plugins/templates-dashboard.md

This file was deleted.

80 changes: 80 additions & 0 deletions Documentation/templates-and-plugins/templates-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
### YamlMime:Dashboard
---
uid: att
title: Available templates and themes
documentType: dashboard
contributionLink: ~/templates-and-plugins/contribute-your-template.md
items:
- name: default
description: The default template
type: Embedded
thumbnail: ~/templates-and-plugins/images/default.screenshot.png
homepage: https://github.com/dotnet/docfx/tree/dev/src/docfx.website.themes/default
repository:
type: git
url: "https://github.com/dotnet/docfx/tree/dev/src/docfx.website.themes/default"
- name: statictoc
description: The template similar to default template however with static toc. With static toc, the generated web pages can be previewed from local file system.
type: Embedded
thumbnail: ~/templates-and-plugins/images/default.green.screenshot.png
homepage: https://github.com/dotnet/docfx/tree/dev/src/docfx.website.themes/statictoc
repository:
type: git
url: "https://github.com/dotnet/docfx/tree/dev/src/docfx.website.themes/statictoc"
usage:
command: "-t statictoc"
config: '"template": "statictoc"'
- name: mathew
description: A simple template
type: External
author: MathewSachin
version: 1.0.0
engines:
docfx: ">=2.17.4"
thumbnail: ~/templates-and-plugins/images/mathew.screenshot.png
homepage: https://github.com/MathewSachin/docfx-tmpl
repository:
type: git
url: "https://github.com/MathewSachin/docfx-tmpl.git"
license: MIT
usage:
init: "git clone https://github.com/MathewSachin/docfx-tmpl.git mathew"
command: "-t default,mathew/src"
config: '"template":["default","mathew/src"]'
- name: docfx-lightbox-plugin (Featherlight)
description: A template which adds a lightbox to each image, using the jquery plugin Featherlight.
type: External
author: roel4ez
version: 1.0.0
engines:
docfx: ">=2.20.0"
thumbnail: ~/templates-and-plugins/images/roel4ez-feather.screenshot.png
homepage: https://github.com/roel4ez/docfx-lightbox-plugin
repository:
type: git
url: "https://github.com/roel4ez/docfx-lightbox-plugin.git"
license: MIT
usage:
init: "git clone https://github.com/roel4ez/docfx-lightbox-plugin.git docfx-lightbox-plugin"
command: "-t default,docfx-lightbox-plugin/templates/lightbox-featherlight"
config: '"template":["default","docfx-lightbox-plugin/templates/lightbox-featherlight"]'
- name: docfx-lightbox-plugin (Bootstrap Modal)
description: A template which adds a lightbox to each image, using the Modal window from Bootstrap.
type: External
author: roel4ez
version: 1.0.0
engines:
docfx: ">=2.20.0"
thumbnail: ~/templates-and-plugins/images/roel4ez-modal.screenshot.png
homepage: https://github.com/roel4ez/docfx-lightbox-plugin
repository:
type: git
url: "https://github.com/roel4ez/docfx-lightbox-plugin.git"
license: MIT
usage:
init: "git clone https://github.com/roel4ez/docfx-lightbox-plugin.git docfx-lightbox-plugin"
command: "-t default,docfx-lightbox-plugin/templates/bootstrap-modal"
config: '"template":["default","docfx-lightbox-plugin/templates/bootstrap-modal"]'
description: |
# Dashboard for Templates
The templates listed here mainly focus on the layout and themes of the generated website. Add your own customized templates here for others to view and use!
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# `att`
```yml
title: 1
```
## `description`
This is invalid markdown fragment test data
4 changes: 2 additions & 2 deletions Documentation/templates-and-plugins/toc.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# [Templates](templates-dashboard.md)
# [Plugins](plugins-dashboard.md)
# [Templates](templates-dashboard.yml)
# [Plugins](plugins-dashboard.yml)
2 changes: 1 addition & 1 deletion Documentation/tutorial/intro_rest_api_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ By default, one *REST* API file generates one HTML file. For example, petstore.j
2. With `rest.operationpage` plugin enabled, each operation is splitted into single page.
3. With both `rest.tagpage` and `rest.operationpage` plugins enabled, the *REST* model will be splitted to tag level first, then split to operation level.

Refer [Plugins dashboard](../templates-and-plugins/plugins-dashboard.md) for more details.
Refer [Plugins dashboard](../templates-and-plugins/plugins-dashboard.yml) for more details.

0 comments on commit 1280fcb

Please sign in to comment.