Skip to content

Commit 21e18e9

Browse files
author
Chris Cho
authored
Merge pull request #128 from ccho-mongodb/PR21-reformatted
PR #21 Reformatted
2 parents 8486671 + d2ff3ec commit 21e18e9

File tree

18 files changed

+541
-109
lines changed

18 files changed

+541
-109
lines changed

snooty.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ package-branch = "testing"
1010
package-version = "4.4.0"
1111
package-name-org = "mongodb-org"
1212
version = "4.0"
13+
rst-title = "reStructuredText"
14+
rst = "reStructuredText"
15+
rst-abbrev = "RST"
16+
yaml = "Yet Another Markup Language"
17+
yaml-abbrev = "YAML"
18+
markdown = "Markdown"
19+
docutils = "Docutils"
20+
sphinx = "Sphinx"
21+
docs-platform = "Docs Platform Team"
1322

1423
[substitutions]
1524
mdbsg = "MongoDB Style Guide"

source/includes/steps-guides.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ content: |
238238
239239
/images-guide
240240
/tutorials/screencapture-tool
241-
/tutorials/tabbed-content
241+
/style-guide/markup/directives/tabs
242242
/tutorials/version-bumping
243243
/tutorials/generating-a-browser-list
244244
/error-kb

source/style-guide.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ MongoDB external and internal customers.
2828
Provides advice for using accurate, consistent, and concise
2929
terminology in your content, and for writing for a global audience.
3030

31+
:doc:`/style-guide/markup-guidelines`
32+
Provides detailed guidelines about and instructions for applying
33+
{+rst+} ({+rst-abbrev+}) and {+yaml+} ({+yaml-abbrev+}).
34+
3135
:doc:`/style-guide/screenshots/index`
3236
Provides instructions for when to use and how to create screenshots
3337
and diagrams to enhance your content.

source/style-guide/includes/terms/s.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ S
144144
.. seealso:: :term:`as`
145145

146146
slash
147-
Use *slash* to refer to the / character, and use *backslash* to
148-
refer to the \\ character. Don't use :term:`slash mark`.
147+
Use *slash* to refer to the ``/`` character, and use *backslash* to
148+
refer to the ``\`` character. Don't use *slash mark*.
149149

150150
slash mark
151-
:icon-fa5:`trash-alt` Use *slash* to refer to the / character,
152-
and use *backslash* to refer to \\ the character.
151+
:icon-fa5:`trash-alt` Use *slash* to refer to the ``/`` character,
152+
and use *backslash* to refer to ``\\`` the character.
153153

154154
slave
155155
:icon-fa4:`times-circle` Don't use. Use *secondary* as an

source/style-guide/markup-guidelines.txt

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,40 @@ Markup Guidelines
66

77
.. include:: /style-guide/includes/page-needs-update.rst
88

9-
This section of the style guide provides detailed guidelines about and
10-
instructions for applying markup conventions for ReStructure Text (RST)
11-
and MarkDown (MD).
9+
This section describes markup conventions for {+rst+} ({+rst-abbrev+}) and
10+
{+markdown+}.
1211

13-
ReStructured Text (RST)
12+
{+rst-title+} ({+rst-abbrev+})
1413
~~~~~~~~~~~~~~~~~~~~~~~
1514

16-
MongoDB documentation uses reStructuredText (RST) markup syntax
15+
MongoDB documentation uses {+rst+} ({+rst-abbrev+}) markup syntax
1716
with Sphinx extensions.
1817

19-
RST is a powerful and straightforward markup language that, in
20-
combination with Sphinx, provides a wide range of facilities for
21-
intelligent and appealing documentation creation. It uses simple
22-
and implicit syntax to introduce a variety of content elements such
23-
as titles, code blocks, vertical lists, and many others. All the
24-
source content formatted using RST is stored in files with the ``.rst``
25-
extension.
18+
See `Introduction to reStructured Text <https://www.writethedocs.org/guide/writing/reStructuredText/>`__ for more information on {+rst-abbrev+}.
2619

27-
For more information on the RST conventions the Information Development
28-
team follows, see the following resources:
20+
Parts of {+rst}
21+
-------------------------
2922

30-
* `OpenStack RST conventions <https://docs.openstack.org/contributor-guide/rst-conv.html>`_.
23+
Directives
24+
~~~~~~~~~~
3125

