You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,98 +8,159 @@ description: Configuring language tabs for the API Demo Panel.
8
8
9
9
## Overview
10
10
11
-
The Docusaurus OpenAPI docs plugin comes with support for 8 languages which you can render as code snippets on an API operation page. The languages currently supported are:
11
+
The Docusaurus OpenAPI docs plugin comes with support for 18 languages which you can render as code snippets on an API operation page.
The enabled languages are defined for your site in a `languageTabs` array in the `themeConfig` object in your config file. If you do not define this configuration item all of the languages above are enabled. The config schema for each language is as follows:
|`highlight`|`string`|`null`| The syntax highlighting ruleset to use. |
32
45
|`language`|`string`|`null`| The programming language to use when generating the example. |
33
-
|`logoClass`|`string`|`null`| The CSS class to be added to render the appropriate logo. |
34
-
|`variant`|`string`|`null`| The language variant to use when generating the example, see below for a tip on where you can find the variants. |
35
-
|`options`|`object`|`null`|_Optional:_ Set of options for language customization. See below for common options, exact options depend on language. |
36
-
|`followRedirect`|`string`|`null`|_Optional:_ Follow redirects when handling requests. |
37
-
|`trimRequestBody`|`string`|`null`|_Optional:_ Trim request body fields. |
38
-
|`indentCount`|`integer`|_language dependent_|_Optional:_ Alter the number of indentations used when generating the examples. |
39
-
|`indentType`|`string`|_language dependent_|_Optional:_ Alter the type of indentation used, `Space` or `Tab` are acceptable options for this. |
46
+
|`highlight`|`string`|_language dependent_|_Optional:_ The prism syntax highlighting language to use. |
47
+
|`logoClass`|`string`|_language dependent_|_Optional:_ The CSS class suffix to be added to render the appropriate logo. |
48
+
|`variant`|`string`|_language dependent_|_Optional:_ The default language variant to use when generating the code snippet. |
49
+
|`variants`|`array`|_language dependent_|_Optional:_ An array of strings representing the variants available for the language. |
50
+
|`options`|`object`|_language dependent_|_Optional:_ Set of options for language customization. See below for common options, exact options depend on language. |
51
+
| `followRedirect`|`boolean`|_language dependent_|_Optional:_ Follow redirects when handling requests. |
52
+
| `trimRequestBody`|`boolean`|_language dependent_|_Optional:_ Trim request body fields. |
53
+
| `indentCount`|`integer`|_language dependent_|_Optional:_ Alter the number of indentations used when generating the examples. |
54
+
| `indentType`|`string`|_language dependent_|_Optional:_ Alter the type of indentation used, `Space` or `Tab` are acceptable options for this. |
40
55
41
56
:::tip
42
-
The order you define the languages under `languageTabs` is the order in which they will appear once rendered.
57
+
The order you define the languages under `languageTabs` is the order in which they will appear once rendered. You may also choose a subset of languages and variants to include.
43
58
:::
44
59
45
60
:::danger
46
61
Individual languages may only be defined once, meaning you cannot define a language multiple times with different variants. For example, you cannot define both `nodejs\axios` and `nodejs\unirest` or `python/requests` and `python/http.client`.
47
62
:::
48
63
49
-
##Demo Languages
64
+
### Languages in Demo
50
65
51
-
The demo site disables the `ruby` and `php` languages using the following `languageTabs` config object.
66
+
The demo site defines all supported languages using the following `languageTabs` config object.
67
+
68
+
:::note
69
+
Only the `language` property is required. The `highlight` and `logoClass` properties are provided only for reference.
0 commit comments