api_docs: Add fragment references for all parameters.

This makes it convenient to link to a specific parameter accepted by
Zulip API endpoint.
This commit is contained in:
Amitsinghyadav 2020-09-21 22:36:40 +05:30 committed by Tim Abbott
parent 2b9f7916c5
commit a72e9476ee
2 changed files with 14 additions and 2 deletions

View File

@ -1680,6 +1680,17 @@ label.label-title {
.api-argument { .api-argument {
.api-argument-name { .api-argument-name {
font-family: monospace; font-family: monospace;
.api-argument-hover-link i.fa {
opacity: 0;
font-size: 0.9em;
}
&:hover .api-argument-hover-link i.fa {
opacity: 1;
color: hsl(0, 0%, 0%);
cursor: pointer;
}
} }
.api-argument-example-label { .api-argument-example-label {
@ -1692,6 +1703,7 @@ label.label-title {
font-size: 12px; font-size: 12px;
color: hsl(14, 75%, 60%); color: hsl(14, 75%, 60%);
} }
.api-argument-optional { .api-argument-optional {
text-transform: uppercase; text-transform: uppercase;
font-weight: 400; font-weight: 400;

View File

@ -91,8 +91,8 @@ class APIArgumentsTablePreprocessor(Preprocessor):
# TODO: Fix naming now that this no longer renders a table. # TODO: Fix naming now that this no longer renders a table.
table = [] table = []
argument_template = """ argument_template = """
<div class="api-argument"> <div class="api-argument" id="parameter-{argument}">
<p class="api-argument-name"><strong>{argument}</strong> {required} {deprecated}</p> <p class="api-argument-name"><strong>{argument}</strong> {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>