Skip to content

Commit 32bac1c

Browse files
[Style Guide] Move Asides, LastReviewed, Mermaid content (#26899)
* [Style Guide] Move `Asides` content * Added changes for LastReviewed * Apply suggestions from code review * Moved mermaid content * Apply suggestions from code review Co-authored-by: Pedro Sousa <[email protected]> * Addressing Pedro's feedback * Fixed link --------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent db705e4 commit 32bac1c

File tree

11 files changed

+121
-172
lines changed

11 files changed

+121
-172
lines changed

public/__redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,9 @@
13551355
/docs-guide/manage-content/redirects/process/ /style-guide/how-we-docs/redirects/ 301
13561356
/docs-guide/manage-content/metadata/ /style-guide/how-we-docs/metadata/ 301
13571357
/docs-guide/manage-content/metadata/process/ /style-guide/how-we-docs/metadata/ 301
1358+
/style-guide/components/asides/ /style-guide/formatting/notes-and-other-notation-types/ 301
1359+
/style-guide/components/last-reviewed/ /style-guide/frontmatter/custom-properties/#reviewed 301
1360+
/style-guide/components/mermaid/ /style-guide/documentation-content-strategy/component-attributes/diagrams/#mermaid-diagrams 301
13581361

13591362
# support
13601363
/support/about-cloudflare/getting-started/troubleshooting-faq-for-new-cloudflare-customers/ /fundamentals/reference/troubleshooting/ 301

src/content/docs/style-guide/components/asides.mdx

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/content/docs/style-guide/components/last-reviewed.mdx

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/content/docs/style-guide/components/mermaid.mdx

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/content/docs/style-guide/documentation-content-strategy/component-attributes/diagrams.mdx

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Diagrams
55

66
## Definition
77

8-
Images that depict a process, architecture, or some other form of technology. These should ideally be in an `SVG` format because of scalability issues.
8+
Visualizations that depict a process, architecture, or some other form of technology. We recommend either using [SVG files](#svg-diagrams) or [Mermaid diagrams](#mermaid-diagrams).
99

1010
## Used in
1111

@@ -15,27 +15,70 @@ All content types
1515

1616
Diagrams explain complex topics in a compelling way and help users visualize a specific solution, process, or interaction between products.
1717

18-
## Template
18+
## SVG diagrams
19+
20+
Use SVG files instead of PNG or JPEG because SVG scales well when users want to zoom in. Use clear and straightforward `Alt text` with your SVG for use by screen readers.
21+
22+
We optimize SVG files with a [recurring script](https://github.com/cloudflare/cloudflare-docs/blob/production/scripts/optimize-svgs.ts) in our repo.
23+
24+
### Template
1925

2026
```md
2127
![Alt text](/link/to/image.svg "Caption to go under the image")
2228
```
2329

24-
## Example
30+
### Example
31+
32+
![A simple flow diagram shows interactions between important elements of the design.](~/assets/images/firewall/simple-flow.png "An example flow diagram")
2533

34+
```md
2635
![A simple flow diagram shows interactions between important elements of the design.](~/assets/images/firewall/simple-flow.png "An example flow diagram")
36+
## Mermaid diagrams
2737

28-
## Additional information
38+
Use Mermaid diagrams to illustrate product or process flows. If they work for your use case, Mermaid diagrams are preferable to other [diagrams](/style-guide/documentation-content-strategy/component-attributes/diagrams/) because they are more easily searchable and changeable.
2939

30-
Always try to use SVG images for diagrams. Bitmap formats like PNG and JPEG do not scale well, and often users will zoom into diagrams to explore the details.
40+
Our Mermaid diagrams are based on [`rehype-mermaid`](https://github.com/remcohaszing/rehype-mermaid/) and [`mermaid`](https://www.npmjs.com/package/mermaid).
3141

32-
The alt (alternative) text on diagrams is used by screen readers and is read out as part of the surrounding content. Ensure the alt text is straightforward and fits in the context of the content.
42+
## Template
3343

34-
## Optimizations
44+
```mermaid
45+
flowchart LR
46+
accTitle: Tunnels diagram
47+
accDescr: The example in this diagram has three tunnel routes. Tunnels 1 and 2 have top priority and Tunnel 3 is secondary.
48+
49+
subgraph Cloudflare
50+
direction LR
51+
B[Cloudflare <br/> data center]
52+
C[Cloudflare <br/> data center]
53+
D[Cloudflare <br/> data center]
54+
end
55+
56+
A((User)) --> Cloudflare --- E[Anycast IP]
57+
E[Anycast IP] --> F[/Tunnel 1 / <br/> priority 1/] --> I{{Customer <br/> data center/ <br/> network 1}}
58+
E[Anycast IP] --> G[/Tunnel 2 / <br/> priority 1/] --> J{{Customer <br/> data center/ <br/> network 2}}
59+
E[Anycast IP] --> H[/Tunnel 3 / <br/> priority 2/] --> K{{Customer <br/> data center/ <br/> network 3}}
60+
```
3561

36-
When we use SVGs for diagrams, we can also optimize them via a [recurring script](https://github.com/cloudflare/cloudflare-docs/blob/production/scripts/optimize-svgs.ts) in our repo.
62+
````
63+
```mermaid
64+
flowchart LR
65+
accTitle: Tunnels diagram
66+
accDescr: The example in this diagram has three tunnel routes. Tunnels 1 and 2 have top priority and Tunnel 3 is secondary.
67+
68+
subgraph Cloudflare
69+
direction LR
70+
B[Cloudflare <br/> data center]
71+
C[Cloudflare <br/> data center]
72+
D[Cloudflare <br/> data center]
73+
end
74+
75+
A((User)) --> Cloudflare --- E[Anycast IP]
76+
E[Anycast IP] --> F[/Tunnel 1 / <br/> priority 1/] --> I{{Customer <br/> data center/ <br/> network 1}}
77+
E[Anycast IP] --> G[/Tunnel 2 / <br/> priority 1/] --> J{{Customer <br/> data center/ <br/> network 2}}
78+
E[Anycast IP] --> H[/Tunnel 3 / <br/> priority 2/] --> K{{Customer <br/> data center/ <br/> network 3}}
79+
```
80+
````
3781

3882
## Related components
3983

40-
- [Mermaid diagrams](/style-guide/components/mermaid/)
4184
- [Screenshots](/style-guide/documentation-content-strategy/component-attributes/screenshots/)

src/content/docs/style-guide/documentation-content-strategy/component-attributes/notes-tips-warnings.mdx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,25 @@ A colored info box or aside with content (text, images, lists, code blocks) that
2222

2323
## Templates
2424

25-
Refer to [Asides](/style-guide/components/asides/) to learn how to build Asides.
25+
To learn how to format notes, refer to [Notes and other notation types](/style-guide/formatting/notes-and-other-notation-types/).
2626

2727
## Rendered examples
2828

2929
:::note[Header text]
30-
This is a "note" aside.
31-
:::
32-
33-
:::caution[Header text]
34-
This is a "warning" aside.
30+
This is a note with a header.
3531
:::
3632

3733
:::note
38-
This is a `note` aside without a header.
34+
This is a note without a header.
3935
:::
4036

41-
## Additional information
42-
43-
The aside background color depends on the aside type:
44-
45-
* Aside with "note" type — blue
46-
* Aside with "warning" type — orange
47-
48-
An aside has an optional header displayed at the top (inside the colored box) in **bold**.
37+
:::caution
38+
This is a warning.
39+
:::
4940

50-
The aside can contain a single sentence or additional content (lists, code blocks, images).
41+
:::tip
42+
This is a tip.
43+
:::
5144

5245
## When should I use a note/warning?
5346

src/content/docs/style-guide/documentation-content-strategy/component-attributes/screenshots.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ We only recommend screenshots in [specific scenarios](#when-to-use), as they hav
99

1010
## When to use
1111

12-
Use screenshots sparingly and intentionally. For example, it's appropriate to use a screenshot when the task is simple but often confuses users or is hard to describe with words alone.
12+
Use screenshots sparingly and intentionally. For example, it's appropriate to use a screenshot when the task is simple but often confuses users or is hard to describe with words alone.
1313

1414
A canonical example of this would be [Find account and zone ID](/fundamentals/account/find-account-and-zone-ids/) because:
1515

@@ -59,4 +59,4 @@ For more details on how we approach this maintenance, refer to [Image maintenanc
5959
## Related components
6060

6161
- [Diagrams](/style-guide/documentation-content-strategy/component-attributes/diagrams/)
62-
- [Mermaid diagrams](/style-guide/components/mermaid/)
62+
- [Mermaid diagrams](/style-guide/documentation-content-strategy/component-attributes/diagrams/#mermaid-diagrams)

src/content/docs/style-guide/documentation-content-strategy/content-types/tutorial.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ For more details, refer to [`pcx_content_type`](/style-guide/frontmatter/custom-
4949
#### Most used
5050

5151
- [`GitHubCode`](/style-guide/components/github-code/)
52-
- [`LastReviewed`](/style-guide/components/last-reviewed/)
5352
- [`ListTutorials`](/style-guide/components/list-tutorials/)
5453

5554
#### Required

src/content/docs/style-guide/formatting/notes-and-other-notation-types.mdx

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,59 @@ title: Notes and other notation types
44

55
---
66

7-
Use a **warning** to alert a reader to behavior that could impact the security of a users network or break functionality. You can call out product requirements, limitations, and specifications so that users see them loud and clearly.
7+
When adding a note to a page, always use this special note formatting. There are three types of formatted notes: `note`, `caution`, and `tip`.
88

9-
Use a **note** to alert a reader to additional useful information that you cannot integrate into the text. You can provide context for a topic that would be a digression if added directly to the discussion at hand.
9+
Here is some additional information about notes:
10+
- The color of the note depends on the type of note: `note` is blue, `caution` is yellow, and `tip` is purple.
11+
- For every note type, the header text is optional.
12+
- All note types can contain text and additional formatting like lists, code blocks, and images.
1013

11-
Refer to [notes/tips/warnings](/style-guide/documentation-content-strategy/component-attributes/notes-tips-warnings/) for details on the Markdown syntax.
14+
To learn how notes fit into our content strategy, refer to [Notes/tips/warnings](/style-guide/documentation-content-strategy/component-attributes/notes-tips-warnings/).
15+
16+
## Note
17+
18+
Use Note for small additions or when you need to provide extra context that is not essential to the main content.
19+
20+
If you do not provide a header, this aside will default to `Note`.
21+
22+
```mdx
23+
:::note[Header]
24+
Hello, world!
25+
:::
26+
```
27+
28+
:::note[Header]
29+
Hello, world!
30+
:::
31+
32+
## Caution/Warning
33+
34+
Use Caution to highlight actions that could cause issues for a user.
35+
36+
If you do not provide a header, this aside will default to `Warning`.
37+
38+
```mdx
39+
:::caution[Feature conflict]
40+
If you use feature A and feature B together, your configuration will not work.
41+
:::
42+
```
43+
44+
:::caution[Feature conflict]
45+
If you use feature A and feature B together, your configuration will not work.
46+
:::
47+
48+
## Tip
49+
50+
Use Tip to share best practices or opinionated use cases that do not fit into the main documentation.
51+
52+
If you do not provide a header, this aside will default to `Tip`.
53+
54+
```mdx
55+
:::tip[Best practice]
56+
Cloudflare recommends you use [1.1.1.1](/1.1.1.1/) as your DNS resolver.
57+
:::
58+
```
59+
60+
:::tip[Best practice]
61+
Cloudflare recommends you use [1.1.1.1](/1.1.1.1/) as your DNS resolver.
62+
:::

src/content/docs/style-guide/how-we-docs/image-maintenance.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Though valuable for user understanding, images are difficult to maintain. We hav
1414
We support a few different types of images in our docs, including:
1515

1616
- [Diagrams](/style-guide/documentation-content-strategy/component-attributes/diagrams/)
17-
- [Mermaid diagrams](/style-guide/components/mermaid/)
1817
- [Screenshots](/style-guide/documentation-content-strategy/component-attributes/screenshots/)
1918

2019
Of these, we prefer Mermaid diagrams because they are searchable and easily changeable. The "cost" of updating a Mermaid diagram is much lower than re-taking a screenshot or working with a designer to update a diagram.

0 commit comments

Comments
 (0)