32-
MarkDown (MD)
33-
~~~~~~~~~~~~~
26+
A :sphinx-rst:`directive </directives.html?highlight=directive>` specifies a
27+
markup block-level element. Block-level elements span the entire width of a row
28+
within their container. The directives specify a UI element in which to
29+
format the associated text or content.
3430

35-
MD is a straightforward markup language that uses simple and implicit
36-
syntax to introduce a variety of content elements. All the source
37-
content formatted using MD is stored in files with the ``.md``
38-
extension.
31+
Docutils provides the following directives:
3932

40-
To keep the documentation format consistent, follow the guidelines
41-
included in this chapter for all the MD source content.
33+
.. code-block:: rst
4234

43-
For more information about MD conventions, see the following
44-
resources:
35+
.. directive::
36+
37+
:role:
38+
39+
.. toctree::
40+
:titlesonly:
41+
42+
/style-guide/markup/format
43+
/style-guide/markup/directives
44+
/style-guide/markup/roles
4545

46-
* `Kramdown Quick Reference
47-
<https://kramdown.gettalong.org/quickref.html>`_
48-
* `Kramdown Syntax <https://kramdown.gettalong.org/syntax.html>`_
49-
* `Markdown Cheatsheet
50-
<https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet>`_
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
==========
2+
Directives
3+
==========
4+
5+
Directives provide a means to extend {+rst+} to format blocks of text.
6+
The markup syntax for directives start with two periods and a space and end
7+
with two colons as shown in the following example:
8+
9+
.. code-block:: rst
10+
11+
.. directive::
12+
13+
.. seealso::
14+
15+
Learn more about directives from the following documentation:
16+
17+
- :rst:`Docutils Directives </restructuredtext.html#directives>`
18+
19+
- :sphinx-rst:`Sphinx Directives </basics.html#directives>`
20+
21+
For a complete list of Snooty directives,
22+
see the `Snooty directives toml file <https://github.com/mongodb/snooty-parser/blob/master/snooty/rstspec.toml>`__.
23+
24+
.. toctree::
25+
:titlesonly:
26+
27+
/style-guide/markup/directives/admonitions
28+
/style-guide/markup/directives/conditionals
29+
/style-guide/markup/directives/code-blocks
30+
/style-guide/markup/directives/content
31+
/style-guide/markup/directives/images
32+
/style-guide/markup/directives/includes
33+
/style-guide/markup/directives/metadata
34+
/style-guide/markup/directives/tabs
35+
/style-guide/markup/directives/tables
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=============
2+
Code Examples
3+
=============
4+
5+
As needed, use the appropriate language option for code blocks directives
6+
including the following directives:
7+
8+
- ``code-block``
9+
- ``io-code-block``
10+
- ``literalinclude``
11+
12+
These directives feature syntax highlighting which makes the source code
13+
contained in them easier to interpret. The following example shows how to
14+
specify Python language syntax highlighting in a ``code-block`` directive:
15+
16+
.. code-block::
17+
18+
.. code-block:: python
19+
20+
print("Hello MongoDB") # Python code
21+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
========================
2+
Page Metadata Directives
3+
========================
4+
5+
meta
6+
----
7+
8+
Generates HTML ``<meta>`` tags.
9+
10+
.. code-block:: rst
11+
12+
.. meta::
13+
14+
Learn more about the ``meta`` directive from the
15+
:rst:`{+docutils+} documentation </directives.html#meta>`.
16+
17+
18+
title
19+
-----
20+
21+
Overrides the document title.
22+
23+
.. code-block:: rst
24+
25+
.. title::
26+
27+
Learn more about the ``title`` directive from the
28+
:rst:`{+docutils+} documentation </directives.html#metadata-document-title>`.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
================
2+
Table Directives
3+
================
4+
5+
Use tables to format related information.
6+
7+
In Snooty, you can use only the ``list-table`` directive to build tables.
8+
The ``list-table`` directive generates a formatted table from a two-level
9+
bulleted list.
10+
11+
To learn more about the ``list-table`` directive from the
12+
`{+docutils+} documentation </directives#list-table>`__.
13+

source/tutorials/tabbed-content.txt renamed to source/style-guide/markup/directives/tabs.txt

Lines changed: 10 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _tabbed-content:
2+
13
==============
24
Tabbed Content
35
==============
@@ -8,39 +10,21 @@ Tabbed Content
810
:depth: 2
911
:class: singlecol
1012

