Skip to content

Adding more info to Contributor Guide #2023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 84 additions & 9 deletions contributing/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,94 @@ to get this output:

## Links

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

## Using relative links
### Structure of links on docs.microsoft.com

Content presented on docs.microsoft.com has the following URL structure:

```
https://docs.microsoft.com/<locale>/<product-service>/[<feature-service>]/[<subfolder>]/<topic>[?view=<view-name>]
```

Examples:

```
https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-overview
https://docs.microsoft.com/en-us/powershell/azure/overview?view=azurermps-5.1.1
```

- **\<locale>** - identifies the language of the article (example: en-us or de-de)
- **\<product-service>** - the name of the product or service being documented (example: powerShell, dotnet, or azure)
- **[\<feature-service>]** - (optional) the name of the product's feature or subservice (for example, csharp or load-balancer)
- **[\<subfolder>]** - (optional) the name of a subfolder within a feature
- \<topic> - the name of the article file for the topic (example: load-balancer-overview or overview)
- **[?view=\<view-name>]** - (optional) the view name used by the version selector for content that has multiple versions available (example: azurermps-5.1.1)

### Linking to content in the same repo

You should use relative links when linking to other content that is hosted on **docs.microsoft.com**.
When the content is in the same repo, the relative links are simple to calculate.
Note that the path to cmdlet reference is created by our publishing system.
There are special rules for linking to reference topics from conceptual topics.
The link target must be the path to the _Markdown file_ in the repo.
For example, the following markdown links to the about_Arrays topic in this repo.

```Markdown
[about_Arrays](../reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md)
```

Here is the live link:

[about_Arrays](../reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md)

Note that the live link works within the GitHub view of this content.

### Linking to content in a different repo

When the content is in a different repo, the relative links are more complicated.
The link target must be the URL path to the _published article_ on **docs.microsoft.com**.
The relative link starts with the **\<product-service>** portion of the URL as described above.
You should omit the **[?view=\<view-name>]** portion unless you need to link to a specific version of the content.

For example, the following markdown links to the Overview topic for Azure PowerShell.

```Markdown
[Overview of Azure PowerShell](/powershell/azure/overview)
```

Here is the live link:

[Overview of Azure PowerShell](/powershell/azure/overview)

Note that the live link does not resolve within the GitHub view of this content.
This link only works on the webpage published to **docs.microsoft.com**.

## Markdown extensions supported by Open Publishing
The following sections describe supported extensions in Open Publishing.

### Note, warning, tip, important
Use specific syntax inside a block quote to indicate that the content is a type of note.

```Markdown
> [!NOTE]
> This is a note.

> [!WARNING]
> This is a warning.

> [!TIP]
> This is a tip.

> [!IMPORTANT]
> This is important.

```

And it will be rendered like this:

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

## Next steps

Expand All @@ -137,4 +212,4 @@ See [Formatting code blocks](FORMATTING-CODE.md).
[links]: https://help.github.com/articles/relative-links-in-readmes/
[gfm-spec]: https://github.github.com/gfm/
[semantics]: http://rhodesmill.org/brandon/2012/one-sentence-per-line/
[platyPS]: https://github.com/PowerShell/platyPS
[platyPS]: https://github.com/PowerShell/platyPS
16 changes: 12 additions & 4 deletions contributing/WRITING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Writing PowerShell documentation

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

## Markdown editors

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

## Using GitHub Flavored Markdown
## Get started using Markdown

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

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

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

## Creating new topics

If you want to contribute new documentation, first check for [issues tagged as "in progress"][labels]
Expand Down Expand Up @@ -53,4 +60,5 @@ Read the [Style Guide](STYLE.md).
[gfm-help]: https://help.github.com/categories/writing-on-github/
[gfm-spec]: https://github.github.com/gfm/
[labels]: https://github.com/PowerShell/PowerShell-Docs/labels/in%20progress
[gfm-task]: https://github.github.com/gfm/#task-list-items-extension-
[gfm-task]: https://github.github.com/gfm/#task-list-items-extension-
[dfm-diffs]: http://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html#differences-between-dfm-and-gfm
Binary file added contributing/images/alert-boxes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.