@@ -7,7 +7,7 @@ Shared Include
7
7
The ``sharedinclude`` directive lets you source content from a file located in
8
8
the MongoDB internal `docs-shared <https://github.com/10gen/docs-shared>`__
9
9
repository. Use this directive when you need to keep the same content in sync
10
- for multiple sets of documentation or multiple branches of a documentation set.
10
+ for multiple sets of documentation or branches of a documentation set.
11
11
12
12
This page uses the following terms:
13
13
@@ -20,17 +20,17 @@ Sourcing file
20
20
directive to pull content from an external file.
21
21
22
22
Placeholder
23
- A variable that indicates text that the sourcing file must provide a
24
- replacement for. These variables are represented by the placeholder name
25
- surrounded by the ``|`` (pipe) character. The variables are used in
26
- external files .
23
+ A variable that identifies where replacement content should be inserted.
24
+ These variables are represented as a name surrounded by the ``|`` (pipe)
25
+ character. Add them in the external file and define the replacement content
26
+ in the sourcing file .
27
27
28
28
.. tip::
29
29
30
- The ``sharedinclude`` directive is an extension of the ``include`` directive.
30
+ The ``sharedinclude`` directive extends the ``include`` directive.
31
31
While the ``include`` directive allows you to source content from the
32
32
branch of the repository in which it is used, the ``sharedinclude``
33
- directive is hardcoded to reference external files from the
33
+ directive is hard-coded to reference external files from the
34
34
`10gen/docs-shared <https://github.com/10gen/docs-shared/>`__
35
35
private GitHub repository.
36
36
41
41
You must ensure the ``sharedinclude_root`` setting in the documentation
42
42
repository's ``snooty.toml`` configuration file is set to the shared
43
43
content repository URL. This URL must point to the unprocessed version of the
44
- files, currently served from the ``raw.githubusercontent.com`` domain.
44
+ files currently served from the ``raw.githubusercontent.com`` domain.
45
45
46
46
For example, if the external files that your docs repository file references
47
47
is on the ``main`` branch of ``docs-shared``, your docs repository
@@ -58,23 +58,23 @@ configuring this setting.
58
58
Syntax
59
59
------
60
60
61
- To include content from an external file, add the ``sharedinclude`` directive
62
- to the sourcing file. Specify the path of the external file relative to the
61
+ Add the ``sharedinclude`` directive to the sourcing file to include content
62
+ from the external file. Specify the path of the external file relative to the
63
63
``docs-shared`` base directory, omitting the leading slash.
64
64
65
65
For example, if the file path from the root of the ``docs-shared`` repository
66
- is ``drivers/compatibility-tables/c.rst``, the {+rst-abbrev+} in the sourcing file
67
- should include the following code:
66
+ is ``drivers/compatibility-tables/c.rst``, the {+rst-abbrev+} in the sourcing
67
+ file should include the following code:
68
68
69
69
.. code-block:: rst
70
70
:caption: sourcing_file.txt in a documentation repository
71
71
:copyable: false
72
72
73
73
.. _sharedinclude:: drivers/compatibility-tables/c.rst
74
74
75
- The external file can include replacement variables in the form of
76
- ``|variable-name|``. This enables the sourcing file to customize segments
77
- of the page.
75
+ The external file includes replacement variables in the form of
76
+ ``|variable-name|``. You can define the replacement values in sourcing files
77
+ to customize segments of the page.
78
78
79
79
For example, suppose the ``docs-shared`` file ``language.rst`` contained the
80
80
following content with a replacement variable called ``|driver-name|``:
@@ -118,15 +118,15 @@ Placeholders in Inline Context
118
118
119
119
An **inline context** describes the positioning of placeholders as adjacent to
120
120
other paragraph text. If the placeholder is in an inline context, you can
121
- replace it with markup elements including the following types:
121
+ replace it with markup elements, including the following types:
122
122
123
123
- Unformatted text
124
124
- Formatted text such as ``monospace``, **emphasis**, or *italic*
125
125
- Links
126
126
127
127
You cannot replace variable placeholders in inline contexts with elements
128
128
such as lists, code blocks, includes, and headers. If you need to
129
- source these elements from a ``sharedinclude``, make sure the placeholders
129
+ source these elements from a ``sharedinclude``, ensure the placeholders
130
130
are in a block context as described in the next section.
131
131
132
132
For example, suppose you want to source content from an external file, located
@@ -167,24 +167,24 @@ Placeholders in Block Context
167
167
`````````````````````````````
168
168
169
169
A **block context** describes the positioning of placeholders as
170
- separated from paragraph text by line breaks. You can replace variable
171
- placeholders in a block context with most inline or block {+rst-abbrev+}
172
- elements, including the following types:
170
+ separated from paragraph text by line breaks. You can replace placeholders in
171
+ a block context with most inline or block {+rst-abbrev+} elements, including
172
+ the following types:
173
173
174
174
- Titles
175
175
- Code blocks
176
176
- Anchors
177
177
- Admonitions
178
178
179
- For example, suppose you want to source content from an external file, located
179
+ For example, suppose you want to source content from an external file located
180
180
at ``dbx/fundamentals/agg-operators.rst`` in the ``docs-shared`` repository,
181
181
which contains the following content:
182
182
183
183
.. code-block:: rst
184
184
:caption: dbx/fundamentals/agg-operators.rst external file in docs_shared
185
185
:copyable: false
186
186
187
- The next section demonstrates how to use aggregation operators to build
187
+ The following section demonstrates how to use aggregation operators to build
188
188
an aggregation pipeline.
189
189
190
190
|aggregation-operators-example|
@@ -219,7 +219,7 @@ The published page renders as if the sourcing file contained the following {+rst
219
219
.. code-block:: rst
220
220
:copyable: false
221
221
222
- The next section demonstrates how to use aggregation operators to build
222
+ The following section demonstrates how to use aggregation operators to build
223
223
an aggregation pipeline.
224
224
225
225
.. _expression-operators-example:
0 commit comments