mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
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:
committed by
Tim Abbott
parent
9d74c7001d
commit
c9c40d4fd2
@@ -1693,6 +1693,12 @@ label.label-title {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.api-field-type {
|
||||||
|
text-transform: lowercase;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.api-argument-example-label {
|
.api-argument-example-label {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
@@ -1717,16 +1723,9 @@ label.label-title {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: hsl(0, 50%, 60%);
|
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%);
|
color: hsl(176, 46.4%, 41%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class APIArgumentsTablePreprocessor(Preprocessor):
|
|||||||
table = []
|
table = []
|
||||||
argument_template = """
|
argument_template = """
|
||||||
<div class="api-argument" id="parameter-{argument}">
|
<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">
|
<div class="api-example">
|
||||||
<span class="api-argument-example-label">Example</span>: <code>{example}</code>
|
<span class="api-argument-example-label">Example</span>: <code>{example}</code>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ class APIReturnValuesTablePreprocessor(Preprocessor):
|
|||||||
if len(arr) == 1 or '\n' in arr[0]:
|
if len(arr) == 1 or '\n' in arr[0]:
|
||||||
return (spacing * " ") + "* " + description
|
return (spacing * " ") + "* " + description
|
||||||
(key_name, key_description) = arr
|
(key_name, key_description) = arr
|
||||||
return (spacing * " ") + "* " + key_name + ": " + '<span class="api-response-datatype">' + data_type + "</span> " + key_description
|
return (spacing * " ") + "* " + key_name + ": " + '<span class="api-field-type">' + data_type + "</span> " + key_description
|
||||||
return (spacing * " ") + "* `" + return_value + "`: " + '<span class="api-response-datatype">' + data_type + "</span> " + 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]:
|
def render_table(self, return_values: Dict[str, Any], spacing: int) -> List[str]:
|
||||||
IGNORE = ["result", "msg"]
|
IGNORE = ["result", "msg"]
|
||||||
|
|||||||
Reference in New Issue
Block a user