api_docs: Specify max width for long code examples.

Fixes #10673.
This commit is contained in:
Adarsh Patel 2019-01-26 09:48:25 +05:30 committed by Eeshan Garg
parent 4aa2ac1b52
commit 9b740df277
2 changed files with 11 additions and 1 deletions

View File

@ -2008,6 +2008,16 @@ table {
vertical-align: bottom;
}
.table .json-api-example {
width: fit-content;
max-width: 300px;
word-wrap: break-word;
}
.table .json-api-example code {
white-space: pre-wrap;
}
.table caption + thead tr:first-child th,
.table caption + thead tr:first-child td,
.table colgroup + thead tr:first-child th,

View File

@ -105,7 +105,7 @@ class APIArgumentsTablePreprocessor(Preprocessor):
tr = """
<tr>
<td><code>{argument}</code></td>
<td><code>{example}</code></td>
<td class="json-api-example"><code>{example}</code></td>
<td>{required}</td>
<td>{description}</td>
</tr>