Skip to content

Commit 3da88bd

Browse files
authored
Merge pull request rails#52553 from p8/guides/document-tips-and-notes
Document `NOTE`, `TIP` and `WARNING` guidelines [ci-skip]
2 parents 25bab2f + c267c14 commit 3da88bd

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

guides/source/ruby_on_rails_guides_guidelines.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ After reading this guide, you will know:
1313
--------------------------------------------------------------------------------
1414

1515
Markdown
16-
-------
16+
--------
1717

1818
Guides are written in [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown). There is comprehensive [documentation for Markdown](https://daringfireball.net/projects/markdown/syntax), as well as a [cheatsheet](https://daringfireball.net/projects/markdown/basics).
1919

@@ -23,7 +23,7 @@ Prologue
2323
Each guide should start with motivational text at the top (that's the little introduction in the blue area). The prologue should tell the reader what the guide is about, and what they will learn. As an example, see the [Routing Guide](routing.html).
2424

2525
Headings
26-
------
26+
--------
2727

2828
The title of every guide uses an `h1` heading; guide sections use `h2` headings; subsections use `h3` headings; etc. Note that the generated HTML output will use heading tags starting with `<h2>`.
2929

@@ -51,6 +51,57 @@ Use the same inline formatting as regular text:
5151
##### The `:content_type` Option
5252
```
5353

54+
Notes, Tips and Warnings
55+
------------------------
56+
57+
Sometimes a paragraph deserves a little more attention. For example, to clarify
58+
a common misunderstanding or warn about something that could break an
59+
application.
60+
61+
To highlight a paragraph, prefix it with `NOTE:`, `TIP:` or `WARNING:`:
62+
63+
```markdown
64+
NOTE: Use `NOTE`, `TIP` or `WARNING` to highlight a paragraph.
65+
```
66+
67+
This will wrap the paragraph in a special container resulting in the following:
68+
69+
NOTE: Use `NOTE`, `TIP` or `WARNING` to highlight a paragraph.
70+
71+
### NOTE
72+
73+
Use `NOTE` to highlight something in relation to the subject and the context.
74+
Reading it will help your understanding of that subject or context, or
75+
clarify an important item.
76+
77+
For example, a section describing locale files could have the following `NOTE`:
78+
79+
NOTE: You need to restart the server when you add new locale files.
80+
81+
### TIP
82+
83+
A `TIP` is just an additional bit of information regarding the subject, but not
84+
necessarily relevant to the understanding. It can point you to another guide or
85+
website:
86+
87+
TIP: To learn more about routing, see [Rails Routing from the Outside In](
88+
routing.html).
89+
90+
Or show a helpful command to see more options to dig deeper:
91+
92+
TIP: For further help with generators, run `bin/rails generate --help`.
93+
94+
### WARNING
95+
96+
Use `WARNING` for things to avoid that could break the application:
97+
98+
WARNING: Refrain from using methods like `update`, `save`, or any other methods
99+
that cause side effects on the object within your callback methods.
100+
101+
Or warn about things that could compromise your application's security.
102+
103+
WARNING: Keep your master key safe. Do not commit your master key.
104+
54105
Links
55106
-----
56107

0 commit comments

Comments
 (0)