-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Added optional snippets and badges #31 #30 #42 * Remove quick start config * Get option from root path * Doc improvements based on feedback @vicperdana
- Loading branch information
1 parent
ba8548b
commit 54dc4e4
Showing
13 changed files
with
668 additions
and
16 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
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,91 @@ | ||
# PSDocs_Azure_Badges | ||
|
||
## about_PSDocs_Azure_Badges | ||
|
||
## SHORT DESCRIPTION | ||
|
||
Describes how to insert template badges in to documentation. | ||
|
||
## LONG DESCRIPTION | ||
|
||
PSDocs allows external files to be included in Azure template documentation. | ||
Commonly this concept is used to include images that represent the validation status of the template. | ||
These images, are commonly referred to as _badges_. | ||
PSDocs can include badges that have been generated by an external validation tool. | ||
|
||
To include badge markdown: | ||
|
||
- Create a sub-directory called `.ps-docs` in the working path of PSDocs. | ||
This would normally be root directory (`$PWD`) of the repository where your Azure template are stored. | ||
- Create a file named `azure-template-badges.md` within the `.ps-docs` sub-directory. | ||
- When creating all files and folder use lower case names. | ||
|
||
The contents of this file is automatically inserted in generated output after the title but before description. | ||
|
||
### Include badges | ||
|
||
To include badge images use standard markdown syntax within the `azure-template-badges.md` file. | ||
|
||
> Markdown uses links to reference images. | ||
> A person viewing the page must have permissions to view the source image. | ||
> If not, the badge may be shown as a broken or placeholder image. | ||
For example: | ||
|
||
```markdown | ||
![label](https://image_uri) | ||
``` | ||
|
||
For example, a Github Actions badge for PSDocs.Azure would be: | ||
|
||
```markdown | ||
![Analyze](https://github.com/Azure/PSDocs.Azure/workflows/Analyze/badge.svg) | ||
``` | ||
|
||
To include badges images with a clickable link use standard markdown syntax: | ||
|
||
```markdown | ||
[![label](https://image_uri)](https://link_uri) | ||
``` | ||
|
||
For example, an Azure Pipelines badge for PSDocs.Azure would be: | ||
|
||
```markdown | ||
[![Build Status](https://dev.azure.com/PSDocs/PSDocs.Azure/_apis/build/status/PSDocs.Azure-CI?branchName=refs%2Fpull%2F44%2Fmerge)](https://dev.azure.com/PSDocs/PSDocs.Azure/_build/latest?definitionId=1&branchName=refs%2Fpull%2F44%2Fmerge) | ||
``` | ||
|
||
### Dynamic links | ||
|
||
In additional to inserting static content, some replacement tokens have been defined. | ||
When specified within `azure-template-badges.md` each token will be replaced when the file is included. | ||
The following replacement tokens have been defined: | ||
|
||
- `{{ template_path }}` - The relative path of the template directory. | ||
- `{{ template_path_encoded }}` - The relative path of the template directory URL encoded. | ||
|
||
For example, if the template path was `.\templates\storage\v1\template.json` the following would be used: | ||
|
||
- `{{ template_path }}` = `templates/storage/v1` | ||
- `{{ template_path_encoded }}` = `templates%2fstorage%2fv1` | ||
|
||
The follow example shows source markdown for including badges: | ||
|
||
```markdown | ||
![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/{{ template_path }}/BestPracticeResult.svg) | ||
[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F{{ template_path_encoded }}%2Fazuredeploy.json) | ||
``` | ||
|
||
After replacement the following would be the resulting output included in the template document: | ||
|
||
```markdown | ||
![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/templates/storage/v1/BestPracticeResult.svg) | ||
[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Ftemplates%2fstorage%2fv1%2Fazuredeploy.json) | ||
``` | ||
|
||
## NOTE | ||
|
||
An online version of this document is available at https://github.com/Azure/PSDocs.Azure/blob/main/docs/concepts/en-US/about_PSDocs_Azure_Badges.md. | ||
|
||
## KEYWORDS | ||
|
||
- Badge |
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,61 @@ | ||
# PSDocs_Azure_Configuration | ||
|
||
## about_PSDocs_Azure_Configuration | ||
|
||
## SHORT DESCRIPTION | ||
|
||
Describes PSDocs configuration options specific to `PSDocs.Azure`. | ||
|
||
## LONG DESCRIPTION | ||
|
||
PSDocs exposes configuration options that can be used to customize execution of document generation. | ||
This topic describes what configuration options are available. | ||
|
||
PSDocs configuration options can be specified by setting the configuration option in `ps-docs.yaml`. | ||
Additionally, configuration options can be configured in a baseline or set at runtime. | ||
For details of setting configuration options see [PSDocs options][options] | ||
|
||
The following configurations options are available for use: | ||
|
||
- [AZURE_USE_PARAMETER_FILE_SNIPPET](#azure_use_parameter_file_snippet) | ||
|
||
### AZURE_USE_PARAMETER_FILE_SNIPPET | ||
|
||
This configuration option determines if a parameter file snippet is added to documentation. | ||
By default, a snippet is generated. | ||
To prevent a parameter file snippet being generated, set this option to `false`. | ||
|
||
Syntax: | ||
|
||
```yaml | ||
configuration: | ||
AZURE_USE_PARAMETER_FILE_SNIPPET: bool # Either true or false | ||
``` | ||
Default: | ||
```yaml | ||
# YAML: The default AZURE_USE_PARAMETER_FILE_SNIPPET configuration option | ||
configuration: | ||
AZURE_USE_PARAMETER_FILE_SNIPPET: true | ||
``` | ||
Example: | ||
```yaml | ||
# YAML: Prevent parameter file snippet from being generated | ||
configuration: | ||
AZURE_USE_PARAMETER_FILE_SNIPPET: false | ||
``` | ||
## NOTE | ||
An online version of this document is available at https://github.com/Azure/PSDocs.Azure/blob/main/docs/concepts/en-US/about_PSDocs_Azure_Configuration.md. | ||
## KEYWORDS | ||
- Configuration | ||
- Document | ||
- Snippet | ||
[options]: https://github.com/BernieWhite/PSDocs/blob/main/docs/concepts/PSDocs/en-US/about_PSDocs_Configuration.md |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ | |
Type = 'Type' | ||
Name = 'Name' | ||
DefaultTitle = 'Azure template' | ||
ParameterFile = 'Parameter file' | ||
} |
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
12 changes: 12 additions & 0 deletions
12
tests/PSDocs.Azure.Tests/.ps-docs/azure-template-badges.md
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,12 @@ | ||
![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/{{ template_path }}/PublicLastTestDate.svg) | ||
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/{{ template_path }}/PublicDeployment.svg) | ||
|
||
![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/{{ template_path }}/FairfaxLastTestDate.svg) | ||
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/{{ template_path }}/FairfaxDeployment.svg) | ||
|
||
![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/{{ template_path }}/BestPracticeResult.svg) | ||
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/{{ template_path }}/CredScanResult.svg) | ||
|
||
[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F{{ template_path_encoded }}%2Fazuredeploy.json) | ||
[![Deploy To Azure Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F{{ template_path_encoded }}%2Fazuredeploy.json) | ||
[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F{{ template_path_encoded }}%2Fazuredeploy.json) |
Oops, something went wrong.