|
| 1 | +# Stepper |
| 2 | + |
| 3 | +Steppers provide a visual representation of sequential steps, commonly used in tutorials or guides |
| 4 | +to break down processes into manageable stages. |
| 5 | + |
| 6 | +By default every step title is a link with a generated anchor. |
| 7 | +But you can override the default anchor by adding the `:anchor:` option to the step. |
| 8 | + |
| 9 | +## Basic Stepper |
| 10 | + |
| 11 | +:::::::{tab-set} |
| 12 | +::::::{tab-item} Output |
| 13 | +:::::{stepper} |
| 14 | + |
| 15 | +:::::{stepper} |
| 16 | + |
| 17 | +::::{step} Install |
| 18 | +First install the dependencies. |
| 19 | +```shell |
| 20 | +npm install |
| 21 | +``` |
| 22 | +:::: |
| 23 | + |
| 24 | +::::{step} Build |
| 25 | +Then build the project. |
| 26 | +```shell |
| 27 | +npm run build |
| 28 | +``` |
| 29 | +:::: |
| 30 | + |
| 31 | +::::{step} Test |
| 32 | +Finally run the tests. |
| 33 | +```shell |
| 34 | +npm run test |
| 35 | +``` |
| 36 | +:::: |
| 37 | + |
| 38 | +::::{step} Done |
| 39 | +:::: |
| 40 | + |
| 41 | +::::: |
| 42 | + |
| 43 | +::::: |
| 44 | +:::::: |
| 45 | + |
| 46 | +::::::{tab-item} Markdown |
| 47 | +````markdown |
| 48 | +:::::{stepper} |
| 49 | + |
| 50 | +::::{step} Install |
| 51 | +First install the dependencies. |
| 52 | +```shell |
| 53 | +npm install |
| 54 | +``` |
| 55 | +:::: |
| 56 | + |
| 57 | +::::{step} Build |
| 58 | +Then build the project. |
| 59 | +```shell |
| 60 | +npm run build |
| 61 | +``` |
| 62 | +:::: |
| 63 | + |
| 64 | +::::{step} Test |
| 65 | +Finally run the tests. |
| 66 | +```shell |
| 67 | +npm run test |
| 68 | +``` |
| 69 | +:::: |
| 70 | + |
| 71 | +::::{step} Done |
| 72 | +:::: |
| 73 | + |
| 74 | +::::: |
| 75 | +```` |
| 76 | +:::::: |
| 77 | + |
| 78 | +::::::: |
| 79 | + |
| 80 | +## Advanced Example |
| 81 | + |
| 82 | +:::::::{tab-set} |
| 83 | + |
| 84 | +::::::{tab-item} Output |
| 85 | + |
| 86 | +:::::{stepper} |
| 87 | + |
| 88 | +::::{step} Create an index |
| 89 | + |
| 90 | +Create a new index named `books`: |
| 91 | + |
| 92 | +```console |
| 93 | +PUT /books |
| 94 | +``` |
| 95 | + |
| 96 | +The following response indicates the index was created successfully. |
| 97 | + |
| 98 | +:::{dropdown} Example response |
| 99 | +```console-result |
| 100 | +{ |
| 101 | + "acknowledged": true, |
| 102 | + "shards_acknowledged": true, |
| 103 | + "index": "books" |
| 104 | +} |
| 105 | +``` |
| 106 | +::: |
| 107 | + |
| 108 | +:::: |
| 109 | + |
| 110 | +::::{step} Add data to your index |
| 111 | +:anchor: add-data |
| 112 | + |
| 113 | +:::{tip} |
| 114 | +This tutorial uses Elasticsearch APIs, but there are many other ways to [add data to Elasticsearch](#). |
| 115 | +::: |
| 116 | + |
| 117 | +You add data to Elasticsearch as JSON objects called documents. Elasticsearch stores these documents in searchable indices. |
| 118 | +:::: |
| 119 | + |
| 120 | +::::{step} Define mappings and data types |
| 121 | + |
| 122 | + When using dynamic mapping, Elasticsearch automatically creates mappings for new fields by default. |
| 123 | + The documents we’ve added so far have used dynamic mapping, because we didn’t specify a mapping when creating the index. |
| 124 | + |
| 125 | + To see how dynamic mapping works, add a new document to the `books` index with a field that doesn’t appear in the existing documents. |
| 126 | + |
| 127 | + ```console |
| 128 | + POST /books/_doc |
| 129 | + { |
| 130 | + "name": "The Great Gatsby", |
| 131 | + "author": "F. Scott Fitzgerald", |
| 132 | + "release_date": "1925-04-10", |
| 133 | + "page_count": 180, |
| 134 | + "language": "EN" <1> |
| 135 | + } |
| 136 | + ``` |
| 137 | + 1. The new field. |
| 138 | +:::: |
| 139 | + |
| 140 | +::::: |
| 141 | + |
| 142 | +:::::: |
| 143 | + |
| 144 | +::::::{tab-item} Markdown |
| 145 | + |
| 146 | +````markdown |
| 147 | +:::::{stepper} |
| 148 | + |
| 149 | +::::{step} Create an index |
| 150 | + |
| 151 | +Create a new index named `books`: |
| 152 | + |
| 153 | +```console |
| 154 | +PUT /books |
| 155 | +``` |
| 156 | + |
| 157 | +The following response indicates the index was created successfully. |
| 158 | + |
| 159 | +:::{dropdown} Example response |
| 160 | +```console-result |
| 161 | +{ |
| 162 | + "acknowledged": true, |
| 163 | + "shards_acknowledged": true, |
| 164 | + "index": "books" |
| 165 | +} |
| 166 | +``` |
| 167 | +::: |
| 168 | + |
| 169 | +:::: |
| 170 | + |
| 171 | +::::{step} Add data to your index |
| 172 | +:anchor: add-data |
| 173 | + |
| 174 | +:::{tip} |
| 175 | +This tutorial uses Elasticsearch APIs, but there are many other ways to [add data to Elasticsearch](#). |
| 176 | +::: |
| 177 | + |
| 178 | +You add data to Elasticsearch as JSON objects called documents. Elasticsearch stores these documents in searchable indices. |
| 179 | +:::: |
| 180 | + |
| 181 | +::::{step} Define mappings and data types |
| 182 | + |
| 183 | +When using dynamic mapping, Elasticsearch automatically creates mappings for new fields by default. |
| 184 | +The documents we’ve added so far have used dynamic mapping, because we didn’t specify a mapping when creating the index. |
| 185 | + |
| 186 | +To see how dynamic mapping works, add a new document to the `books` index with a field that doesn’t appear in the existing documents. |
| 187 | + |
| 188 | + ```console |
| 189 | + POST /books/_doc |
| 190 | + { |
| 191 | + "name": "The Great Gatsby", |
| 192 | + "author": "F. Scott Fitzgerald", |
| 193 | + "release_date": "1925-04-10", |
| 194 | + "page_count": 180, |
| 195 | + "language": "EN" <1> |
| 196 | + } |
| 197 | + ``` |
| 198 | +1. The new field. |
| 199 | + :::: |
| 200 | + |
| 201 | +::::: |
| 202 | +````` |
| 203 | +:::::: |
| 204 | + |
| 205 | +::::::: |
0 commit comments