|
| 1 | +title: "Add guides to your sphinx extensions." |
| 2 | +ref: add-guides |
| 3 | +content: | |
| 4 | + Add 'guides' to the extensions list in conf.py in your repo root. |
| 5 | + |
| 6 | + .. code-block:: sh |
| 7 | + |
| 8 | + extensions = [ |
| 9 | + 'sphinx.ext.extlinks', |
| 10 | + 'sphinx.ext.todo', |
| 11 | + 'mongodb', |
| 12 | + 'directives', |
| 13 | + 'intermanual', |
| 14 | + 'testcode', |
| 15 | + 'tabs', |
| 16 | + 'markdown', |
| 17 | + 'fasthtml', |
| 18 | + 'source_constants', |
| 19 | + 'icon' |
| 20 | + 'guides' |
| 21 | + ] |
| 22 | +--- |
| 23 | +title: Copy the guides directive template into a file in your repo. |
| 24 | +ref: copy-guide |
| 25 | +content: | |
| 26 | + Copy the following directive template into a file to begin |
| 27 | + writing your guide. Make sure it's under the source directory and |
| 28 | + give it a .txt extension. Otherwise it won't build. |
| 29 | +
|
| 30 | + .. note:: |
| 31 | + |
| 32 | + While the spacing makes this example look a bit like a .yaml |
| 33 | + file, it's really a sphinx directive. This guide should compile as-is. |
| 34 | +
|
| 35 | + .. code-block:: sh |
| 36 | +
|
| 37 | + .. guide:: |
| 38 | + title: This is your guide title |
| 39 | + author: MongoDB Documentation Team |
| 40 | + type: Getting Started |
| 41 | + level: beginner |
| 42 | + product_version: 4.0 |
| 43 | + languages: |
| 44 | + shell |
| 45 | + compass |
| 46 | + python |
| 47 | + java-sync |
| 48 | + nodejs |
| 49 | + motor |
| 50 | + csharp |
| 51 | + result_description: |
| 52 | + This is a handy description of the result you will achieve |
| 53 | + if you successfully create this guide. |
| 54 | + time: 15 |
| 55 | + prerequisites: |
| 56 | + - first do this guide |
| 57 | + - then do this one |
| 58 | + - make sure you have installed some stuff |
| 59 | + check_your_environment: |
| 60 | + Check to see if your environment has everything it needs. |
| 61 | + List things you need to complete this guide |
| 62 | + - binaries installed |
| 63 | + - permissions |
| 64 | + - drivers or libraries |
| 65 | + procedure: |
| 66 | + Feel free to put the steps include here. |
| 67 | + |
| 68 | + At the moment, tabbed content does not display properly when put |
| 69 | + directly in the procedure section. Use an include file for tabbed |
| 70 | + content. |
| 71 | + summary: |
| 72 | + Congrats! You accomplished something. |
| 73 | + whats_next: |
| 74 | + - check out the `guide on such and such </guide/such-and-such>` |
| 75 | +
|
| 76 | +--- |
| 77 | +title: Fill in your guide template |
| 78 | +ref: make-template |
| 79 | +content: | |
| 80 | + Now it's time to fill in the fields in the template to create your guide. |
| 81 | +
|
| 82 | + The languages section is optional, so use it only if you would like |
| 83 | + pills at the top of your page and have tabbed language content |
| 84 | + (tabs-drivers) to toggle. |
| 85 | +
|
| 86 | + The following sections are required: |
| 87 | + .. list-table:: |
| 88 | + :header-rows: 1 |
| 89 | + :widths: auto |
| 90 | + :class: guide-tablenate |
| 91 | + |
| 92 | + * - field |
| 93 | + - type |
| 94 | + - possible values |
| 95 | +
|
| 96 | + * - title |
| 97 | + - string |
| 98 | + - any |
| 99 | +
|
| 100 | + * - author |
| 101 | + - string |
| 102 | + - any |
| 103 | +
|
| 104 | + * - level |
| 105 | + - string |
| 106 | + - beginner, intermediate, advanced |
| 107 | +
|
| 108 | + * - time |
| 109 | + - number |
| 110 | + - any |
| 111 | + |
| 112 | + * - type |
| 113 | + - string |
| 114 | + - Getting Started, Use Case, Deep Dive |
| 115 | + |
| 116 | + * - product_version |
| 117 | + - number |
| 118 | + - any |
| 119 | +
|
| 120 | + * - prerequisites |
| 121 | + - text |
| 122 | + - any |
| 123 | + |
| 124 | + * - summary |
| 125 | + - text |
| 126 | + - any |
| 127 | + |
| 128 | + * - procedure |
| 129 | + - text |
| 130 | + - any |
| 131 | + |
| 132 | + * - result_description |
| 133 | + - text |
| 134 | + - any |
| 135 | +--- |
| 136 | +title: Document the content with steps required to complete the tutorial |
| 137 | +ref: make-steps |
| 138 | +content: | |
| 139 | + Document the steps required for your guide. If you'd like content |
| 140 | + with numbered steps, use a step file. |
| 141 | + |
| 142 | + Step files are *.yaml* files that get converted during the build process |
| 143 | + to *.rst* files and |
| 144 | + are included as `/<dir>/steps/<something>.rst`. When you create the .yaml |
| 145 | + step file, name it according to the convention: |
| 146 | +
|
| 147 | + .. note:: |
| 148 | + |
| 149 | + Guides use headings to delineate sections. If you would like to provide |
| 150 | + subsections for your guides sections, use subheadings. |
| 151 | +
|
| 152 | + |
| 153 | + .. code-block:: sh |
| 154 | + |
| 155 | + <dir>/steps-<something>.yaml |
| 156 | +
|
| 157 | + Here is an example of a .yaml steps file. Notice that you can |
| 158 | + nest includes within the step content if you wish. |
| 159 | +
|
| 160 | + .. code-block:: sh |
| 161 | + |
| 162 | + title: Find the ``mongo`` Shell |
| 163 | + ref: mongo-shell |
| 164 | + content: | |
| 165 | +
|
| 166 | + The ``mongo`` shell is packaged with the MongoDB Server |
| 167 | + Community and Enterprise distributions, and is also available |
| 168 | + for users of Atlas as a client-only download. |
| 169 | +
|
| 170 | + If you do not have ``mongo`` shell installed, follow the |
| 171 | + install directions for your environment. |
| 172 | +
|
| 173 | + .. include:: /includes/download-shell-tabs.rst |
| 174 | +
|
| 175 | + --- |
| 176 | +
|
| 177 | + title: Connect to your MongoDB instance |
| 178 | + ref: connect |
| 179 | + content: | |
| 180 | +
|
| 181 | + .. include:: /includes/mongo-shell-platform-connect-np.rst |
| 182 | +
|
| 183 | +--- |
| 184 | +title: Add What's Next and See Also (optional) sections |
| 185 | +ref: whats-next |
| 186 | +content: | |
| 187 | +
|
| 188 | + The *What's Next* and *See Also* sections are important for |
| 189 | + leading the reader to the next step in their learning. |
| 190 | +
|
| 191 | + Add links to other tutorials in the *What's Next* section and |
| 192 | + save *See Also* for content that links out of the tutorial format |
| 193 | + such as in-depth manual content and reference material. |
| 194 | +
|
| 195 | + If you have `:manual:` in your conf.py as an extlink map, you can use: |
| 196 | +
|
| 197 | + .. code-block:: sh |
| 198 | +
|
| 199 | + :manual:`short description </reference/blah>` |
| 200 | +
|
| 201 | + Or for content that lives in your own repo, feel free to use: |
| 202 | +
|
| 203 | + .. code-block:: sh |
| 204 | +
|
| 205 | + :doc:`Some Local Content </localdir/localcontent>` |
| 206 | +
|
| 207 | + External links or links referenced from outside of a repo with shortcuts configured |
| 208 | + can be referenced using the fully qualified url: |
| 209 | +
|
| 210 | + .. code-block:: sh |
| 211 | + |
| 212 | + `Site to link to <http://fully.qualified.domain/stuff>`__. |
| 213 | +
|
| 214 | +--- |
| 215 | +title: Add the Guide to a Table of Contents |
| 216 | +ref: add-to-toc |
| 217 | +content: | |
| 218 | +
|
| 219 | + To add the guide to a table of contents, use the same method you would |
| 220 | + use for any standard docs content. |
| 221 | +
|
| 222 | + In the .txt file for the TOC in question, add the link. |
| 223 | +
|
| 224 | + .. code-block:: none |
| 225 | +
|
| 226 | + .. toctree:: |
| 227 | + :titlesonly: |
| 228 | +
|
| 229 | + /images-guide |
| 230 | + /tutorials/screencapture-tool |
| 231 | + /tutorials/tabbed-content |
| 232 | + /tutorials/version-bumping |
| 233 | + /tutorials/generating-a-browser-list |
| 234 | + /error-kb |
| 235 | + /tutorials/guide |
| 236 | +
|
| 237 | +... |
0 commit comments