Skip to content

Commit 38d2060

Browse files
author
Sean Wheeler
authored
Adding more info to Contributor Guide (#2023)
* adding notes about OPS extensions * added notes about OPS extensions and linking * fix typo * fix typo
1 parent d9aa756 commit 38d2060

File tree

3 files changed

+96
-13
lines changed

3 files changed

+96
-13
lines changed

contributing/STYLE.md

Lines changed: 84 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,94 @@ to get this output:
111111

112112
## Links
113113

114-
* Avoid using bare URLs. Links should use MarkDown syntax `[friendlyname](url)`
115-
* Links should have a a friendly name when applicable, most likely the title of the linked page
116-
* **Exception**: Links to non-Microsoft sites can be bare URLs
114+
* Avoid using bare URLs. Links should use MarkDown syntax `[friendlyname](url-or-path)`
115+
* **Exception**: Links to non-Microsoft sites can be bare URLs for transparency
116+
* Links must have a friendly name, usually the title of the linked topic
117117
* All items in the "related links" section at the bottom should be hyperlinked.
118+
* Use relative links when linking to other content that is hosted on **docs.microsoft.com**.
118119

119-
## Using relative links
120+
### Structure of links on docs.microsoft.com
121+
122+
Content presented on docs.microsoft.com has the following URL structure:
123+
124+
```
125+
https://docs.microsoft.com/<locale>/<product-service>/[<feature-service>]/[<subfolder>]/<topic>[?view=<view-name>]
126+
```
127+
128+
Examples:
129+
130+
```
131+
https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-overview
132+
https://docs.microsoft.com/en-us/powershell/azure/overview?view=azurermps-5.1.1
133+
```
134+
135+
- **\<locale>** - identifies the language of the article (example: en-us or de-de)
136+
- **\<product-service>** - the name of the product or service being documented (example: powerShell, dotnet, or azure)
137+
- **[\<feature-service>]** - (optional) the name of the product's feature or subservice (for example, csharp or load-balancer)
138+
- **[\<subfolder>]** - (optional) the name of a subfolder within a feature
139+
- \<topic> - the name of the article file for the topic (example: load-balancer-overview or overview)
140+
- **[?view=\<view-name>]** - (optional) the view name used by the version selector for content that has multiple versions available (example: azurermps-5.1.1)
141+
142+
### Linking to content in the same repo
120143

121-
You should use relative links when linking to other content that is hosted on **docs.microsoft.com**.
122144
When the content is in the same repo, the relative links are simple to calculate.
123-
Note that the path to cmdlet reference is created by our publishing system.
124-
There are special rules for linking to reference topics from conceptual topics.
145+
The link target must be the path to the _Markdown file_ in the repo.
146+
For example, the following markdown links to the about_Arrays topic in this repo.
147+
148+
```Markdown
149+
[about_Arrays](../reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md)
150+
```
151+
152+
Here is the live link:
153+
154+
[about_Arrays](../reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md)
155+
156+
Note that the live link works within the GitHub view of this content.
157+
158+
### Linking to content in a different repo
159+
160+
When the content is in a different repo, the relative links are more complicated.
161+
The link target must be the URL path to the _published article_ on **docs.microsoft.com**.
162+
The relative link starts with the **\<product-service>** portion of the URL as described above.
163+
You should omit the **[?view=\<view-name>]** portion unless you need to link to a specific version of the content.
164+
165+
For example, the following markdown links to the Overview topic for Azure PowerShell.
166+
167+
```Markdown
168+
[Overview of Azure PowerShell](/powershell/azure/overview)
169+
```
170+
171+
Here is the live link:
172+
173+
[Overview of Azure PowerShell](/powershell/azure/overview)
174+
175+
Note that the live link does not resolve within the GitHub view of this content.
176+
This link only works on the webpage published to **docs.microsoft.com**.
177+
178+
## Markdown extensions supported by Open Publishing
179+
The following sections describe supported extensions in Open Publishing.
180+
181+
### Note, warning, tip, important
182+
Use specific syntax inside a block quote to indicate that the content is a type of note.
183+
184+
```Markdown
185+
> [!NOTE]
186+
> This is a note.
187+
188+
> [!WARNING]
189+
> This is a warning.
190+
191+
> [!TIP]
192+
> This is a tip.
193+
194+
> [!IMPORTANT]
195+
> This is important.
196+
197+
```
198+
199+
And it will be rendered like this:
125200

126-
\[TO DO\] - document special rules
201+
![alert boxes](./images/alert-boxes.png)
127202

128203
## Next steps
129204

@@ -137,4 +212,4 @@ See [Formatting code blocks](FORMATTING-CODE.md).
137212
[links]: https://help.github.com/articles/relative-links-in-readmes/
138213
[gfm-spec]: https://github.github.com/gfm/
139214
[semantics]: http://rhodesmill.org/brandon/2012/one-sentence-per-line/
140-
[platyPS]: https://github.com/PowerShell/platyPS
215+
[platyPS]: https://github.com/PowerShell/platyPS

contributing/WRITING.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Writing PowerShell documentation
22

33
One of the easiest ways to contribute to PowerShell is by helping to write and edit documentation.
4-
All of our documentation hosted on GitHub is written using GitHub Flavored Markdown (GFM).
4+
All of our documentation hosted on GitHub is written using *Markdown*.
5+
Markdown is a lightweight markup language with plain text formatting syntax.
6+
Markdown forms the basis of our documentation's conceptual authoring language.
7+
Creating new articles is as easy as writing a simple text file by using your favorite text editor.
58

69
## Markdown editors
710

@@ -12,16 +15,20 @@ Here are some Markdown editors you can try out:
1215
* [Atom](https://atom.io/)
1316
* [Sublime Text](http://www.sublimetext.com/)
1417

15-
## Using GitHub Flavored Markdown
18+
## Get started using Markdown
1619

17-
To get started using GFM, see GitHub's Help topics for [Writing on GitHub][gfm-help].
20+
To get started using Markdown, see GitHub's Help topics for [Writing on GitHub][gfm-help].
1821

1922
**NOTE:** GitHub recently adopted the CommonMark specification (with GFM extensions) for its Markdown syntax.
2023
In the new specification, many spacing rules have changed.
2124
Spaces are significant in GFM.
2225
Do not use hard tabs in Markdown.
2326
For more detailed information about the Markdown specification, see the [GitHub Flavored Markdown Spec][gfm-spec].
2427

28+
DocFX, used by OPS, supports DocFX Flavored Markdown (DFM).
29+
DFM is highly compatible with GitHub Flavored Markdown (GFM) and adds some functionality, including cross-reference and file inclusion.
30+
There are [differences between DFM and GFM][dfm-diffs] that can affect content preview in GitHub or your editor.
31+
2532
## Creating new topics
2633

2734
If you want to contribute new documentation, first check for [issues tagged as "in progress"][labels]
@@ -53,4 +60,5 @@ Read the [Style Guide](STYLE.md).
5360
[gfm-help]: https://help.github.com/categories/writing-on-github/
5461
[gfm-spec]: https://github.github.com/gfm/
5562
[labels]: https://github.com/PowerShell/PowerShell-Docs/labels/in%20progress
56-
[gfm-task]: https://github.github.com/gfm/#task-list-items-extension-
63+
[gfm-task]: https://github.github.com/gfm/#task-list-items-extension-
64+
[dfm-diffs]: http://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html#differences-between-dfm-and-gfm

contributing/images/alert-boxes.png

10 KB
Loading

0 commit comments

Comments
 (0)