iugu-docs-theme 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +50 -0
  4. data/_config.yml +35 -0
  5. data/_data/contentful/spaces/iugu.yaml +26 -0
  6. data/_data/method-colors.yml +5 -0
  7. data/_includes/alert.liquid +7 -0
  8. data/_includes/auth_data.liquid +37 -0
  9. data/_includes/dark_mode_button.liquid +31 -0
  10. data/_includes/footer.html +11 -0
  11. data/_includes/header.html +79 -0
  12. data/_includes/icons/auth.liquid +3 -0
  13. data/_includes/icons/danger.liquid +3 -0
  14. data/_includes/icons/description.liquid +3 -0
  15. data/_includes/icons/info.liquid +3 -0
  16. data/_includes/icons/money.liquid +3 -0
  17. data/_includes/icons/success.liquid +3 -0
  18. data/_includes/icons/warning.liquid +3 -0
  19. data/_includes/icons/wip.liquid +3 -0
  20. data/_includes/lixo.html +10 -0
  21. data/_includes/navigation_widget.liquid +14 -0
  22. data/_includes/openapi_ref.liquid +36 -0
  23. data/_includes/params/card.liquid +18 -0
  24. data/_includes/request/body_example.liquid +27 -0
  25. data/_includes/request/list.liquid +48 -0
  26. data/_includes/response/table.liquid +40 -0
  27. data/_includes/schema/nested_table.liquid +44 -0
  28. data/_includes/schema/table.liquid +36 -0
  29. data/_includes/search_modal.liquid +34 -0
  30. data/_includes/sidebar_menu.liquid +28 -0
  31. data/_includes/toc.html +174 -0
  32. data/_includes/toc_content.liquid +21 -0
  33. data/_includes/widget.liquid +17 -0
  34. data/_includes/widgets_base.liquid +5 -0
  35. data/_layouts/default.html +100 -0
  36. data/_layouts/page.html +5 -0
  37. data/_layouts/post.html +5 -0
  38. data/_plugins/authorization_parser.rb +51 -0
  39. data/_plugins/button_processor.rb +24 -0
  40. data/_plugins/check_required_filter.rb +48 -0
  41. data/_plugins/collapse_link_tag.rb +81 -0
  42. data/_plugins/converters/alert.rb +34 -0
  43. data/_plugins/converters/base_converter.rb +8 -0
  44. data/_plugins/converters/custom.rb +28 -0
  45. data/_plugins/converters/openapi_ref.rb +134 -0
  46. data/_plugins/converters/widget.rb +12 -0
  47. data/_plugins/doc_toc_filter.rb +27 -0
  48. data/_plugins/navigation_widget.rb +49 -0
  49. data/_plugins/response_filter.rb +28 -0
  50. data/_plugins/type_style_filter.rb +23 -0
  51. data/assets/css/application.css +5484 -0
  52. data/assets/css/highlight.css +217 -0
  53. data/assets/js/highlight_menu.js +19 -0
  54. data/assets/js/main.js +110 -0
  55. data/src/css/application.css +100 -0
  56. metadata +209 -0
