docs: add no-auto-link instructions to docs style guide (#30980)
PR Close #30980
This commit is contained in:
parent
76584804c8
commit
352f9672c0
@ -295,8 +295,34 @@ Whatever the source, the doc viewer renders them as "code snippets", either indi
|
|||||||
### Code example
|
### Code example
|
||||||
|
|
||||||
You can display a simple, inline code snippet with the markdown backtick syntax.
|
You can display a simple, inline code snippet with the markdown backtick syntax.
|
||||||
We generally prefer to display a code snippet with the Angular documentation _code-example_ component
|
Use a single backtick on either side of a term when referring to code or the
|
||||||
represented by the `<code-example>` tag.
|
name of a file in a sentence.
|
||||||
|
The following are some examples:
|
||||||
|
|
||||||
|
* In the `app.component.ts`, add a `logger()` method.
|
||||||
|
* The `name` property is `Sally`.
|
||||||
|
* Add the component class name to the `declarations` array.
|
||||||
|
|
||||||
|
The markdown is as follows:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
|
||||||
|
* In the `app.component.ts`, add a `logger()` method.
|
||||||
|
* The <code class="no-auto-link">item</code> property is `true`.
|
||||||
|
* Add the component class name to the `declarations` array.
|
||||||
|
|
||||||
|
```
|
||||||
|
In certain cases, when you apply backticks around a term, it may auto-link to
|
||||||
|
the API documentation. If you do not intend the term to be a link, use the following
|
||||||
|
syntax:
|
||||||
|
|
||||||
|
```html
|
||||||
|
The <code class="no-auto-link">item</code> property is `true`.
|
||||||
|
```
|
||||||
|
|
||||||
|
For block code snippets, we generally prefer to display code with
|
||||||
|
the Angular documentation _code-example_ component represented by the `<code-example>` tag.
|
||||||
|
See [Code snippets and code examples](guide/docs-style-guide#code-snippets-and-code-samples) for more details.
|
||||||
|
|
||||||
<h3 class="no-toc">Inline code-snippets</h3>
|
<h3 class="no-toc">Inline code-snippets</h3>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user