api docs: Cleaned up CSS for parameter classes.

Deduplicated CSS classes of data types of response and
request parameters in API Documentation to use a single
class.
This commit is contained in:
Suyash Vardhan Mathur
2021-02-06 02:50:28 +05:30
committed by Tim Abbott
parent 9d74c7001d
commit c9c40d4fd2
3 changed files with 10 additions and 11 deletions

View File

@@ -1693,6 +1693,12 @@ label.label-title {
}
}
.api-field-type {
text-transform: lowercase;
font-weight: 600;
font-size: 14px;
}
.api-argument-example-label {
font-style: italic;
}
@@ -1717,16 +1723,9 @@ label.label-title {
font-size: 12px;
color: hsl(0, 50%, 60%);
}
.api-argument-datatype {
text-transform: lowercase;
font-weight: 600;
font-size: 14px;
color: hsl(176, 46.4%, 41%);
}
}
.api-response-datatype {
.api-field-type {
color: hsl(176, 46.4%, 41%);
}

View File

@@ -92,7 +92,7 @@ class APIArgumentsTablePreprocessor(Preprocessor):
table = []
argument_template = """
<div class="api-argument" id="parameter-{argument}">
<p class="api-argument-name"><strong>{argument}</strong> <span class="api-argument-datatype">{type}</span> {required} {deprecated} <a href="#parameter-{argument}" class="api-argument-hover-link"><i class="fa fa-chain"></i></a></p>
<p class="api-argument-name"><strong>{argument}</strong> <span class="api-field-type">{type}</span> {required} {deprecated} <a href="#parameter-{argument}" class="api-argument-hover-link"><i class="fa fa-chain"></i></a></p>
<div class="api-example">
<span class="api-argument-example-label">Example</span>: <code>{example}</code>
</div>

View File

@@ -80,8 +80,8 @@ class APIReturnValuesTablePreprocessor(Preprocessor):
if len(arr) == 1 or '\n' in arr[0]:
return (spacing * " ") + "* " + description
(key_name, key_description) = arr
return (spacing * " ") + "* " + key_name + ": " + '<span class="api-response-datatype">' + data_type + "</span> " + key_description
return (spacing * " ") + "* `" + return_value + "`: " + '<span class="api-response-datatype">' + data_type + "</span> " + description
return (spacing * " ") + "* " + key_name + ": " + '<span class="api-field-type">' + data_type + "</span> " + key_description
return (spacing * " ") + "* `" + return_value + "`: " + '<span class="api-field-type">' + data_type + "</span> " + description
def render_table(self, return_values: Dict[str, Any], spacing: int) -> List[str]:
IGNORE = ["result", "msg"]