Skip to content

Commit ac76e9a

Browse files
authored
(DOCSP-44517): Added new component guidelines. (#181)
* (DOCSP-44517): Added new component guidelines. * (DOCSP-44517): Incorporated Steph's feedback. * (DOCSP-44517): Incorporated Steph's feedback. * (DOCSP-44517): Incorporated feedback.
1 parent 1659d81 commit ac76e9a

18 files changed

+304
-36
lines changed

source/images/callout-anatomy.png

21.2 KB
Loading

source/images/callout-label.png

40.6 KB
Loading
91.4 KB
Loading
46.6 KB
Loading
Loading
14.6 KB
Loading
72.6 KB
Loading
51.4 KB
Loading

source/images/nested-callouts.png

86.4 KB
Loading

source/images/next-button-anatomy.png

24.3 KB
Loading

source/images/procedure-anatomy.png

32.5 KB
Loading
43.7 KB
Loading

source/style-guide/style/callouts.txt

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ Callouts or admonitions emphasize important or helpful information.
1010
To avoid clutter on the page and to preserve visual impact, use callouts
1111
sparingly.
1212

13+
Callout Anatomy
14+
---------------
15+
16+
A callout contains the following parts:
17+
18+
1. Label that indicates the callout type
19+
2. Optional title
20+
3. Body text
21+
22+
.. figure:: /images/callout-anatomy.png
23+
:alt: callout anatomy
24+
:align: center
25+
:figwidth: 700px
26+
1327
Callout Types
1428
-------------
1529

@@ -50,62 +64,47 @@ You can use the following callouts:
5064
lose data, compromise data integrity, or disrupt operations if
5165
they don't follow instructions carefully.
5266
- ``.. warning:: <title>``
53-
* - Example
54-
- Presents a scenario that illustrates or demonstrates a concept in
55-
the text.
56-
- ``.. example:: <title>``
57-
* - See
58-
- Provides a link to a topic or section directly related to the
59-
preceding text. You might use ``see`` to link to content with
60-
necessary procedures, definitions, or deployment considerations
61-
and impacts.
62-
- ``.. see::``
63-
* - See also
64-
- Provides a link to topics or sections that are generally related
65-
to or provide useful context for the preceding text. You might
66-
use ``seealso`` to link to content that provides background
67-
information, deeper context, or common related tasks.
68-
- ``.. seealso::``
6967

7068
Callout Guidelines
7169
------------------
7270

73-
When creating callouts, use the following guidelines:
74-
75-
- Use the callout type to convey the kind of information you want
76-
to communicate. Don't rely on color to convey intensity.
71+
When you create callouts, use the following guidelines:
7772

78-
- Use the correct {+rst+} directive to create the callout. Don't
79-
attempt to create callouts using boldface, headings, or custom
80-
:abbr:`CSS (Cascading Style Sheets)`.
73+
- Use the appropriate callout type to convey the kind of information
74+
you want to communicate.
8175

8276
- Don't stack multiple callouts directly after one another, as these can
83-
distract users. To avoid stacking callouts, group supplemental information
84-
from callouts into a dedicated section.
77+
distract users. To avoid stacking callouts, group supplemental
78+
information from callouts into a dedicated section. For callouts of
79+
the same type, use a single callout that contains separate paragraphs
80+
or an unordered list.
8581

86-
- If possible, don't use callouts in tables and option lists
82+
- If possible, don't use callouts in tables and option lists.
8783
Callouts reduce the scannability of tables and options lists.
8884

89-
- Avoid nesting callouts inside tables and other elements.
85+
- Avoid nesting callouts inside tables, code blocks, and other elements.
9086

91-
- Avoid nesting code blocks inside callouts.
87+
- Place a callout as close as possible to the information that it
88+
emphasizes or clarifies.
9289

93-
- Place a callout as close as possible to the information that it
94-
emphasizes or clarifies.
90+
- Use callouts for long form text and avoid using callouts for links
91+
only.
9592

96-
- Avoid stacking callouts of the same type. For example, avoid adding
97-
one labeled note directly after another labeled note. Instead, use
98-
a single callout that contains separate paragraphs or an unordered list.
93+
- Use callouts only when needed and avoid overcrowding the
94+
page with callouts.
9995

10096
The following callouts might appear in existing documentation but are
10197
deprecated. Don't use these callouts in new content:
10298

10399
- ``.. admonition::``
104100
- ``.. caution::``
105101
- ``.. danger::``
102+
- ``.. example::``
103+
- ``.. see::``
104+
- ``.. see also::``
106105
- ``.. topic::``
107106

108107
Nested Components
109108
-----------------
110109

111-
Do not nest components. To learn more, see :ref:`nested-components`.
110+
Don't nest components. To learn more, see :ref:`nested-components`.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.. _collapsible-sections:
2+
3+
====================
4+
Collapsible Sections
5+
====================
6+
7+
.. default-domain:: mongodb
8+
9+
Collapsible sections let you hide and show dynamic content.
10+
11+
Collapsible Section Anatomy
12+
---------------------------
13+
14+
A collapsible section contains the following parts:
15+
16+
1. Section title
17+
2. Short description of the content in the section
18+
3. Chevron to expand and collapse the section
19+
4. Section content
20+
21+
.. figure:: /images/collapsible-section-anatomy.png
22+
:alt: collapsible section anatomy
23+
:align: center
24+
:figwidth: 700px
25+
26+
Collapsible Section Syntax
27+
--------------------------
28+
29+
The following example shows the syntax for a collapsible section:
30+
31+
.. code-block::
32+
33+
.. collapsible::
34+
:heading: Prerequisites
35+
:sub_heading: Complete the previous steps in the tutorial and install dependencies
36+
:expanded:
37+
38+
Body content goes here.
39+
40+
Collapsible Section Guidelines
41+
------------------------------
42+
43+
When you create collapsible sections, use the following
44+
guidelines:
45+
46+
- Make the title short and concise.
47+
48+
- For the subheader, write a very one-line description with a
49+
period at the end. Don't exceed one line.
50+
51+
- Don't hide essential information in a collapsible section. Include
52+
only secondary information, like prerequisite and
53+
troubleshooting information, in a collapsed section. Use the
54+
``:expanded:`` option for sections that should display expanded
55+
by default.

source/style-guide/style/index.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ instructions for applying style conventions.
1414
:maxdepth: 1
1515

1616
/style-guide/style/abbreviations
17+
/style-guide/style/collapsible-sections
1718
/style-guide/style/callouts
1819
/style-guide/style/capitalization
1920
/style-guide/style/citations
@@ -26,10 +27,12 @@ instructions for applying style conventions.
2627
/style-guide/style/glossaries
2728
/style-guide/style/ip-addresses
2829
/style-guide/style/keyboard-keys
30+
/style-guide/style/language-selectors
2931
/style-guide/style/links-and-cross-references
3032
/style-guide/style/lists
3133
/style-guide/style/messages
3234
/style-guide/style/names
35+
/style-guide/style/next-buttons
3336
/style-guide/style/numbers
3437
/style-guide/style/parameters
3538
Placeholders for APIs </style-guide/style/cloud-account-info>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
.. _language-selectors:
2+
3+
=============================
4+
Method and Language Selectors
5+
=============================
6+
7+
.. default-domain:: mongodb
8+
9+
Method and language selectors let you provide dynamic content based on
10+
the selected method and language.
11+
12+
Method and Language Selector Anatomy
13+
------------------------------------
14+
15+
A method and language selector contains the following parts:
16+
17+
1. Radio boxes with different method options (up to six)
18+
2. Optional method description
19+
3. Language selector drop-down (drivers only)
20+
21+
.. figure:: /images/language-selectors-anatomy.png
22+
:alt: method and language selectors anatomy
23+
:align: center
24+
:figwidth: 700px
25+
26+
Method and Language Selector Syntax
27+
-----------------------------------
28+
29+
The following example shows the syntax for a method selector:
30+
31+
.. code-block::
32+
33+
.. method-selector::
34+
35+
.. method-option::
36+
:id: driver
37+
38+
.. method-description::
39+
40+
.. include:: /includes/description-drivers.rst
41+
42+
.. tabs-selector:: drivers
43+
44+
The following example shows the syntax for a language selector:
45+
46+
.. code-block::
47+
48+
.. tabs-drivers::
49+
50+
.. tab::
51+
:tabid: compass
52+
53+
.. include:: /includes/steps-gswa-connect-to-cluster-compass.rst
54+
55+
.. tab::
56+
:tabid: csharp
57+
58+
.. include:: /includes/steps-gswa-driver-connect-csharp.rst
59+
60+
.. tab::
61+
:tabid: go
62+
63+
.. include:: /includes/steps-gswa-driver-connect-go.rst
64+
65+
.. tab::
66+
:tabid: java-sync
67+
68+
.. include:: /includes/steps-gswa-driver-connect-java.rst
69+
70+
.. tab::
71+
:tabid: python
72+
73+
.. include:: /includes/steps-gswa-driver-connect.rst
74+
75+
.. tab::
76+
:tabid: nodejs
77+
78+
.. include:: /includes/steps-gswa-driver-connect-node.rst
79+
80+
Method and Language Selector Guidelines
81+
---------------------------------------
82+
83+
When you create method and language selectors, use the following
84+
guidelines:
85+
86+
- Add a language selector only when :guilabel:`Driver` is the selected
87+
method.
88+
89+
- Include a minimum of two options and a maximum of six options per
90+
method selector. You may have only one instance of a method selector
91+
per page.
92+
93+
.. figure:: /images/method-selector-options.png
94+
:alt: method selector options
95+
:align: center
96+
:figwidth: 700px
97+
98+
- The optional method description may not exceed two lines.
99+
100+
.. figure:: /images/method-selector-description.png
101+
:alt: method selector description
102+
:align: center
103+
:figwidth: 700px
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.. _next-buttons:
2+
3+
============
4+
Next Buttons
5+
============
6+
7+
.. default-domain:: mongodb
8+
9+
Next buttons provide extra navigation at the top of a page.
10+
11+
Next Button Anatomy
12+
-------------------
13+
14+
A next button contains the following parts:
15+
16+
1. Button with a right arrow
17+
2. Next label
18+
3. Title of the next page
19+
4. Step "X of Y" label at the top of the page title
20+
21+
.. figure:: /images/next-button-anatomy.png
22+
:alt: next button anatomy
23+
:align: center
24+
:figwidth: 700px
25+
26+
Next Button Syntax
27+
------------------
28+
29+
The following example shows the syntax for a next button:
30+
31+
.. code-block::
32+
33+
.. multi-page-tutorial::
34+
:show-next-top:
35+
36+
The following example shows the syntax for defining multi-step
37+
tutorials in the ``snooty.toml`` file:
38+
39+
.. code-block::
40+
41+
multi_page_tutorials = [
42+
"/get-started-cli",
43+
"/get-started-ui"
44+
]
45+
46+
Next Button Guidelines
47+
----------------------
48+
49+
When you create next buttons, use the following guidelines:
50+
51+
- Use next buttons at the top of the page only in multi-step tutorial
52+
pages.
53+
54+
- Use next and back buttons on the bottom of the page to follow the
55+
structure of the table of contents.

0 commit comments

Comments
 (0)