-
Install nodejs LTS
-
Install latest version of npm
$> npm install npm@latest -g
-
Install [gulp] by running
$> npm install gulp -g
Author or update the document within the portal-sdk/templates or gallery-sdk/templates folder using markdown.
Add the document under the path /[portal-sdk|gallery-sdk]/templates/*.md
The /templates
folder for a given SDK contains the articles formatted as markdown files and .md extension and makes use of gitdown for document composition, code snippet injection, and table of contents generation.
-
template filenames: By default all documents are to be prefixed with the service name (such as portalfx, portalfx-ux, gallery, resource-provider). Use all lowercase letters and dashes (-) to separate the words. If the document is referenced in the root level
/README.md
then it should be prefixed withtop-
and needs approval by aliasesadamab;skhu
. -
Media subfolders: media is to be added to the relevant
/[portal-sdk|gallery-sdk]/media
folder. Within the media folder content is organized into subfolders by document name.
Note: /[portal-sdk|gallery-sdk]/generated
The /generated folder is auto-generated, do not contribute any additional content here, it will be lost and is also ignored via .gitignore, instead use the \templates folder.
To ensure all code samples remain up to date and compile successfully when used by partners use them i've extended gitdown syntax to support code fragment injection.
To reference source code in your document directly from a *.ts, *.cs, *.pdl or *.config file use the include-section extension.
For example,
<!-- gitdown: off -->
```
//injects the code snippet in between two comments `//config#configurationsettings` from `../Samples/SamplesExtension/Extension/Configuration/ArmConfiguration.cs` directly inline
{"gitdown": "include-section", "file": "../../../src/SDK/Extensions/SamplesExtension/Extension/Configuration/ArmConfiguration.cs", "section": "config#configurationsettings"}
```
<!-- gitdown: on -->
Occasionally you will want to include the whole contents of a file into a document rather then just a fragment. Two common scenarios:
- including a full sourcefile within a markdown document
- to improve maintainability where text needs to appear in multiple documents you can composing a markdown document from other markdown documents.
Using gitdown include-file for document composition you can inject the full content of a sourcefile or other markdown document using gitdown syntax.
<!-- gitdown: off -->
```
//inject the entire portalfx-howitworks.md inline where you use the following gitdown include
{"gitdown": "include-file", "file": "../templates/portalfx-howitworks.md"}
```
<!-- gitdown: on -->
To generate documents as they would appear on github.com/azure/portaldocs:
$> cd AzureUx-PortalFx\docs
$> npm install --no-optional
$> npm run docs
Note: If you have added new links that internal, require auth or dummy then you can exclude checks for them by including them in urlsToSkip array in ./gulpcommon.js.
To generate github content for gallery:
$> cd AzureUx-PortalFx\docs
$> npm install --no-optional
$> npm run gallery
Preview the generated markdown in \generated\*.md using a tool like Visual Studio Code and its Markdown preview hotkey combo Ctl+K V
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.