Skip to content

Commit 3287345

Browse files
authored
Merge pull request #8636 from wazuh/enhancement/164-redoc-theme-4.12
[4.12] Sphinx theme: Redoc theme option
2 parents 021eae1 + b57f081 commit 3287345

File tree

7 files changed

+2696
-851
lines changed

7 files changed

+2696
-851
lines changed

source/_themes/wazuh_doc_theme_v3/api-redoc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
{% endblock %}
66

77
{%- block redoc %}
8-
<redoc spec-url='{{ apiURL }}' scroll-y-offset="110"></redoc>
8+
<redoc spec-url='{{ apiURL }}' scroll-y-offset="110" theme='{{ redoc_theme }}'></redoc>
99
{% endblock redoc %}

source/_themes/wazuh_doc_theme_v3/cloud-api-redoc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
{% endblock %}
66

77
{%- block redoc %}
8-
<redoc spec-url="https://raw.githubusercontent.com/wazuh/wazuh-documentation/current/resources/cloud/spec.yml" scroll-y-offset="110"></redoc>
8+
<redoc spec-url="https://raw.githubusercontent.com/wazuh/wazuh-documentation/current/resources/cloud/spec.yml" scroll-y-offset="110" theme='{{ redoc_theme }}'></redoc>
99
{% endblock redoc %}

source/_themes/wazuh_doc_theme_v3/redoc-master.html

Lines changed: 140 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,143 @@
11
{%- extends "!wazuh_doc_theme_v3/template-parts/body.html" -%}
22

3+
{% set redoc_theme = '{
4+
"codeBlock": {
5+
"backgroundColor": "#25252c"
6+
},
7+
"colors": {
8+
"error": {
9+
"main": "#bd271e"
10+
},
11+
"primary": {
12+
"main": "#3585f9"
13+
},
14+
"http": {
15+
"delete": "#f86b63",
16+
"get": "#207d82",
17+
"post": "#6ca2f0",
18+
"put": "#b677dc"
19+
},
20+
"responses": {
21+
"error": {
22+
"backgroundColor": "rgba(248,107,99,.2)",
23+
"color": "#bd271e",
24+
"tabTextColor": "#ffffff"
25+
},
26+
"success": {
27+
"backgroundColor": "rgba(32,125,130,.2)",
28+
"color": "#207d82",
29+
"tabTextColor": "#ffffff"
30+
}
31+
},
32+
"success": {
33+
"main": "#207d82"
34+
},
35+
"text": {
36+
"primary": "#000000",
37+
"secondary": "#757575"
38+
},
39+
"tonalOffset": 0
40+
},
41+
"fab": {
42+
"backgroundColor": "transparent",
43+
"color": "#256bd1"
44+
},
45+
"rightPanel": {
46+
"backgroundColor": "#2a2d34",
47+
"textColor": "#ffffff"
48+
},
49+
"schema": {
50+
"caretColor": "#256bd1",
51+
"labelsTextSize": "14px",
52+
"linesColor": "#3585f9",
53+
"nestedBackground": "#f7f7f7",
54+
"nestingSpacing": "1em",
55+
"requireLabelColor": "#f86b63",
56+
"typeNameColor": "#8c8c8c",
57+
"typeTitleColor": "#545f73"
58+
},
59+
"sidebar": {
60+
"activeBgColor": "#3585f9",
61+
"activeTextColor": "#ffffff",
62+
"backgroundColor": "#ebf2fb",
63+
"fontSize": "16px",
64+
"level1Items": {
65+
"textTransform": "uppercase"
66+
},
67+
"spacing": {
68+
"unit": "6",
69+
"paddingVertical": "36px"
70+
},
71+
"textColor": "#292929",
72+
"width": "294px"
73+
},
74+
"spacing": {
75+
"unit": 5,
76+
"sectionHorizontal": 40,
77+
"sectionVertical": 40
78+
},
79+
"typography": {
80+
"code": {
81+
"backgroundColor": "#e2eefe",
82+
"color": "#7c3db2",
83+
"fontFamily": "Fira Mono, monospace",
84+
"fontSize": "14px",
85+
"fontWeight": "400",
86+
"lineHeight": "32px"
87+
},
88+
"fontFamily": "Manrope, sans-serif",
89+
"fontSize": "16px",
90+
"fontWeightBold": "600",
91+
"fontWeightLight": "400",
92+
"fontWeightRegular": "400",
93+
"lineHeight": "32px",
94+
"smoothing": "antialiased",
95+
"optimizeSpeed": "true",
96+
"headings": {
97+
"fontFamily": "Manrope, sans-serif",
98+
"fontWeight": "600",
99+
"lineHeight": "1.44em"
100+
},
101+
"links": {
102+
"color": "#256bd1",
103+
"visited": "#256bd1",
104+
"hover": "#3585f9",
105+
"textDecoration": "none",
106+
"hoverTextDecoration": "none"
107+
},
108+
"rightPanelHeading": {
109+
"transform": "uppercase"
110+
}
111+
}
112+
}'
113+
%}
114+
115+
{#
116+
117+
"sidebar"
118+
"groupItems" # Group headings
119+
"activeBackgroundColor": # COMPUTED: theme.sidebar.backgroundColor
120+
"activeTextColor": # COMPUTED: theme.sidebar.activeTextColor
121+
"textTransform": "uppercase"
122+
"level1Items" # Level 1 items like tags or section 1st level items
123+
"activeBackgroundColor": # COMPUTED: theme.sidebar.backgroundColor
124+
"activeTextColor": # COMPUTED: theme.sidebar.activeTextColor
125+
"textTransform": "none"
126+
"arrow" # sidebar arrow
127+
"size": "1.5em"
128+
"color": # COMPUTED: theme.sidebar.textColor
129+
"rightPanel"
130+
"backgroundColor": "#263238"
131+
"width": "40%"
132+
"textColor": "#ffffff"
133+
"servers"
134+
"overlay"
135+
"backgroundColor": "#fafafa"
136+
"textColor": "#263238"
137+
"url"
138+
"backgroundColor": "#fff"
139+
#}
140+
3141
{%- block htmltitle -%}
4142
<title>API reference{{ titlesuffix }}</title>
5143
{% endblock htmltitle -%}
@@ -16,10 +154,10 @@
16154
</div>
17155
</footer>
18156
</div>
157+
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.js"> </script> -->
19158
{% endblock %}
20159

21160
{%- block header %}
22-
<div class="inner-body">
23161
<header>
24162
{%- block latest %}
25163
{% include "template-parts/no-latest-notice.html" %}
@@ -35,7 +173,7 @@
35173
{% include "template-parts/version-selector.html" %}
36174
</div>
37175
{% endif %}
38-
</header></div>
176+
</header>
39177
{% endblock header -%}
40178

41179
{% block sidebar1 -%}{% endblock sidebar1 -%}

0 commit comments

Comments
 (0)