@@ -0,0 +1,217 @@
1
+ .highlight table td { padding: 5px; }
2
+ .highlight table pre { margin: 0; }
3
+ .highlight {
4
+ color: #ffffff;
5
+ padding: 5px;
6
+ margin: 0px;
7
+ background-color: #262626;
8
+ border-radius: 6px;
9
+ }
10
+ .highlight code {
11
+ color: #ffffff;
12
+ }
13
+ .highlight .gh {
14
+ color: #999999;
15
+ }
16
+ .highlight .sr {
17
+ color: #f6aa11;
18
+ }
19
+ .highlight .go {
20
+ color: #888888;
21
+ }
22
+ .highlight .gp {
23
+ color: #555555;
24
+ }
25
+ .highlight .gs {
26
+ }
27
+ .highlight .gu {
28
+ color: #aaaaaa;
29
+ }
30
+ .highlight .nb {
31
+ color: #f6aa11;
32
+ }
33
+ .highlight .cm {
34
+ color: #75715e;
35
+ }
36
+ .highlight .cp {
37
+ color: #75715e;
38
+ }
39
+ .highlight .c1 {
40
+ color: #75715e;
41
+ }
42
+ .highlight .cs {
43
+ color: #75715e;
44
+ }
45
+ .highlight .c, .highlight .ch, .highlight .cd, .highlight .cpf {
46
+ color: #75715e;
47
+ }
48
+ .highlight .err {
49
+ color: #960050;
50
+ }
51
+ .highlight .gr {
52
+ color: #960050;
53
+ }
54
+ .highlight .gt {
55
+ color: #960050;
56
+ }
57
+ .highlight .gd {
58
+ color: #49483e;
59
+ }
60
+ .highlight .gi {
61
+ color: #49483e;
62
+ }
63
+ .highlight .ge {
64
+ color: #49483e;
65
+ }
66
+ .highlight .kc {
67
+ color: #66d9ef;
68
+ }
69
+ .highlight .kd {
70
+ color: #66d9ef;
71
+ }
72
+ .highlight .kr {
73
+ color: #66d9ef;
74
+ }
75
+ .highlight .no {
76
+ color: #66d9ef;
77
+ }
78
+ .highlight .kt {
79
+ color: #66d9ef;
80
+ }
81
+ .highlight .mf {
82
+ color: #ae81ff;
83
+ }
84
+ .highlight .mh {
85
+ color: #ae81ff;
86
+ }
87
+ .highlight .il {
88
+ color: #ae81ff;
89
+ }
90
+ .highlight .mi {
91
+ color: #ae81ff;
92
+ }
93
+ .highlight .mo {
94
+ color: #ae81ff;
95
+ }
96
+ .highlight .m, .highlight .mb, .highlight .mx {
97
+ color: #ae81ff;
98
+ }
99
+ .highlight .sc {
100
+ color: #ae81ff;
101
+ }
102
+ .highlight .se {
103
+ color: #ae81ff;
104
+ }
105
+ .highlight .ss {
106
+ color: #ae81ff;
107
+ }
108
+ .highlight .sd {
109
+ color: #e6db74;
110
+ }
111
+ .highlight .s2 {
112
+ color: #e6db74;
113
+ }
114
+ .highlight .sb {
115
+ color: #e6db74;
116
+ }
117
+ .highlight .sh {
118
+ color: #e6db74;
119
+ }
120
+ .highlight .si {
121
+ color: #e6db74;
122
+ }
123
+ .highlight .sx {
124
+ color: #e6db74;
125
+ }
126
+ .highlight .s1 {
127
+ color: #e6db74;
128
+ }
129
+ .highlight .s, .highlight .sa, .highlight .dl {
130
+ color: #e6db74;
131
+ }
132
+ .highlight .na {
133
+ color: #a6e22e;
134
+ }
135
+ .highlight .nc {
136
+ color: #a6e22e;
137
+ }
138
+ .highlight .nd {
139
+ color: #a6e22e;
140
+ }
141
+ .highlight .ne {
142
+ color: #a6e22e;
143
+ }
144
+ .highlight .nf, .highlight .fm {
145
+ color: #a6e22e;
146
+ }
147
+ .highlight .vc {
148
+ color: #ffffff;
149
+ background-color: #262626;
150
+ }
151
+ .highlight .nn {
152
+ color: #ffffff;
153
+ background-color: #262626;
154
+ }
155
+ .highlight .nl {
156
+ color: #ffffff;
157
+ background-color: #262626;
158
+ }
159
+ .highlight .ni {
160
+ color: #ffffff;
161
+ background-color: #262626;
162
+ }
163
+ .highlight .bp {
164
+ color: #ffffff;
165
+ background-color: #262626;
166
+ }
167
+ .highlight .vg {
168
+ color: #ffffff;
169
+ background-color: #262626;
170
+ }
171
+ .highlight .vi {
172
+ color: #ffffff;
173
+ background-color: #262626;
174
+ }
175
+ .highlight .nv, .highlight .vm {
176
+ color: #ffffff;
177
+ background-color: #262626;
178
+ }
179
+ .highlight .w {
180
+ color: #ffffff;
181
+ background-color: #262626;
182
+ }
183
+ .highlight .n, .highlight .py, .highlight .nx {
184
+ color: #ffffff;
185
+ background-color: #262626;
186
+ }
187
+ .highlight .ow {
188
+ color: #f92672;
189
+ }
190
+ .highlight .nt {
191
+ color: #f92672;
192
+ }
193
+ .highlight .k, .highlight .kv {
194
+ color: #f92672;
195
+ }
196
+ .highlight .kn {
197
+ color: #f92672;
198
+ }
199
+ .highlight .kp {
200
+ color: #f92672;
201
+ }
202
+ .highlight .o {
203
+ color: #f92672;
204
+ }
205
+
206
+ .highlight .lineno {
207
+ color: #888888;
208
+ font-size: 10px;
209
+ }
210
+
211
+ code.language-plaintext.highlighter-rouge {
212
+ color: inherit;
213
+ font-weight: 100;
214
+ padding: 0.15em 0.3em;
215
+ background-color: #80808025;
216
+ border-radius: 5px;
217
+ }
@@ -0,0 +1,19 @@
1
+ window.addEventListener('DOMContentLoaded', function() {
2
+ document.querySelector('#dark-mode-toggle').addEventListener('click', function() {
3
+ toggleHighlightDarkmode()
4
+ })
5
+ toggleHighlightDarkmode()
6
+ })
7
+
8
+ function toggleHighlightDarkmode() {
9
+ var links = document.querySelectorAll('section[class^="sidebar-menu"] li a')
10
+ links.forEach(link => {
11
+ var href = link.getAttribute('href')
12
+ if (href !== '/') {
13
+ href += '/'
14
+ }
15
+ if (href === window.location.pathname) {
16
+ link.classList.toggle('active')
17
+ }
18
+ })
19
+ }
data/assets/js/main.js ADDED
@@ -0,0 +1,110 @@
1
+ const index = new FlexSearch.Document({
2
+ tokenize: "forward",
3
+ document: {
4
+ id: "id",
5
+ url: "url",
6
+ title: "title",
7
+ store: true,
8
+ index: ["content"]
9
+ }
10
+ });
11
+ const searchInput = document.getElementById("searchInput");
12
+ const searchResultsContainer = document.getElementById("searchResults");
13
+
14
+ async function fetchAndProcessFile(file) {
15
+ var response = ""
16
+ if(file.lastIndexOf("/") == file.length - 1) {
17
+ var path = file
18
+ } else {
19
+ var path = file + "/"
20
+ }
21
+
22
+ response = await fetch(path + "index.html")
23
+ const html = await response.text();
24
+ const content = "p, H1, H2, H3, H4, H5, H6"
25
+
26
+ const tempElement = document.createElement('div');
27
+ tempElement.innerHTML = html;
28
+
29
+ const linkables = tempElement.querySelectorAll(content)
30
+ var link = "";
31
+ var paragraph = link
32
+ var title = ""
33
+ linkables.forEach((element, i) => {
34
+ var link_text = element.textContent.trim()
35
+ link = element.querySelector("a")
36
+ let url = ""
37
+
38
+ if(link && element.tagName != "P") {
39
+ title = link_text
40
+ paragraph = link
41
+ url = path + "#" + link.href.split("#")[1]
42
+ } else if(paragraph){
43
+ url = path + "#" + paragraph.href.split("#")[1]
44
+ }
45
+ index.add({ id: i, url: url, title: title, content: link_text});
46
+ });
47
+ }
48
+
49
+ const files = findHtmlFiles();
50
+ files.forEach((file) => {
51
+ fetchAndProcessFile(file)
52
+ })
53
+
54
+ function displaySearchResults(results) {
55
+ searchResultsContainer.innerHTML = '';
56
+ if (results.length == 0) {
57
+ return;
58
+ };
59
+ const ul = document.createElement("ul")
60
+ ul.classList.add("py-1","bg-neutral-100", 'rounded-md', 'dark:bg-neutral-900', 'outline-none')
61
+ searchResultsContainer.appendChild(ul)
62
+ results[0].result.forEach((matches) => {
63
+ const li = document.createElement("li");
64
+ const div = document.createElement("div");
65
+ const link = document.createElement("a");
66
+ const title = document.createElement("span")
67
+
68
+ li.classList.add("px-2", "py-1")
69
+ div.classList.add("flex", "flex-col", "p-2", "truncate", "bg-neutral-200", "hover:bg-neutral-300", "rounded-md")
70
+ link.classList.add("no-underline", "hover:underline", "text-gray-800", "font-medium")
71
+ title.classList.add("text-xs", "text-gray-500")
72
+
73
+ link.href = matches.doc.url;
74
+ link.textContent = matches.doc.content;
75
+ title.textContent = matches.doc.title;
76
+
77
+ link.addEventListener("click", function() {
78
+ document.getElementById('buttonmodal').style.display = 'none';
79
+ })
80
+ li.appendChild(div)
81
+ div.appendChild(link);
82
+ div.appendChild(title);
83
+ ul.appendChild(li);
84
+ });
85
+ }
86
+
87
+ function performSearch(query) {
88
+ const results = index.search(query, { enrich: true });
89
+ displaySearchResults(results);
90
+ }
91
+
92
+ function findHtmlFiles() {
93
+ const menu = document.getElementById('sidebar-links')
94
+ const links = menu.querySelectorAll('a')
95
+ var hrefs = []
96
+
97
+ links.forEach((link) => {
98
+ hrefs.push(link.href);
99
+ })
100
+ return hrefs
101
+ }
102
+
103
+ searchInput.addEventListener("input", function() {
104
+ const query = searchInput.value.trim();
105
+ if (query.length >= 2) {
106
+ performSearch(query);
107
+ } else {
108
+ searchResultsContainer.innerHTML = '';
109
+ }
110
+ });
@@ -0,0 +1,100 @@
1
+ @import url("https://use.typekit.net/xqk4zue.css");
2
+
3
+ @tailwind base;
4
+ @tailwind components;
5
+ @tailwind utilities;
6
+
7
+ @layer components {
8
+ html {
9
+ scroll-padding-top: 8rem;
10
+ }
11
+ .prose h1 {
12
+ @apply text-3xl;
13
+ }
14
+ .prose h2 {
15
+ @apply text-2xl pt-2 border-t border-neutral-200;
16
+ }
17
+ .prose h3 {
18
+ @apply text-xl;
19
+ }
20
+ .prose h1, .prose h2, .prose h3, .prose h4, .prose h5 {
21
+ @apply mb-2;
22
+ @apply mt-0;
23
+ }
24
+ hr {
25
+ @apply mt-2;
26
+ }
27
+ #toc ul {
28
+ @apply my-0 pl-2 ml-1;
29
+ }
30
+ #toc li a {
31
+ @apply block font-light rounded-sm text-gray-600 dark:text-gray-400 p-1 hover:bg-gray-50 dark:hover:bg-neutral-900;
32
+ @apply hover:font-normal hover:text-black hover:dark:text-gray-200
33
+ }
34
+ #toc li a.active {
35
+ @apply font-normal text-black dark:text-gray-200;
36
+ }
37
+ a.active {
38
+ @apply text-black dark:text-white;
39
+ }
40
+ div.mermaid {
41
+ @apply bg-neutral-50 border rounded-md p-2
42
+ }
43
+ }
44
+
45
+ .prose :where(code):not(:where([class~="not-prose"] *))::before {
46
+ content: "";
47
+ }
48
+ .prose :where(code):not(:where([class~="not-prose"] *))::after {
49
+ content: "";
50
+ }
51
+
52
+ .prose :where(hr):not(:where([class~="not-prose"] *)) {
53
+ margin-bottom: 0.5rem;
54
+ }
55
+
56
+ .prose :where(p):not(:where([class~="not-prose"] *)) {
57
+ margin-top: 0.25rem;
58
+ margin-bottom: 0.25rem;
59
+ }
60
+
61
+ .arrow {
62
+ border: solid black;
63
+ border-width: 0 3px 3px 0;
64
+ display: inline-block;
65
+ padding: 3px;
66
+ }
67
+
68
+ .dark .arrow {
69
+ border: solid white;
70
+ border-width: 0 3px 3px 0;
71
+ display: inline-block;
72
+ padding: 3px;
73
+ }
74
+
75
+
76
+ .right {
77
+ -webkit-transform: rotate(-45deg);
78
+ transform: rotate(-45deg);
79
+ transition: .3s;
80
+ }
81
+
82
+ .down {
83
+ -webkit-transform: rotate(45deg);
84
+ transform: rotate(45deg);
85
+ transition: .3s;
86
+ }
87
+
88
+ .up {
89
+ -webkit-transform: rotate(-135deg);
90
+ transform: rotate(-135deg);
91
+ transition: .3s;
92
+ }
93
+
94
+ [x-cloak] { display: none !important; }
95
+
96
+ .left {
97
+ -webkit-transform: rotate(135deg);
98
+ transform: rotate(135deg);
99
+ transition: .3s;
100
+ }
metadata ADDED
@@ -0,0 +1,209 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iugu-docs-theme
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Patrick Negri
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: google-protobuf
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: kramdown-syntax-coderay
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: yaml
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jekyll-toc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: jekyll-multiple-languages-plugin
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: gitlab_kramdown
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: jekyll-contentful-data-import
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description:
126
+ email:
127
+ - patrick@iugu.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - LICENSE.txt
133
+ - README.md
134
+ - _config.yml
135
+ - _data/contentful/spaces/iugu.yaml
136
+ - _data/method-colors.yml
137
+ - _includes/alert.liquid
138
+ - _includes/auth_data.liquid
139
+ - _includes/dark_mode_button.liquid
140
+ - _includes/footer.html
141
+ - _includes/header.html
142
+ - _includes/icons/auth.liquid
143
+ - _includes/icons/danger.liquid
144
+ - _includes/icons/description.liquid
145
+ - _includes/icons/info.liquid
146
+ - _includes/icons/money.liquid
147
+ - _includes/icons/success.liquid
148
+ - _includes/icons/warning.liquid
149
+ - _includes/icons/wip.liquid
150
+ - _includes/lixo.html
151
+ - _includes/navigation_widget.liquid
152
+ - _includes/openapi_ref.liquid
153
+ - _includes/params/card.liquid
154
+ - _includes/request/body_example.liquid
155
+ - _includes/request/list.liquid
156
+ - _includes/response/table.liquid
157
+ - _includes/schema/nested_table.liquid
158
+ - _includes/schema/table.liquid
159
+ - _includes/search_modal.liquid
160
+ - _includes/sidebar_menu.liquid
161
+ - _includes/toc.html
162
+ - _includes/toc_content.liquid
163
+ - _includes/widget.liquid
164
+ - _includes/widgets_base.liquid
165
+ - _layouts/default.html
166
+ - _layouts/page.html
167
+ - _layouts/post.html
168
+ - _plugins/authorization_parser.rb
169
+ - _plugins/button_processor.rb
170
+ - _plugins/check_required_filter.rb
171
+ - _plugins/collapse_link_tag.rb
172
+ - _plugins/converters/alert.rb
173
+ - _plugins/converters/base_converter.rb
174
+ - _plugins/converters/custom.rb
175
+ - _plugins/converters/openapi_ref.rb
176
+ - _plugins/converters/widget.rb
177
+ - _plugins/doc_toc_filter.rb
178
+ - _plugins/navigation_widget.rb
179
+ - _plugins/response_filter.rb
180
+ - _plugins/type_style_filter.rb
181
+ - assets/css/application.css
182
+ - assets/css/highlight.css
183
+ - assets/js/highlight_menu.js
184
+ - assets/js/main.js
185
+ - src/css/application.css
186
+ homepage:
187
+ licenses:
188
+ - MIT
189
+ metadata: {}
190
+ post_install_message:
191
+ rdoc_options: []
192
+ require_paths:
193
+ - _plugins
194
+ required_ruby_version: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ required_rubygems_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
204
+ requirements: []
205
+ rubygems_version: 3.3.26
206
+ signing_key:
207
+ specification_version: 4
208
+ summary: Jekyll Standard Theme for Iugu Documentation
209
+ test_files: []