Skip to content

Commit 336b498

Browse files
Fix aliases
1 parent 3d1af67 commit 336b498

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

docs/static/overlay.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ td {
2525
/*
2626
Custom formatting for actions
2727
*/
28+
.action-has-keywords > h2 {
29+
margin-bottom: 8px !important;
30+
}
31+
32+
.action-keyword {
33+
margin-bottom: 16px !important;
34+
}
35+
36+
.action-keyword-key {
37+
font-weight: 700 !important;
38+
}
39+
2840
.action-subheading {
2941
margin-bottom: 4px !important;
3042
font-weight: 700 !important;
@@ -43,6 +55,7 @@ Custom formatting for actions
4355
font-size: 95% !important;
4456
}
4557

58+
.action-keyword-values,
4659
.action-table-field-name,
4760
.action-table-field-required,
4861
.action-table-field-type {

linodecli/documentation/templates/_roles.rst.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. role:: action-keyword-key
2+
.. role:: action-keyword-values
13
.. role:: action-table-field-name
24
.. role:: action-table-field-optional
35
.. role:: action-table-field-required

linodecli/documentation/templates/group_action.rst.j2

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99

1010
{% set action_title = action.action[0] %}
1111
{% set action_title_format = "`%s <%s>`_" % (action_title, action.api_documentation_url) if action.api_documentation_url else action_title %}
12+
{% set has_aliases = action.action | length > 1 %}
13+
{% if has_aliases %}
14+
.. rst-class:: action-has-keywords
15+
{% endif %}
16+
1217
.. _commands_{{ action.command }}_{{ action.action[0] }}:
1318

1419
{{ action_title_format }}
1520
{{ "-" * (action_title_format | length) }}
16-
{% if action.action | length > 1 %}
21+
{% if has_aliases %}
22+
23+
.. rst-class:: action-keyword
24+
25+
:action-keyword-key:`Aliases:`
26+
{% for alias in action.action[1:] %}:action-keyword-values:`{{ alias }}`{% if not loop.last %}, {% endif %}{% endfor %}
1727

18-
*Aliases: {{ action[1:] | join(", ") }}*
1928
{% endif %}
2029

2130
{% if action.deprecated %}
@@ -24,6 +33,7 @@
2433
{% endif %}
2534

2635
{{ action.description }}
36+
2737
{% if action.usage %}
2838
{{ usage_tmpl.render(action.usage) }}
2939
{% endif %}

0 commit comments

Comments
 (0)