11-
The tabbed content extension can be used in any MongoDB docs repository
12-
that uses `docs-tools <https://github.com/mongodb/docs-tools>`_.
13-
14-
Importing the Tabs Extension
15-
----------------------------
16-
17-
The tabs extension must be imported before it can be used in a docs
18-
repository. Locate the ``extensions`` array in the desired repository's
19-
``conf.py`` file and add ``'tabs'`` to the array:
20-
21-
.. code-block:: python
22-
:emphasize-lines: 7
13+
Use the tabbed content directive ``tabs`` to organize information into a
14+
set of tabs.
2315

24-
extensions = [
25-
'sphinx.ext.extlinks',
26-
'sphinx.ext.todo',
27-
'mongodb',
28-
'directives',
29-
'intermanual',
30-
'tabs'
31-
]
3216

3317
Choosing a Tab Set
3418
------------------
3519

3620
There are two types of directives in the tabs extension:
3721

38-
- :ref:`Pre-defined Tab Sets<pre-defined-tab-set>`: Used for common
22+
- :ref:`Pre-defined Tab Sets <pre-defined-tab-set>`: Used for common
3923
groups of tabs that are shared across several pages. Pre-defined
4024
tab sets do not require the writer to specify the tab's display name
4125
and also provide error and consistency checking.
4226

43-
- :ref:`Custom Tab Set<custom-tab-set>`: Used for a group of tabs that
27+
- :ref:`Custom Tab Set <custom-tab-set>`: Used for a group of tabs that
4428
only apply to a single unique page. Custom tab sets are flexible but
4529
require the writer to provide the tab's display name and do not offer
4630
any error or consistency checking.
@@ -101,17 +85,8 @@ all pages that use the same tab set:
10185
- Eliminate the need for the writer to specify the tab display name
10286
(tab label)
10387

104-
The following pre-defined tab sets are currently available:
105-
106-
- ``tabs-drivers``
107-
- ``tabs-platforms``
108-
- ``tabs-stitch-sdks``
109-
- ``tabs-stitch-interfaces``
110-
- ``tabs-auth``
111-
- ``tabs-deployments``
112-
113-
For detailed information on each tab set, see
114-
`tabs.py <https://github.com/mongodb/docs-tools/blob/master/sphinxext/tabs.py>`__.
88+
To find the pre-defined tab sets, see the `Snooty configuration file <https://github.com/mongodb/snooty-parser/blob/master/snooty/rstspec.toml>`__.
89+
Each entry starts with ``[directive.tabs-``.
11590

11691
Pre-defined tab sets require the following fields for each tab:
11792

@@ -173,40 +148,8 @@ code examples stored in different files:
173148
Defining a New Tab Set
174149
~~~~~~~~~~~~~~~~~~~~~~
175150

176-
Create a new tab set if a pre-defined tab set best suits your use case
177-
but does not exist. New tab sets are defined in the
178-
``docs-tools/sphinxext/tabs.py`` file.
179-
180-
The following guide walks through creating the ``tabs-platforms``
181-
directive, the operating systems tab set:
182-
183-
#. Call the methods below and provide a tab set name and an array of
184-
tuples in the ``('id', 'displayName')`` format. The following example
185-
creates the ``tabs-platforms`` tab set:
186-
187-
.. code-block:: python
188-
189-
# Create operating system tab directive
190-
app.add_directive('tabs-platforms',
191-
create_tab_directive('platforms',
192-
[('windows', 'Windows'),
193-
('macos', 'macOS'),
194-
('linux', 'Linux'),
195-
('debian', 'Debian'),
196-
('rhel', 'RHEL')]))
197-
198-
.. note::
199-
200-
The first argument to ``create_tab_directive`` should use
201-
``camelCase`` naming. Using hyphens (e.g. ``stitch-sdks`` vs
202-
``stitchSdks``) will cause an error while building.
203-
204-
#. Test changes with a clean build of a docs repo. You must create a
205-
symlink from the ``build/docs-tools`` directory to the ``docs-tools``
206-
directory containing the changes. Check in the changes and then begin
207-
using the new directive on your page.
208-
209-
.. _custom-tab-set:
151+
To learn more about creating a new pre-defined tab set, contact the
152+
{+docs-platform+}.
210153

211154
Using a Custom Tab Set
212155
~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)