From a72e9476ee2e3cb4c905ac6fd1361ea28eb0e452 Mon Sep 17 00:00:00 2001 From: Amitsinghyadav Date: Mon, 21 Sep 2020 22:36:40 +0530 Subject: [PATCH] api_docs: Add fragment references for all parameters. This makes it convenient to link to a specific parameter accepted by Zulip API endpoint. --- static/styles/portico/portico.css | 12 ++++++++++++ zerver/lib/markdown/api_arguments_table_generator.py | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/static/styles/portico/portico.css b/static/styles/portico/portico.css index bf0cd496dc..a28d61eea7 100644 --- a/static/styles/portico/portico.css +++ b/static/styles/portico/portico.css @@ -1680,6 +1680,17 @@ label.label-title { .api-argument { .api-argument-name { 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 { @@ -1692,6 +1703,7 @@ label.label-title { font-size: 12px; color: hsl(14, 75%, 60%); } + .api-argument-optional { text-transform: uppercase; font-weight: 400; diff --git a/zerver/lib/markdown/api_arguments_table_generator.py b/zerver/lib/markdown/api_arguments_table_generator.py index 4c0852755e..f186a7e6a5 100644 --- a/zerver/lib/markdown/api_arguments_table_generator.py +++ b/zerver/lib/markdown/api_arguments_table_generator.py @@ -91,8 +91,8 @@ class APIArgumentsTablePreprocessor(Preprocessor): # TODO: Fix naming now that this no longer renders a table. table = [] argument_template = """ -
-

{argument} {required} {deprecated}

+
+

{argument} {required} {deprecated}

Example: {example}