![]() In a code file in a different repositoryįollowing are guidelines that apply to all three types of code blocks:Īll of the methods listed in the preceding section result in usable code blocks:.The syntax for including code in a doc depends on where the code is located: All-caps may conflict with named constants in many languages, though it may also draw attention to the placeholder name. Kebab case may generate syntax errors and underscores may conflict with underlining. Placeholder names can be separated by hyphens ("kebab case"), with underscores, or not separated at all (Pascal case). They may be confused with the same notation used in replaceable text, format strings, string interpolation, text templates, and similar programming constructs. The Microsoft Writing Style Guide calls for italics, which you may format within angle bracketed inline code:Ĭurly braces are discouraged for use as syntactical placeholders. You may note that the brackets must be removed when substituting real values. If you want the user to replace a section of displayed code with their own values, use placeholder If you use a link and refer to the same element later in the same context, make the subsequent instances code format rather than links. ![]() Styling a link as code can obscure the fact that the text is a link. If you use a link, don't apply code format to the link text. LinksĪ link to reference documentation may be more helpful than code format in some contexts. If you choose to use bold style, use non-localized strings syntax to make sure that code is not localized. Might look too busy with code styling everywhere. For example, a Markdown table with mostly code elements Some older style guides specify bold for inline code. ![]() If you want to prevent localization without using code style, see Non-localized strings. When an article is localized (translated into other languages), text styled as code is left Markdownīy default, the Entity Framework interprets a property that's named `Id` or `ClassnameID` as the primary key.īy default, the Entity Framework interprets a property that's named Id or ClassnameID as the primary key. Inline code style shouldn't use the triple-backtick format. To include a code element in article text, surround it with backticks (`) to indicate code style. When in doubt, see Text formatting guidelines. For example, NuGet package names should be treated asĬode. Not always obvious what qualifies as code. Code elementsĪ "code element" is a programming language keyword, class name, property name, and so forth. :::code source="PowerShell.ps1" interactive="cloudshell-powershell":::įor more information, see Interactive code snippets later in this article.īesides explaining the Markdown for each of these ways to include code, the article provides some :::code language="csharp" source="~/samples-durable-functions/samples/csx/shared/Location.csx" highlight="2,5":::įor more information, see Out-of-repo snippet references later in this article.Ĭode blocks that let the user execute code in the browser. :::code language="csharp" source="intro/samples/cu/Controllers/StudentsController.cs" range="2-24,26":::įor more information, see In-repo snippet references later in this article.Ĭode blocks by reference to a code file in another repository. For more information, see Code blocks later in this article.Ĭode blocks by reference to a code file in the local repository. ![]() Use inline code blocks when it's impractical to display code by reference to a code file. For more information, see Code elements later in this article.Ĭode blocks in the article Markdown file. Code format may also be used for properties, methods, classes, and language keywords. Use code format when referring to named parameters and variables in a nearby code block in your text. Individual elements (words) within a line. There are several ways to include code in an article published on :
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |