docyard 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -1
- data/LICENSE.vscode-icons +42 -0
- data/README.md +46 -5
- data/lib/docyard/asset_handler.rb +33 -0
- data/lib/docyard/components/base_processor.rb +24 -0
- data/lib/docyard/components/callout_processor.rb +121 -0
- data/lib/docyard/components/code_block_processor.rb +55 -0
- data/lib/docyard/components/code_detector.rb +59 -0
- data/lib/docyard/components/icon_detector.rb +57 -0
- data/lib/docyard/components/icon_processor.rb +51 -0
- data/lib/docyard/components/registry.rb +34 -0
- data/lib/docyard/components/tabs_parser.rb +60 -0
- data/lib/docyard/components/tabs_processor.rb +44 -0
- data/lib/docyard/config/validator.rb +171 -0
- data/lib/docyard/config.rb +133 -0
- data/lib/docyard/constants.rb +5 -0
- data/lib/docyard/icons/LICENSE.phosphor +21 -0
- data/lib/docyard/icons/file_types.rb +92 -0
- data/lib/docyard/icons/phosphor.rb +63 -0
- data/lib/docyard/icons.rb +40 -0
- data/lib/docyard/initializer.rb +20 -2
- data/lib/docyard/language_mapping.rb +52 -0
- data/lib/docyard/markdown.rb +14 -3
- data/lib/docyard/rack_application.rb +76 -7
- data/lib/docyard/renderer.rb +40 -7
- data/lib/docyard/server.rb +5 -2
- data/lib/docyard/sidebar_builder.rb +10 -2
- data/lib/docyard/templates/assets/css/code.css +150 -2
- data/lib/docyard/templates/assets/css/components/callout.css +169 -0
- data/lib/docyard/templates/assets/css/components/code-block.css +196 -0
- data/lib/docyard/templates/assets/css/components/icon.css +16 -0
- data/lib/docyard/templates/assets/css/components/logo.css +44 -0
- data/lib/docyard/templates/assets/css/{components.css → components/navigation.css} +47 -47
- data/lib/docyard/templates/assets/css/components/tabs.css +298 -0
- data/lib/docyard/templates/assets/css/components/theme-toggle.css +61 -0
- data/lib/docyard/templates/assets/css/layout.css +14 -4
- data/lib/docyard/templates/assets/css/markdown.css +9 -8
- data/lib/docyard/templates/assets/css/reset.css +4 -0
- data/lib/docyard/templates/assets/css/variables.css +94 -3
- data/lib/docyard/templates/assets/favicon.svg +16 -0
- data/lib/docyard/templates/assets/js/components/code-block.js +162 -0
- data/lib/docyard/templates/assets/js/components/tabs.js +338 -0
- data/lib/docyard/templates/assets/js/theme.js +16 -0
- data/lib/docyard/templates/assets/logo-dark.svg +4 -0
- data/lib/docyard/templates/assets/logo.svg +12 -0
- data/lib/docyard/templates/config/docyard.yml.erb +20 -0
- data/lib/docyard/templates/layouts/default.html.erb +31 -3
- data/lib/docyard/templates/markdown/components/callouts.md.erb +204 -0
- data/lib/docyard/templates/markdown/components/icons.md.erb +125 -0
- data/lib/docyard/templates/markdown/components/tabs.md.erb +686 -0
- data/lib/docyard/templates/markdown/configuration.md.erb +202 -0
- data/lib/docyard/templates/partials/_callout.html.erb +11 -0
- data/lib/docyard/templates/partials/_code_block.html.erb +6 -0
- data/lib/docyard/templates/partials/_icon.html.erb +1 -0
- data/lib/docyard/templates/partials/_icon_file_extension.html.erb +1 -0
- data/lib/docyard/templates/partials/_tabs.html.erb +40 -0
- data/lib/docyard/templates/partials/_theme_toggle.html.erb +13 -0
- data/lib/docyard/version.rb +1 -1
- metadata +41 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../renderer"
|
|
4
|
+
require_relative "base_processor"
|
|
5
|
+
require_relative "tabs_parser"
|
|
6
|
+
require "securerandom"
|
|
7
|
+
|
|
8
|
+
module Docyard
|
|
9
|
+
module Components
|
|
10
|
+
class TabsProcessor < BaseProcessor
|
|
11
|
+
self.priority = 15
|
|
12
|
+
|
|
13
|
+
def preprocess(content)
|
|
14
|
+
return content unless content.include?(":::tabs")
|
|
15
|
+
|
|
16
|
+
content.gsub(/^:::[ \t]*tabs[ \t]*\n(.*?)^:::[ \t]*$/m) do
|
|
17
|
+
process_tabs_block(Regexp.last_match(1))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def process_tabs_block(tabs_content)
|
|
24
|
+
tabs = TabsParser.parse(tabs_content)
|
|
25
|
+
return "" if tabs.empty?
|
|
26
|
+
|
|
27
|
+
wrap_in_nomarkdown(render_tabs(tabs))
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def render_tabs(tabs)
|
|
31
|
+
Renderer.new.render_partial(
|
|
32
|
+
"_tabs", {
|
|
33
|
+
tabs: tabs,
|
|
34
|
+
group_id: SecureRandom.hex(4)
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def wrap_in_nomarkdown(html)
|
|
40
|
+
"{::nomarkdown}\n#{html}\n{:/nomarkdown}"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Docyard
|
|
4
|
+
class Config
|
|
5
|
+
class Validator
|
|
6
|
+
def initialize(config_data)
|
|
7
|
+
@config = config_data
|
|
8
|
+
@errors = []
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def validate!
|
|
12
|
+
validate_site_section
|
|
13
|
+
validate_branding_section
|
|
14
|
+
validate_build_section
|
|
15
|
+
|
|
16
|
+
raise ConfigError, format_errors if @errors.any?
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def validate_site_section
|
|
22
|
+
site = @config["site"]
|
|
23
|
+
|
|
24
|
+
validate_string(site["title"], "site.title")
|
|
25
|
+
validate_string(site["description"], "site.description")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def validate_branding_section
|
|
29
|
+
branding = @config["branding"]
|
|
30
|
+
return unless branding
|
|
31
|
+
|
|
32
|
+
validate_file_path_or_url(branding["logo"], "branding.logo")
|
|
33
|
+
validate_file_path_or_url(branding["logo_dark"], "branding.logo_dark")
|
|
34
|
+
validate_file_path_or_url(branding["favicon"], "branding.favicon")
|
|
35
|
+
|
|
36
|
+
appearance = branding["appearance"] || {}
|
|
37
|
+
validate_boolean(appearance["logo"], "branding.appearance.logo")
|
|
38
|
+
validate_boolean(appearance["title"], "branding.appearance.title")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def validate_build_section
|
|
42
|
+
build = @config["build"]
|
|
43
|
+
|
|
44
|
+
validate_string(build["output_dir"], "build.output_dir")
|
|
45
|
+
validate_no_slashes(build["output_dir"], "build.output_dir")
|
|
46
|
+
validate_string(build["base_url"], "build.base_url")
|
|
47
|
+
validate_starts_with_slash(build["base_url"], "build.base_url")
|
|
48
|
+
validate_boolean(build["clean"], "build.clean")
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def validate_string(value, field_name)
|
|
52
|
+
return if value.nil?
|
|
53
|
+
return if value.is_a?(String)
|
|
54
|
+
|
|
55
|
+
add_error(
|
|
56
|
+
field: field_name,
|
|
57
|
+
error: "must be a string",
|
|
58
|
+
got: value.class.name,
|
|
59
|
+
fix: "Change to a string value"
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def validate_boolean(value, field_name)
|
|
64
|
+
return if [true, false].include?(value)
|
|
65
|
+
|
|
66
|
+
add_error(
|
|
67
|
+
field: field_name,
|
|
68
|
+
error: "must be true or false",
|
|
69
|
+
got: value.inspect,
|
|
70
|
+
fix: "Change to true or false"
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def validate_file_path(value, field_name)
|
|
75
|
+
return if value.nil?
|
|
76
|
+
return add_file_path_type_error(value, field_name) unless value.is_a?(String)
|
|
77
|
+
|
|
78
|
+
file_path = if File.absolute_path?(value)
|
|
79
|
+
value
|
|
80
|
+
else
|
|
81
|
+
File.join("docs", value)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
return if File.exist?(file_path)
|
|
85
|
+
|
|
86
|
+
add_file_not_found_error(value, field_name)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def add_file_path_type_error(value, field_name)
|
|
90
|
+
add_error(
|
|
91
|
+
field: field_name,
|
|
92
|
+
error: "must be a file path (string)",
|
|
93
|
+
got: value.class.name,
|
|
94
|
+
fix: "Change to a string file path"
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def add_file_not_found_error(value, field_name)
|
|
99
|
+
add_error(
|
|
100
|
+
field: field_name,
|
|
101
|
+
error: "file not found",
|
|
102
|
+
got: value,
|
|
103
|
+
fix: "Place the file in docs/ directory and use a relative path (e.g., 'assets/logo.svg')"
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def validate_no_slashes(value, field_name)
|
|
108
|
+
return if value.nil?
|
|
109
|
+
return unless value.is_a?(String)
|
|
110
|
+
return unless value.include?("/") || value.include?("\\")
|
|
111
|
+
|
|
112
|
+
add_error(
|
|
113
|
+
field: field_name,
|
|
114
|
+
error: "cannot contain slashes",
|
|
115
|
+
got: value,
|
|
116
|
+
fix: "Use a simple directory name like 'dist' or '_site'"
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def validate_starts_with_slash(value, field_name)
|
|
121
|
+
return if value.nil?
|
|
122
|
+
return if value.start_with?("/")
|
|
123
|
+
|
|
124
|
+
add_error(
|
|
125
|
+
field: field_name,
|
|
126
|
+
error: "must start with /",
|
|
127
|
+
got: value,
|
|
128
|
+
fix: "Change to '/#{value}'"
|
|
129
|
+
)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def validate_file_path_or_url(value, field_name)
|
|
133
|
+
return if value.nil?
|
|
134
|
+
return add_file_path_type_error(value, field_name) unless value.is_a?(String)
|
|
135
|
+
|
|
136
|
+
return if url?(value)
|
|
137
|
+
|
|
138
|
+
file_path = if File.absolute_path?(value)
|
|
139
|
+
value
|
|
140
|
+
else
|
|
141
|
+
File.join("docs", value)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
return if File.exist?(file_path)
|
|
145
|
+
|
|
146
|
+
add_file_not_found_error(value, field_name)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def url?(value)
|
|
150
|
+
value.match?(%r{\Ahttps?://})
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def add_error(error_data)
|
|
154
|
+
@errors << error_data
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def format_errors
|
|
158
|
+
message = "Error in docyard.yml:\n\n"
|
|
159
|
+
|
|
160
|
+
@errors.each do |err|
|
|
161
|
+
message += " Field: #{err[:field]}\n"
|
|
162
|
+
message += " Error: #{err[:error]}\n"
|
|
163
|
+
message += " Got: #{err[:got]}\n"
|
|
164
|
+
message += " Fix: #{err[:fix]}\n\n"
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
message.chomp
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "yaml"
|
|
4
|
+
require_relative "config/validator"
|
|
5
|
+
require_relative "constants"
|
|
6
|
+
|
|
7
|
+
module Docyard
|
|
8
|
+
class Config
|
|
9
|
+
DEFAULT_CONFIG = {
|
|
10
|
+
"site" => {
|
|
11
|
+
"title" => Constants::DEFAULT_SITE_TITLE,
|
|
12
|
+
"description" => ""
|
|
13
|
+
},
|
|
14
|
+
"branding" => {
|
|
15
|
+
"logo" => nil,
|
|
16
|
+
"logo_dark" => nil,
|
|
17
|
+
"favicon" => nil,
|
|
18
|
+
"appearance" => {
|
|
19
|
+
"logo" => true,
|
|
20
|
+
"title" => true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"build" => {
|
|
24
|
+
"output_dir" => "dist",
|
|
25
|
+
"base_url" => "/",
|
|
26
|
+
"clean" => true
|
|
27
|
+
},
|
|
28
|
+
"sidebar" => nil
|
|
29
|
+
}.freeze
|
|
30
|
+
|
|
31
|
+
attr_reader :data, :file_path
|
|
32
|
+
|
|
33
|
+
def self.load(project_root = Dir.pwd)
|
|
34
|
+
new(project_root)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def initialize(project_root = Dir.pwd)
|
|
38
|
+
@project_root = project_root
|
|
39
|
+
@file_path = File.join(project_root, "docyard.yml")
|
|
40
|
+
@data = load_config_data
|
|
41
|
+
validate!
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def file_exists?
|
|
45
|
+
File.exist?(file_path)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def site
|
|
49
|
+
@site ||= ConfigSection.new(data["site"])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def branding
|
|
53
|
+
@branding ||= ConfigSection.new(data["branding"])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def build
|
|
57
|
+
@build ||= ConfigSection.new(data["build"])
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def sidebar
|
|
61
|
+
data["sidebar"]
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
private
|
|
65
|
+
|
|
66
|
+
def load_config_data
|
|
67
|
+
if file_exists?
|
|
68
|
+
load_and_merge_config
|
|
69
|
+
else
|
|
70
|
+
deep_dup(DEFAULT_CONFIG)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def load_and_merge_config
|
|
75
|
+
yaml_content = YAML.load_file(file_path)
|
|
76
|
+
deep_merge(deep_dup(DEFAULT_CONFIG), yaml_content || {})
|
|
77
|
+
rescue Psych::SyntaxError => e
|
|
78
|
+
raise ConfigError, build_yaml_error_message(e)
|
|
79
|
+
rescue StandardError => e
|
|
80
|
+
raise ConfigError, "Error loading docyard.yml: #{e.message}"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def deep_merge(hash1, hash2)
|
|
84
|
+
hash1.merge(hash2) do |_key, v1, v2|
|
|
85
|
+
if v2.nil?
|
|
86
|
+
v1
|
|
87
|
+
elsif v1.is_a?(Hash) && v2.is_a?(Hash)
|
|
88
|
+
deep_merge(v1, v2)
|
|
89
|
+
else
|
|
90
|
+
v2
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def deep_dup(hash)
|
|
96
|
+
hash.transform_values { |value| value.is_a?(Hash) ? deep_dup(value) : value }
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def build_yaml_error_message(error)
|
|
100
|
+
message = "Invalid YAML in docyard.yml:\n\n"
|
|
101
|
+
message += " #{error.message}\n\n"
|
|
102
|
+
message += "Fix: Check YAML syntax"
|
|
103
|
+
message += " at line #{error.line}" if error.respond_to?(:line)
|
|
104
|
+
message
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def validate!
|
|
108
|
+
Validator.new(data).validate!
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class ConfigSection
|
|
113
|
+
def initialize(data)
|
|
114
|
+
@data = data || {}
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def appearance
|
|
118
|
+
@data["appearance"]
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def method_missing(method, *args)
|
|
122
|
+
return @data[method.to_s] if args.empty?
|
|
123
|
+
|
|
124
|
+
super
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def respond_to_missing?(method, include_private = false)
|
|
128
|
+
@data.key?(method.to_s) || super
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
class ConfigError < StandardError; end
|
|
133
|
+
end
|
data/lib/docyard/constants.rb
CHANGED
|
@@ -19,5 +19,10 @@ module Docyard
|
|
|
19
19
|
STATUS_OK = 200
|
|
20
20
|
STATUS_NOT_FOUND = 404
|
|
21
21
|
STATUS_INTERNAL_ERROR = 500
|
|
22
|
+
|
|
23
|
+
DEFAULT_SITE_TITLE = "Documentation"
|
|
24
|
+
DEFAULT_LOGO_PATH = "assets/logo.svg"
|
|
25
|
+
DEFAULT_LOGO_DARK_PATH = "assets/logo-dark.svg"
|
|
26
|
+
DEFAULT_FAVICON_PATH = "assets/favicon.svg"
|
|
22
27
|
end
|
|
23
28
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2023 Phosphor Icons
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Docyard
|
|
4
|
+
module Icons
|
|
5
|
+
# File Type Icons from VSCode Icons
|
|
6
|
+
#
|
|
7
|
+
# Source: https://github.com/vscode-icons/vscode-icons
|
|
8
|
+
# License: CC BY-SA 4.0 (see LICENSE.vscode-icons)
|
|
9
|
+
# Copyright (c) 2016 Roberto Huertas
|
|
10
|
+
module FileTypes
|
|
11
|
+
# SVG content for each file type icon
|
|
12
|
+
# rubocop:disable Layout/LineLength
|
|
13
|
+
ICONS = {
|
|
14
|
+
"css" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" aria-labelledby="css-logo-title css-logo-description"><title>CSS Logo</title><g style="display:inline"><path fill="#639" d="M1.995 1.994h23.52a4.48 4.48 0 0 1 4.48 4.48v19.04a4.48 4.48 0 0 1-4.48 4.48H6.475a4.48 4.48 0 0 1-4.48-4.48Z"/><path fill="#fff" d="M9.079 24.87v-4.704c0-1.876 1.204-2.884 3.024-2.884 1.792-.028 2.912 1.148 2.856 3.136h-2.072c.056-.756-.28-1.316-.84-1.288-.7 0-.896.476-.896 1.372v4.088c0 .868.28 1.288.896 1.316.644 0 .896-.644.84-1.372h2.072c.112 2.044-1.176 3.248-2.996 3.22-1.764 0-2.884-.98-2.884-2.884zm6.636-.336h1.932c.028.896.308 1.456.924 1.456.616 0 .84-.364.84-1.204 0-.7-.308-1.092-1.064-1.456l-.728-.336c-1.288-.616-1.82-1.372-1.82-2.884 0-1.68 1.064-2.856 2.8-2.856 1.736 0 2.66 1.204 2.688 3.164h-1.876c0-.812-.168-1.372-.784-1.372-.56 0-.84.28-.84.98s.252.98.924 1.26l.672.308c1.428.672 2.044 1.54 2.044 3.164 0 1.932-1.092 2.996-2.884 2.996-1.792 0-2.8-1.232-2.828-3.22zm6.328 0h1.96c0 .896.308 1.456.896 1.456.588 0 .84-.364.84-1.204 0-.7-.28-1.092-1.064-1.456l-.728-.336c-1.288-.616-1.792-1.372-1.792-2.884 0-1.68 1.036-2.856 2.8-2.856 1.764 0 2.632 1.204 2.688 3.164h-1.876c-.028-.812-.196-1.372-.812-1.372-.56 0-.812.28-.812.98s.224.98.896 1.26l.7.308c1.4.672 2.016 1.54 2.016 3.164 0 1.932-1.092 2.996-2.884 2.996-1.792 0-2.8-1.232-2.828-3.22z"/></g></svg>',
|
|
15
|
+
"go" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 254.5 225"><title>file_type_go</title><path d="M-46.926,89c-.621,0-.777-.311-.466-.777l3.262-4.194a2.225,2.225,0,0,1,1.708-.777H13.026c.621,0,.777.466.466.932l-2.64,4.038a2.367,2.367,0,0,1-1.553.932Z" style="fill:#00acd7"/><path d="M-70.379,103.285c-.621,0-.777-.311-.466-.777l3.262-4.194a2.225,2.225,0,0,1,1.708-.777H4.95a.714.714,0,0,1,.777.932L4.484,102.2a1.358,1.358,0,0,1-1.4.932Z" style="fill:#00acd7"/><path d="M-32.792,117.574c-.621,0-.777-.466-.466-.932l2.174-3.883a2.06,2.06,0,0,1,1.553-.932H1.533c.621,0,.932.466.932,1.087l-.311,3.728a1.167,1.167,0,0,1-1.087,1.087Z" style="fill:#00acd7"/><path d="M128.426,86.2c-9.785,2.485-16.464,4.349-26.093,6.834-2.33.621-2.485.777-4.5-1.553-2.33-2.64-4.038-4.349-7.3-5.9-9.785-4.815-19.259-3.417-28.112,2.33-10.561,6.834-16,16.929-15.842,29.51.155,12.425,8.7,22.676,20.968,24.385,10.561,1.4,19.414-2.33,26.4-10.251,1.4-1.708,2.64-3.572,4.194-5.747H68.163c-3.262,0-4.038-2.019-2.951-4.659,2.019-4.815,5.747-12.891,7.921-16.929a4.194,4.194,0,0,1,3.883-2.485h56.535c-.311,4.194-.311,8.387-.932,12.581a66.239,66.239,0,0,1-12.736,30.442C108.7,159.51,94.1,168.673,75.618,171.158c-15.221,2.019-29.355-.932-41.78-10.251a48.785,48.785,0,0,1-19.725-34.48c-2.019-16.929,2.951-32.15,13.2-45.508C38.342,66.475,52.942,57.312,70.8,54.05c14.6-2.64,28.578-.932,41.159,7.61a48.686,48.686,0,0,1,18.017,21.9C130.911,84.958,130.289,85.735,128.426,86.2Z" style="fill:#00acd7"/><path d="M179.835,172.09c-14.134-.311-27.025-4.349-37.9-13.668a48.711,48.711,0,0,1-16.774-29.976c-2.8-17.551,2.019-33.082,12.581-46.905,11.338-14.91,25.006-22.676,43.488-25.938,15.842-2.8,30.753-1.243,44.265,7.921,12.27,8.387,19.88,19.725,21.9,34.635,2.64,20.968-3.417,38.052-17.861,52.652a71.17,71.17,0,0,1-37.276,19.88C188.067,171.469,183.874,171.624,179.835,172.09ZM216.8,109.343a44.7,44.7,0,0,0-.466-5.125c-2.8-15.376-16.929-24.074-31.684-20.657-14.444,3.262-23.763,12.425-27.18,27.025a25.579,25.579,0,0,0,14.289,29.355c8.542,3.728,17.085,3.262,25.317-.932C209.345,132.64,216.024,122.7,216.8,109.343Z" style="fill:#00acd7"/></svg>',
|
|
16
|
+
"graphql" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_graphql</title><rect x="-0.43" y="12.534" width="22.901" height="1.187" transform="translate(-5.858 16.107) rotate(-59.999)" style="fill:#e10098"/><rect x="4.545" y="21.162" width="22.902" height="1.187" style="fill:#e10098"/><rect x="10.43" y="18.008" width="1.187" height="13.227" transform="translate(-15.812 21.857) rotate(-59.999)" style="fill:#e10098"/><rect x="20.381" y="0.771" width="1.187" height="13.227" transform="translate(4.092 21.856) rotate(-59.999)" style="fill:#e10098"/><rect x="4.412" y="6.787" width="13.227" height="1.187" transform="translate(-2.213 6.502) rotate(-30.001)" style="fill:#e10098"/><rect x="20.389" y="1.677" width="1.187" height="22.901" transform="translate(-3.753 12.25) rotate(-30.001)" style="fill:#e10098"/><rect x="5.454" y="9.386" width="1.187" height="13.228" style="fill:#e10098"/><rect x="25.36" y="9.386" width="1.187" height="13.228" style="fill:#e10098"/><rect x="15.222" y="24.097" width="11.504" height="1.037" transform="translate(-9.498 13.785) rotate(-30.001)" style="fill:#e10098"/><path d="M28.12,23a2.5,2.5,0,1,1-.915-3.411A2.5,2.5,0,0,1,28.12,23" style="fill:#e10098"/><path d="M8.2,11.5a2.5,2.5,0,1,1-.915-3.411A2.5,2.5,0,0,1,8.2,11.5" style="fill:#e10098"/><path d="M3.88,23a2.5,2.5,0,1,1,3.411.915A2.5,2.5,0,0,1,3.88,23" style="fill:#e10098"/><path d="M23.8,11.5a2.5,2.5,0,1,1,3.411.915A2.5,2.5,0,0,1,23.8,11.5" style="fill:#e10098"/><path d="M16,30a2.5,2.5,0,1,1,2.5-2.5A2.493,2.493,0,0,1,16,30" style="fill:#e10098"/><path d="M16,6.991a2.5,2.5,0,1,1,2.5-2.5,2.493,2.493,0,0,1-2.5,2.5" style="fill:#e10098"/></svg>',
|
|
17
|
+
"html" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_html</title><polygon points="5.902 27.201 3.655 2 28.345 2 26.095 27.197 15.985 30 5.902 27.201" style="fill:#e44f26"/><polygon points="16 27.858 24.17 25.593 26.092 4.061 16 4.061 16 27.858" style="fill:#f1662a"/><polygon points="16 13.407 11.91 13.407 11.628 10.242 16 10.242 16 7.151 15.989 7.151 8.25 7.151 8.324 7.981 9.083 16.498 16 16.498 16 13.407" style="fill:#ebebeb"/><polygon points="16 21.434 15.986 21.438 12.544 20.509 12.324 18.044 10.651 18.044 9.221 18.044 9.654 22.896 15.986 24.654 16 24.65 16 21.434" style="fill:#ebebeb"/><polygon points="15.989 13.407 15.989 16.498 19.795 16.498 19.437 20.507 15.989 21.437 15.989 24.653 22.326 22.896 22.372 22.374 23.098 14.237 23.174 13.407 22.341 13.407 15.989 13.407" style="fill:#fff"/><polygon points="15.989 7.151 15.989 9.071 15.989 10.235 15.989 10.242 23.445 10.242 23.445 10.242 23.455 10.242 23.517 9.548 23.658 7.981 23.732 7.151 15.989 7.151" style="fill:#fff"/></svg>',
|
|
18
|
+
"js" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_js</title><path d="M18.774,19.7a3.727,3.727,0,0,0,3.376,2.078c1.418,0,2.324-.709,2.324-1.688,0-1.173-.931-1.589-2.491-2.272l-.856-.367c-2.469-1.052-4.11-2.37-4.11-5.156,0-2.567,1.956-4.52,5.012-4.52A5.058,5.058,0,0,1,26.9,10.52l-2.665,1.711a2.327,2.327,0,0,0-2.2-1.467,1.489,1.489,0,0,0-1.638,1.467c0,1.027.636,1.442,2.1,2.078l.856.366c2.908,1.247,4.549,2.518,4.549,5.376,0,3.081-2.42,4.769-5.671,4.769a6.575,6.575,0,0,1-6.236-3.5ZM6.686,20c.538.954,1.027,1.76,2.2,1.76,1.124,0,1.834-.44,1.834-2.15V7.975h3.422V19.658c0,3.543-2.078,5.156-5.11,5.156A5.312,5.312,0,0,1,3.9,21.688Z" style="fill:#f5de19"/></svg>',
|
|
19
|
+
"json" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_json</title><path d="M4.014,14.976a2.51,2.51,0,0,0,1.567-.518A2.377,2.377,0,0,0,6.386,13.1,15.261,15.261,0,0,0,6.6,10.156q.012-2.085.075-2.747a5.236,5.236,0,0,1,.418-1.686,3.025,3.025,0,0,1,.755-1.018A3.046,3.046,0,0,1,9,4.125,6.762,6.762,0,0,1,10.544,4h.7V5.96h-.387a2.338,2.338,0,0,0-1.723.468A3.4,3.4,0,0,0,8.709,8.52a36.054,36.054,0,0,1-.137,4.133,4.734,4.734,0,0,1-.768,2.06A4.567,4.567,0,0,1,6.1,16a3.809,3.809,0,0,1,1.992,1.754,8.861,8.861,0,0,1,.618,3.865q0,2.435.05,2.9A1.755,1.755,0,0,0,9.264,25.7a2.639,2.639,0,0,0,1.592.337h.387V28h-.7a5.655,5.655,0,0,1-1.773-.2,2.97,2.97,0,0,1-1.324-.93,3.353,3.353,0,0,1-.681-1.63A24.175,24.175,0,0,1,6.6,22.006,16.469,16.469,0,0,0,6.386,18.9a2.408,2.408,0,0,0-.805-1.361,2.489,2.489,0,0,0-1.567-.524Z" style="fill:#f5de19"/><path d="M27.986,17.011a2.489,2.489,0,0,0-1.567.524,2.408,2.408,0,0,0-.805,1.361,16.469,16.469,0,0,0-.212,3.109,24.175,24.175,0,0,1-.169,3.234,3.353,3.353,0,0,1-.681,1.63,2.97,2.97,0,0,1-1.324.93,5.655,5.655,0,0,1-1.773.2h-.7V26.04h.387a2.639,2.639,0,0,0,1.592-.337,1.755,1.755,0,0,0,.506-1.186q.05-.462.05-2.9a8.861,8.861,0,0,1,.618-3.865A3.809,3.809,0,0,1,25.9,16a4.567,4.567,0,0,1-1.7-1.286,4.734,4.734,0,0,1-.768-2.06,36.054,36.054,0,0,1-.137-4.133,3.4,3.4,0,0,0-.425-2.092,2.338,2.338,0,0,0-1.723-.468h-.387V4h.7A6.762,6.762,0,0,1,23,4.125a3.046,3.046,0,0,1,1.149.581,3.025,3.025,0,0,1,.755,1.018,5.236,5.236,0,0,1,.418,1.686q.062.662.075,2.747a15.261,15.261,0,0,0,.212,2.947,2.377,2.377,0,0,0,.805,1.355,2.51,2.51,0,0,0,1.567.518Z" style="fill:#f5de19"/></svg>',
|
|
20
|
+
"jsx" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_reactjs</title><circle cx="16" cy="15.974" r="2.5" style="fill:#00d8ff"/><path d="M16,21.706a28.385,28.385,0,0,1-8.88-1.2,11.3,11.3,0,0,1-3.657-1.958A3.543,3.543,0,0,1,2,15.974c0-1.653,1.816-3.273,4.858-4.333A28.755,28.755,0,0,1,16,10.293a28.674,28.674,0,0,1,9.022,1.324,11.376,11.376,0,0,1,3.538,1.866A3.391,3.391,0,0,1,30,15.974c0,1.718-2.03,3.459-5.3,4.541A28.8,28.8,0,0,1,16,21.706Zm0-10.217a27.948,27.948,0,0,0-8.749,1.282c-2.8.977-4.055,2.313-4.055,3.2,0,.928,1.349,2.387,4.311,3.4A27.21,27.21,0,0,0,16,20.51a27.6,27.6,0,0,0,8.325-1.13C27.4,18.361,28.8,16.9,28.8,15.974a2.327,2.327,0,0,0-1.01-1.573,10.194,10.194,0,0,0-3.161-1.654A27.462,27.462,0,0,0,16,11.489Z" style="fill:#00d8ff"/><path d="M10.32,28.443a2.639,2.639,0,0,1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755,28.755,0,0,1,3.4-8.593h0A28.676,28.676,0,0,1,16.71,5.995a11.376,11.376,0,0,1,3.384-2.133,3.391,3.391,0,0,1,2.878,0c1.489.858,1.982,3.486,1.287,6.859a28.806,28.806,0,0,1-3.316,8.133,28.385,28.385,0,0,1-5.476,7.093,11.3,11.3,0,0,1-3.523,2.189A4.926,4.926,0,0,1,10.32,28.443Zm1.773-14.7a27.948,27.948,0,0,0-3.26,8.219c-.553,2.915-.022,4.668.75,5.114.8.463,2.742.024,5.1-2.036a27.209,27.209,0,0,0,5.227-6.79,27.6,27.6,0,0,0,3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327,2.327,0,0,0-1.868.089A10.194,10.194,0,0,0,17.5,6.9a27.464,27.464,0,0,0-5.4,6.849Z" style="fill:#00d8ff"/><path d="M21.677,28.456c-1.355,0-3.076-.82-4.868-2.361a28.756,28.756,0,0,1-5.747-7.237h0a28.676,28.676,0,0,1-3.374-8.471,11.376,11.376,0,0,1-.158-4A3.391,3.391,0,0,1,8.964,3.9c1.487-.861,4.01.024,6.585,2.31a28.8,28.8,0,0,1,5.39,6.934,28.384,28.384,0,0,1,3.41,8.287,11.3,11.3,0,0,1,.137,4.146,3.543,3.543,0,0,1-1.494,2.555A2.59,2.59,0,0,1,21.677,28.456Zm-9.58-10.2a27.949,27.949,0,0,0,5.492,6.929c2.249,1.935,4.033,2.351,4.8,1.9.8-.465,1.39-2.363.782-5.434A27.212,27.212,0,0,0,19.9,13.74,27.6,27.6,0,0,0,14.755,7.1c-2.424-2.152-4.39-2.633-5.191-2.169a2.327,2.327,0,0,0-.855,1.662,10.194,10.194,0,0,0,.153,3.565,27.465,27.465,0,0,0,3.236,8.1Z" style="fill:#00d8ff"/></svg>',
|
|
21
|
+
"tsx" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_reactts</title><circle cx="16" cy="15.974" r="2.5" style="fill:#007acc"/><path d="M16,21.706a28.385,28.385,0,0,1-8.88-1.2,11.3,11.3,0,0,1-3.657-1.958A3.543,3.543,0,0,1,2,15.974c0-1.653,1.816-3.273,4.858-4.333A28.755,28.755,0,0,1,16,10.293a28.674,28.674,0,0,1,9.022,1.324,11.376,11.376,0,0,1,3.538,1.866A3.391,3.391,0,0,1,30,15.974c0,1.718-2.03,3.459-5.3,4.541A28.8,28.8,0,0,1,16,21.706Zm0-10.217a27.948,27.948,0,0,0-8.749,1.282c-2.8.977-4.055,2.313-4.055,3.2,0,.928,1.349,2.387,4.311,3.4A27.21,27.21,0,0,0,16,20.51a27.6,27.6,0,0,0,8.325-1.13C27.4,18.361,28.8,16.9,28.8,15.974a2.327,2.327,0,0,0-1.01-1.573,10.194,10.194,0,0,0-3.161-1.654A27.462,27.462,0,0,0,16,11.489Z" style="fill:#007acc"/><path d="M10.32,28.443a2.639,2.639,0,0,1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755,28.755,0,0,1,3.4-8.593h0A28.676,28.676,0,0,1,16.71,5.995a11.376,11.376,0,0,1,3.384-2.133,3.391,3.391,0,0,1,2.878,0c1.489.858,1.982,3.486,1.287,6.859a28.806,28.806,0,0,1-3.316,8.133,28.385,28.385,0,0,1-5.476,7.093,11.3,11.3,0,0,1-3.523,2.189A4.926,4.926,0,0,1,10.32,28.443Zm1.773-14.7a27.948,27.948,0,0,0-3.26,8.219c-.553,2.915-.022,4.668.75,5.114.8.463,2.742.024,5.1-2.036a27.209,27.209,0,0,0,5.227-6.79,27.6,27.6,0,0,0,3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327,2.327,0,0,0-1.868.089A10.194,10.194,0,0,0,17.5,6.9a27.464,27.464,0,0,0-5.4,6.849Z" style="fill:#007acc"/><path d="M21.677,28.456c-1.355,0-3.076-.82-4.868-2.361a28.756,28.756,0,0,1-5.747-7.237h0a28.676,28.676,0,0,1-3.374-8.471,11.376,11.376,0,0,1-.158-4A3.391,3.391,0,0,1,8.964,3.9c1.487-.861,4.01.024,6.585,2.31a28.8,28.8,0,0,1,5.39,6.934,28.384,28.384,0,0,1,3.41,8.287,11.3,11.3,0,0,1,.137,4.146,3.543,3.543,0,0,1-1.494,2.555A2.59,2.59,0,0,1,21.677,28.456Zm-9.58-10.2a27.949,27.949,0,0,0,5.492,6.929c2.249,1.935,4.033,2.351,4.8,1.9.8-.465,1.39-2.363.782-5.434A27.212,27.212,0,0,0,19.9,13.74,27.6,27.6,0,0,0,14.755,7.1c-2.424-2.152-4.39-2.633-5.191-2.169a2.327,2.327,0,0,0-.855,1.662,10.194,10.194,0,0,0,.153,3.565,27.465,27.465,0,0,0,3.236,8.1Z" style="fill:#007acc"/></svg>',
|
|
22
|
+
"mysql" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_mysql</title><path d="M8.785,6.865a3.055,3.055,0,0,0-.785.1V7h.038a6.461,6.461,0,0,0,.612.785c.154.306.288.611.441.917.019-.019.038-.039.038-.039a1.074,1.074,0,0,0,.4-.957,4.314,4.314,0,0,1-.23-.4c-.115-.191-.364-.287-.517-.44" style="fill:#5d87a1;fill-rule:evenodd"/><path d="M27.78,23.553a8.849,8.849,0,0,0-3.712.536c-.287.115-.745.115-.785.478.154.153.172.4.307.613a4.467,4.467,0,0,0,.995,1.167c.4.306.8.611,1.225.879.745.461,1.588.728,2.314,1.187.422.268.842.612,1.264.9.21.153.343.4.611.5v-.058a3.844,3.844,0,0,0-.291-.613c-.191-.19-.383-.363-.575-.554a9.118,9.118,0,0,0-1.99-1.932c-.613-.422-1.953-1-2.2-1.7l-.039-.039a7.69,7.69,0,0,0,1.321-.308c.65-.172,1.243-.133,1.912-.3.307-.077.862-.268.862-.268v-.3c-.342-.34-.587-.795-.947-1.116a25.338,25.338,0,0,0-3.122-2.328c-.587-.379-1.344-.623-1.969-.946-.226-.114-.6-.17-.737-.36a7.594,7.594,0,0,1-.776-1.457c-.548-1.04-1.079-2.193-1.551-3.293a20.236,20.236,0,0,0-.965-2.157A19.078,19.078,0,0,0,11.609,5a9.07,9.07,0,0,0-2.421-.776c-.474-.02-.946-.057-1.419-.075A7.55,7.55,0,0,1,6.9,3.485C5.818,2.8,3.038,1.328,2.242,3.277,1.732,4.508,3,5.718,3.435,6.343A8.866,8.866,0,0,1,4.4,7.762c.133.322.171.663.3,1A22.556,22.556,0,0,0,5.687,11.3a8.946,8.946,0,0,0,.7,1.172c.153.209.417.3.474.645a5.421,5.421,0,0,0-.436,1.419,8.336,8.336,0,0,0,.549,6.358c.3.473,1.022,1.514,1.987,1.116.851-.34.662-1.419.908-2.364.056-.229.019-.379.132-.53V19.3s.483,1.061.723,1.6a10.813,10.813,0,0,0,2.4,2.59A3.514,3.514,0,0,1,14,24.657V25h.427A1.054,1.054,0,0,0,14,24.212a9.4,9.4,0,0,1-.959-1.16,24.992,24.992,0,0,1-2.064-3.519c-.3-.6-.553-1.258-.793-1.857-.11-.231-.11-.58-.295-.7a7.266,7.266,0,0,0-.884,1.313,11.419,11.419,0,0,0-.517,2.921c-.073.02-.037,0-.073.038-.589-.155-.792-.792-1.014-1.332a8.756,8.756,0,0,1-.166-5.164c.128-.405.683-1.681.461-2.068-.111-.369-.48-.58-.682-.871a7.767,7.767,0,0,1-.663-1.237C5.912,9.5,5.69,8.3,5.212,7.216a10.4,10.4,0,0,0-.921-1.489A9.586,9.586,0,0,1,3.276,4.22c-.092-.213-.221-.561-.074-.793a.3.3,0,0,1,.259-.252c.238-.212.921.058,1.16.174a9.2,9.2,0,0,1,1.824.967c.258.194.866.685.866.685h.18c.612.133,1.3.037,1.876.21a12.247,12.247,0,0,1,2.755,1.32,16.981,16.981,0,0,1,5.969,6.545c.23.439.327.842.537,1.3.4.94.9,1.9,1.3,2.814a12.578,12.578,0,0,0,1.36,2.564c.286.4,1.435.612,1.952.822a13.7,13.7,0,0,1,1.32.535c.651.4,1.3.861,1.913,1.3.305.23,1.262.708,1.32,1.091" style="fill:#00758f;fill-rule:evenodd"/></svg>',
|
|
23
|
+
"pgsql" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_pgsql</title><path d="M29.507,18.773a1.378,1.378,0,0,0-1.144-.921,2.619,2.619,0,0,0-.913.051,8.2,8.2,0,0,1-1.406.185,27.125,27.125,0,0,0,2.872-6.83c.953-3.689.444-5.369-.151-6.13A8.239,8.239,0,0,0,22.121,2a11.773,11.773,0,0,0-3.453.484A12.858,12.858,0,0,0,16.648,2.3a6.565,6.565,0,0,0-3.518.867,16.039,16.039,0,0,0-2.484-.624,7.694,7.694,0,0,0-5.819.924C3.093,4.691,2.289,6.819,2.438,9.792A36.351,36.351,0,0,0,3.844,16.33a22.579,22.579,0,0,0,1.514,3.863A4.786,4.786,0,0,0,7.8,22.742a2.4,2.4,0,0,0,2.379-.516,2.08,2.08,0,0,0,.5.43,3.328,3.328,0,0,0,.944.4,5.069,5.069,0,0,0,3.3-.2c.006.171.011.335.014.477.006.229.013.454.021.665a11.641,11.641,0,0,0,.441,3.3c.016.043.037.107.059.176a3.975,3.975,0,0,0,.991,1.745,2.955,2.955,0,0,0,2.09.777,4.7,4.7,0,0,0,.977-.109A4.592,4.592,0,0,0,22.607,28.1c.811-1.155,1.206-2.894,1.277-5.635.009-.078.018-.152.026-.222l.017-.145.191.017.049,0a7.562,7.562,0,0,0,3.163-.548c.631-.293,2.654-1.361,2.177-2.8"/><path d="M27.689,19.053c-3.163.652-3.38-.418-3.38-.418C27.648,13.68,29.044,7.39,27.839,5.851c-3.286-4.2-8.975-2.213-9.07-2.162l-.031.006a11.28,11.28,0,0,0-2.11-.22,5.212,5.212,0,0,0-3.34,1S3.14.294,3.612,9.733c.1,2.008,2.878,15.194,6.191,11.211,1.211-1.456,2.381-2.688,2.381-2.688a3.071,3.071,0,0,0,2.006.512l.057-.048a2.21,2.21,0,0,0,.023.567c-.854.954-.6,1.121-2.309,1.472-1.726.356-.712.989-.05,1.155a3.508,3.508,0,0,0,3.915-1.272l-.05.2c.334.268.569,1.742.53,3.079a8.481,8.481,0,0,0,.2,2.971c.264.717.526,2.329,2.769,1.849a3.307,3.307,0,0,0,2.98-3.179c.1-1.234.313-1.052.326-2.155l.174-.522c.2-1.673.032-2.213,1.186-1.962l.281.025a6.4,6.4,0,0,0,2.615-.44c1.406-.652,2.239-1.742.853-1.455h0" style="fill:#336791"/><path d="M13.882,10.631a.981.981,0,0,0-.674.1.247.247,0,0,0-.1.164.48.48,0,0,0,.117.314.881.881,0,0,0,.559.349.637.637,0,0,0,.09.006.725.725,0,0,0,.687-.467c.035-.248-.326-.414-.676-.463m9.442.008c-.027-.195-.374-.25-.7-.2s-.647.194-.62.389a.667.667,0,0,0,.62.411.592.592,0,0,0,.083-.006.8.8,0,0,0,.451-.247.5.5,0,0,0,.169-.343" style="fill:#fff"/><path d="M28.741,18.979c-.121-.365-.509-.482-1.154-.349-1.915.4-2.6.121-2.826-.044a26.327,26.327,0,0,0,3.373-7.565,14.374,14.374,0,0,0,.5-3.253,3.513,3.513,0,0,0-.509-2.2,7.482,7.482,0,0,0-6.049-2.825,10.363,10.363,0,0,0-3.5.551,8.717,8.717,0,0,0-1.968-.253,5.684,5.684,0,0,0-3.372.929,15.051,15.051,0,0,0-2.74-.718,6.978,6.978,0,0,0-5.242.805c-1.5,1.064-2.2,2.966-2.061,5.653a35.489,35.489,0,0,0,1.373,6.348c1.07,3.505,2.233,5.49,3.457,5.9a1.548,1.548,0,0,0,.491.081,2.049,2.049,0,0,0,1.563-.886q1.042-1.25,2.155-2.438a3.472,3.472,0,0,0,1.55.417l0,.042q-.14.166-.273.338c-.375.475-.452.574-1.658.823-.343.071-1.254.259-1.267.9-.014.7,1.077.991,1.2,1.022a5.144,5.144,0,0,0,1.249.162,3.634,3.634,0,0,0,2.5-.934,23.674,23.674,0,0,0,.381,5.684,2.854,2.854,0,0,0,2.729,2.1,4.378,4.378,0,0,0,.917-.1,3.462,3.462,0,0,0,3.156-3.212c.177-1.026.481-3.475.624-4.789a3.859,3.859,0,0,0,1.11.137,6.6,6.6,0,0,0,2.519-.48c.712-.331,2-1.141,1.763-1.846ZM24.051,10.1a7.968,7.968,0,0,1-.116,1.107,10.229,10.229,0,0,0-.14,1.3,9.859,9.859,0,0,0,.1,1.47,5.236,5.236,0,0,1-.229,2.986,3.882,3.882,0,0,1-.207-.426c-.058-.141-.185-.368-.359-.681-.68-1.22-2.274-4.078-1.458-5.244.243-.347.86-.7,2.408-.512ZM22.174,3.531a6.617,6.617,0,0,1,5.334,2.522c.975,1.245-.1,6.912-3.205,11.8l-.094-.119-.039-.049a5.524,5.524,0,0,0,.506-3.8,9.114,9.114,0,0,1-.1-1.352,9.572,9.572,0,0,1,.131-1.206,7.614,7.614,0,0,0,.123-1.493.619.619,0,0,0,.013-.21,8.381,8.381,0,0,0-1.912-3.6,8.61,8.61,0,0,0-3.039-2.284,10.246,10.246,0,0,1,2.28-.214ZM9.479,20.654c-.627.754-1.061.61-1.2.562-.928-.31-2.006-2.272-2.955-5.384a35.167,35.167,0,0,1-1.34-6.159c-.12-2.4.462-4.074,1.73-4.974,2.063-1.463,5.456-.587,6.819-.143-.02.019-.04.037-.059.057-2.237,2.259-2.184,6.119-2.178,6.355,0,.091.007.22.018.4a15.969,15.969,0,0,1-.081,3.226A4.08,4.08,0,0,0,11.3,18.007q.133.138.278.262c-.383.41-1.216,1.318-2.1,2.385Zm2.39-3.19a3.3,3.3,0,0,1-.865-2.764,16.7,16.7,0,0,0,.087-3.381c-.006-.095-.011-.178-.014-.243A4.3,4.3,0,0,1,14,10.223a1.188,1.188,0,0,1,.918,1.026c.646,2.989.085,4.234-.365,5.235-.093.206-.181.4-.255.6l-.058.156a10.218,10.218,0,0,0-.368,1.109,2.788,2.788,0,0,1-2-.887Zm.113,4.03a1.733,1.733,0,0,1-.523-.225,2.553,2.553,0,0,1,.557-.166c1.418-.292,1.637-.5,2.116-1.105.11-.139.234-.3.406-.489h0c.256-.287.374-.238.586-.15a.829.829,0,0,1,.408.525.585.585,0,0,1-.05.491A3.1,3.1,0,0,1,11.983,21.495ZM19.406,28.4a2.113,2.113,0,0,1-2.754-1.526,31.129,31.129,0,0,1-.3-6.853.392.392,0,0,0-.017-.124,1.643,1.643,0,0,0-.048-.23,1.589,1.589,0,0,0-.862-1.034,1.216,1.216,0,0,0-.793-.1,9.586,9.586,0,0,1,.342-1.022l.058-.157c.066-.177.148-.36.235-.554.471-1.047,1.117-2.482.416-5.722a2.044,2.044,0,0,0-2.468-1.669A5.694,5.694,0,0,0,11.328,10c-.078.04-.15.078-.216.115A8.244,8.244,0,0,1,13.03,5.163,4.711,4.711,0,0,1,16.6,3.827,7.567,7.567,0,0,1,22.381,6.59,8.774,8.774,0,0,1,23.963,9.3c-1.463-.149-2.458.14-2.962.861-1.1,1.568.6,4.612,1.416,6.075.15.268.279.5.319.6a5.432,5.432,0,0,0,.861,1.387c.077.1.152.189.208.271-.443.128-1.239.423-1.166,1.9-.058.74-.474,4.205-.686,5.43-.279,1.617-.874,2.22-2.548,2.579Zm7.242-8.288a5.714,5.714,0,0,1-1.931.4,2.422,2.422,0,0,1-1.3-.167c-.045-.919.3-1.015.66-1.117.057-.016.112-.032.166-.05a1.353,1.353,0,0,0,.11.08c.639.422,1.78.467,3.39.135l.018,0a4.334,4.334,0,0,1-1.116.72Z" style="fill:#fff"/></svg>',
|
|
24
|
+
"php" => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><radialGradient id="a" cx="-16.114" cy="20.532" r="18.384" gradientTransform="translate(26.52 -9.307)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="0.5" stop-color="#4c6b96"/><stop offset="1" stop-color="#231f20"/></radialGradient></defs><title>file_type_php</title><ellipse cx="16" cy="16" rx="14" ry="7.365" style="fill:url(#a)"/><ellipse cx="16" cy="16" rx="13.453" ry="6.818" style="fill:#6280b6"/><path d="M18.725,18.2l.667-3.434a1.752,1.752,0,0,0-.372-1.719,2.929,2.929,0,0,0-2-.525H15.867l.331-1.7a.219.219,0,0,0-.215-.26h-1.6a.219.219,0,0,0-.215.177l-.709,3.646a2.051,2.051,0,0,0-.477-1.054,2.783,2.783,0,0,0-2.2-.807H7.7a.219.219,0,0,0-.215.177l-1.434,7.38a.219.219,0,0,0,.215.26H7.869a.219.219,0,0,0,.215-.177l.347-1.785h1.2a5.167,5.167,0,0,0,1.568-.2,3.068,3.068,0,0,0,1.15-.689,3.538,3.538,0,0,0,.68-.844l-.287,1.475a.219.219,0,0,0,.215.26h1.6a.219.219,0,0,0,.215-.177l.787-4.051h1.094c.466,0,.6.093.64.133s.1.165.025.569l-.635,3.265a.219.219,0,0,0,.215.26h1.62A.219.219,0,0,0,18.725,18.2ZM11.33,15.366a1.749,1.749,0,0,1-.561,1.092,2.171,2.171,0,0,1-1.315.321H8.742l.515-2.651h.921c.677,0,.949.145,1.059.266A1.181,1.181,0,0,1,11.33,15.366Z" style="fill:#fff"/><path d="M25.546,13.332a2.783,2.783,0,0,0-2.2-.807H20.255a.219.219,0,0,0-.215.177l-1.434,7.38a.219.219,0,0,0,.215.26h1.608a.219.219,0,0,0,.215-.177l.347-1.785h1.2a5.167,5.167,0,0,0,1.568-.2,3.068,3.068,0,0,0,1.15-.689,3.425,3.425,0,0,0,1.076-1.927A2.512,2.512,0,0,0,25.546,13.332Zm-1.667,2.034a1.749,1.749,0,0,1-.561,1.092A2.171,2.171,0,0,1,22,16.778H21.29l.515-2.651h.921c.677,0,.949.145,1.059.266A1.181,1.181,0,0,1,23.879,15.366Z" style="fill:#fff"/><path d="M10.178,13.908a1.645,1.645,0,0,1,1.221.338,1.34,1.34,0,0,1,.145,1.161,1.945,1.945,0,0,1-.642,1.223A2.361,2.361,0,0,1,9.454,17H8.476l.6-3.089ZM6.261,20.124H7.869l.381-1.962H9.627a4.931,4.931,0,0,0,1.5-.191,2.84,2.84,0,0,0,1.07-.642,3.207,3.207,0,0,0,1.01-1.808,2.3,2.3,0,0,0-.385-2.044,2.568,2.568,0,0,0-2.035-.732H7.7Z" style="fill:#000004"/><path d="M14.387,10.782h1.6L15.6,12.744h1.421a2.767,2.767,0,0,1,1.85.468,1.548,1.548,0,0,1,.305,1.516l-.667,3.434H16.89l.635-3.265a.886.886,0,0,0-.08-.76,1.121,1.121,0,0,0-.8-.2H15.37l-.822,4.228h-1.6Z" style="fill:#000004"/><path d="M22.727,13.908a1.645,1.645,0,0,1,1.221.338,1.34,1.34,0,0,1,.145,1.161,1.945,1.945,0,0,1-.642,1.223A2.361,2.361,0,0,1,22,17h-.978l.6-3.089ZM18.81,20.124h1.608l.381-1.962h1.377a4.931,4.931,0,0,0,1.5-.191,2.84,2.84,0,0,0,1.07-.642,3.207,3.207,0,0,0,1.01-1.808,2.3,2.3,0,0,0-.385-2.044,2.568,2.568,0,0,0-2.035-.732H20.244Z" style="fill:#000004"/></svg>',
|
|
25
|
+
"proto" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_protobuf</title><g transform="matrix(.073595 0 0 .073595 .94965 5.807)"><path d="m58 81 33-45h90l-78 105h-45z" fill="#d44235"/><path d="m302 136h47v61l-34 44h-88z" fill="#f7bb07"/><path d="m19 139c0-5.4151 0.09672-5.454 39-58l123 160h-88c-73.955-95.764-74-95.878-74-102z" fill="#4081ec"/><path d="m227 36h87c72.8 95.118 75.949 98.635 76 103 0.0513 4.3645-0.63539 6.3622-41 58z" fill="#0f9855"/></g></svg>',
|
|
26
|
+
"py" => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="-133.268" y1="-202.91" x2="-133.198" y2="-202.84" gradientTransform="translate(25243.061 38519.17) scale(189.38 189.81)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#387eb8"/><stop offset="1" stop-color="#366994"/></linearGradient><linearGradient id="b" x1="-133.575" y1="-203.203" x2="-133.495" y2="-203.133" gradientTransform="translate(25309.061 38583.42) scale(189.38 189.81)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffe052"/><stop offset="1" stop-color="#ffc331"/></linearGradient></defs><title>file_type_python</title><path d="M15.885,2.1c-7.1,0-6.651,3.07-6.651,3.07V8.36h6.752v1H6.545S2,8.8,2,16.005s4.013,6.912,4.013,6.912H8.33V19.556s-.13-4.013,3.9-4.013h6.762s3.772.06,3.772-3.652V5.8s.572-3.712-6.842-3.712h0ZM12.153,4.237a1.214,1.214,0,1,1-1.183,1.244v-.02a1.214,1.214,0,0,1,1.214-1.214h0Z" style="fill:url(#a)"/><path d="M16.085,29.91c7.1,0,6.651-3.08,6.651-3.08V23.65H15.985v-1h9.47S30,23.158,30,15.995s-4.013-6.912-4.013-6.912H23.64V12.4s.13,4.013-3.9,4.013H12.975S9.2,16.356,9.2,20.068V26.2s-.572,3.712,6.842,3.712h.04Zm3.732-2.147A1.214,1.214,0,1,1,21,26.519v.03a1.214,1.214,0,0,1-1.214,1.214h.03Z" style="fill:url(#b)"/></svg>',
|
|
27
|
+
"rb" => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><linearGradient id="a" x1="-235.957" y1="-308.579" x2="-235.986" y2="-308.527" gradientTransform="matrix(202.935, 0, 0, -202.78, 47910.461, -62541.16)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fb7655"/><stop offset="0.41" stop-color="#e42b1e"/><stop offset="0.99" stop-color="#900"/><stop offset="1" stop-color="#900"/></linearGradient><linearGradient id="b" x1="-235.571" y1="-309.087" x2="-235.697" y2="-309.041" gradientTransform="matrix(60.308, 0, 0, -111.778, 14236.351, -34525.395)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#871101"/><stop offset="0.99" stop-color="#911209"/><stop offset="1" stop-color="#911209"/></linearGradient><linearGradient id="c" x1="-235.896" y1="-313.362" x2="-235.937" y2="-313.129" gradientTransform="matrix(188.32, 0, 0, -21.986, 44447.302, -6856.882)" xlink:href="#b"/><linearGradient id="d" x1="-233.515" y1="-309.082" x2="-233.497" y2="-309.161" gradientTransform="matrix(65.222, 0, 0, -97.1, 15237.802, -29991.814)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="0.23" stop-color="#e57252"/><stop offset="0.46" stop-color="#de3b20"/><stop offset="0.99" stop-color="#a60003"/><stop offset="1" stop-color="#a60003"/></linearGradient><linearGradient id="e" x1="-235.314" y1="-309.534" x2="-235.31" y2="-309.607" gradientTransform="matrix(105.32, 0, 0, -106.825, 24798.925, -33053.152)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="0.23" stop-color="#e4714e"/><stop offset="0.56" stop-color="#be1a0d"/><stop offset="0.99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="f" x1="-235.882" y1="-311.851" x2="-235.869" y2="-311.935" gradientTransform="matrix(94.321, 0, 0, -66.418, 22271.499, -20707.004)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="0.18" stop-color="#e46342"/><stop offset="0.4" stop-color="#c82410"/><stop offset="0.99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="g" x1="-235.412" y1="-321.074" x2="-235.333" y2="-320.958" gradientTransform="matrix(70.767, 0, 0, -24.301, 16678.116, -7798.647)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="0.54" stop-color="#c81f11"/><stop offset="0.99" stop-color="#bf0905"/><stop offset="1" stop-color="#bf0905"/></linearGradient><linearGradient id="h" x1="-223.821" y1="-310.116" x2="-223.796" y2="-310.18" gradientTransform="matrix(18.177, 0, 0, -72.645, 4071.017, -22510.233)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="0.31" stop-color="#de4024"/><stop offset="0.99" stop-color="#bf190b"/><stop offset="1" stop-color="#bf190b"/></linearGradient><linearGradient id="i" x1="-235.561" y1="-309.258" x2="-235.424" y2="-309.116" gradientTransform="matrix(158.162, 0, 0, -157.937, 37256.313, -48819.382)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#bd0012"/><stop offset="0.07" stop-color="#fff"/><stop offset="0.17" stop-color="#fff"/><stop offset="0.27" stop-color="#c82f1c"/><stop offset="0.33" stop-color="#820c01"/><stop offset="0.46" stop-color="#a31601"/><stop offset="0.72" stop-color="#b31301"/><stop offset="0.99" stop-color="#e82609"/><stop offset="1" stop-color="#e82609"/></linearGradient><linearGradient id="j" x1="-235.424" y1="-309.143" x2="-235.476" y2="-309.126" gradientTransform="matrix(127.074, 0, 0, -97.409, 29932.229, -30086.947)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8c0c01"/><stop offset="0.54" stop-color="#990c00"/><stop offset="0.99" stop-color="#a80d0e"/><stop offset="1" stop-color="#a80d0e"/></linearGradient><linearGradient id="k" x1="-235.839" y1="-309.604" x2="-235.901" y2="-309.555" gradientTransform="matrix(94.011, 0, 0, -105.603, 22198.743, -32676.856)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7e110b"/><stop offset="0.99" stop-color="#9e0c00"/><stop offset="1" stop-color="#9e0c00"/></linearGradient><linearGradient id="l" x1="-235.854" y1="-311.24" x2="-235.891" y2="-311.202" gradientTransform="matrix(79.702, 0, 0, -81.791, 18827.397, -25447.905)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#79130d"/><stop offset="0.99" stop-color="#9e120b"/><stop offset="1" stop-color="#9e120b"/></linearGradient><radialGradient id="m" cx="-235.882" cy="-312.543" r="0.076" gradientTransform="matrix(93.113, 0, 0, -48.655, 21986.073, -15193.61)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a80d00"/><stop offset="0.99" stop-color="#7e0e08"/><stop offset="1" stop-color="#7e0e08"/></radialGradient><radialGradient id="n" cx="-235.282" cy="-309.704" r="0.097" gradientTransform="matrix(97.434, 0, 0, -75.848, 22937.057, -23467.84)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a30c00"/><stop offset="0.99" stop-color="#800e08"/><stop offset="1" stop-color="#800e08"/></radialGradient><linearGradient id="o" x1="-231.241" y1="-309.435" x2="-231.299" y2="-309.337" gradientTransform="matrix(40.137, 0, 0, -81.143, 9286.998, -25078.589)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8b2114"/><stop offset="0.43" stop-color="#9e100a"/><stop offset="0.99" stop-color="#b3100c"/><stop offset="1" stop-color="#b3100c"/></linearGradient><linearGradient id="p" x1="-235.898" y1="-317.466" x2="-235.831" y2="-317.537" gradientTransform="matrix(78.099, 0, 0, -32.624, 18447.361, -10353.553)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#b31000"/><stop offset="0.44" stop-color="#910f08"/><stop offset="0.99" stop-color="#791c12"/><stop offset="1" stop-color="#791c12"/></linearGradient></defs><title>file_type_ruby</title><path d="M23.693,20.469,7.707,29.961l20.7-1.4L30,7.685Z" style="fill:url(#a)"/><path d="M28.44,28.542,26.661,16.263l-4.846,6.4Z" style="fill:url(#b)"/><path d="M28.464,28.542,15.43,27.519,7.776,29.934Z" style="fill:url(#c)"/><path d="M7.794,29.937,11.05,19.27,3.885,20.8Z" style="fill:url(#d)"/><path d="M21.813,22.7l-3-11.735L10.243,19Z" style="fill:url(#e)"/><path d="M29.32,11.127l-8.1-6.619-2.257,7.3Z" style="fill:url(#f)"/><path d="M25.53,2.148,20.763,4.782l-3.007-2.67Z" style="fill:url(#g)"/><path d="M2,24.38l2-3.642L2.382,16.4Z" style="fill:url(#h)"/><path d="M2.274,16.263,3.9,20.873l7.062-1.584L19.024,11.8,21.3,4.569l-3.583-2.53-6.091,2.28C9.706,6.1,5.982,9.635,5.848,9.7s-2.459,4.464-3.574,6.562Z" style="fill:#fff"/><path d="M7.981,7.981C12.14,3.858,17.5,1.421,19.559,3.5s-.124,7.121-4.283,11.244S5.821,21.434,3.765,19.358,3.822,12.1,7.981,7.981Z" style="fill:url(#i)"/><path d="M7.794,29.933l3.231-10.7,10.729,3.447c-3.879,3.638-8.194,6.713-13.96,7.254Z" style="fill:url(#j)"/><path d="M19.038,11.774l2.754,10.91c3.24-3.407,6.149-7.07,7.573-11.6l-10.328.691Z" style="fill:url(#k)"/><path d="M29.337,11.139c1.1-3.327,1.357-8.1-3.841-8.985L21.231,4.509l8.106,6.629Z" style="fill:url(#l)"/><path d="M2,24.332c.153,5.49,4.114,5.572,5.8,5.62l-3.9-9.1L2,24.332Z" style="fill:#9e1209"/><path d="M19.053,11.791c2.49,1.531,7.509,4.6,7.61,4.661a17.552,17.552,0,0,0,2.619-5.343l-10.229.683Z" style="fill:url(#m)"/><path d="M11.021,19.232l4.319,8.332a27.924,27.924,0,0,0,6.385-4.88l-10.7-3.452Z" style="fill:url(#n)"/><path d="M3.887,20.861l-.612,7.287c1.155,1.577,2.743,1.714,4.409,1.591-1.205-3-3.614-9-3.8-8.878Z" style="fill:url(#o)"/><path d="M21.206,4.528l8.58,1.2c-.458-1.94-1.864-3.192-4.261-3.584l-4.319,2.38Z" style="fill:url(#p)"/></svg>',
|
|
28
|
+
"rs" => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><defs><radialGradient id="a" cx="-492.035" cy="-883.37" r="13.998" gradientTransform="matrix(0.866, -0.5, -0.3, -0.52, 177.106, -689.033)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7d7d7d"/><stop offset="0.267" stop-color="#7e7c7a"/><stop offset="0.45" stop-color="#817871"/><stop offset="0.608" stop-color="#867162"/><stop offset="0.753" stop-color="#8d684c"/><stop offset="0.886" stop-color="#965c30"/><stop offset="1" stop-color="#a04f12"/></radialGradient></defs><title>file_type_rust</title><path d="M15.124,5.3a.832.832,0,1,1,.832.832h0a.831.831,0,0,1-.832-.832M5.2,12.834a.832.832,0,1,1,.832.832h0a.832.832,0,0,1-.832-.832m19.856.039a.832.832,0,1,1,.832.832.831.831,0,0,1-.832-.832h0M7.605,14.013a.76.76,0,0,0,.386-1l-.369-.835H9.074v6.545H6.144a10.247,10.247,0,0,1-.332-3.911Zm6.074.161V12.245h3.458c.179,0,1.261.206,1.261,1.016,0,.672-.83.913-1.513.913ZM8.958,24.561a.832.832,0,1,1,.832.832.831.831,0,0,1-.832-.832h0m12.331.039a.832.832,0,1,1,.832.832.832.832,0,0,1-.832-.832h0m.257-1.887a.758.758,0,0,0-.9.584l-.418,1.949a10.249,10.249,0,0,1-8.545-.041l-.417-1.949a.759.759,0,0,0-.9-.583h0l-1.721.37a10.233,10.233,0,0,1-.89-1.049h8.374c.095,0,.158-.017.158-.1V18.928c0-.086-.063-.1-.158-.1h-2.45V16.947h2.649a1.665,1.665,0,0,1,1.629,1.412c.105.413.336,1.757.494,2.187.157.483.8,1.447,1.482,1.447h4.323a10.243,10.243,0,0,1-.949,1.1Zm4.65-7.821a10.261,10.261,0,0,1,.022,1.779H25.167c-.105,0-.148.069-.148.172v.483c0,1.136-.641,1.384-1.2,1.447-.535.06-1.128-.224-1.2-.551a3.616,3.616,0,0,0-1.671-2.808c1.03-.654,2.1-1.619,2.1-2.911A3.292,3.292,0,0,0,21.44,9.8a4.559,4.559,0,0,0-2.2-.724H8.367A10.246,10.246,0,0,1,14.1,5.84l1.282,1.344a.758.758,0,0,0,1.072.026h0l1.434-1.372a10.248,10.248,0,0,1,7.015,5l-.982,2.217a.761.761,0,0,0,.386,1Zm2.448.036-.033-.343,1.011-.943a.42.42,0,0,0-.013-.595.428.428,0,0,0-.121-.081L28.2,12.483l-.1-.334.806-1.12a.422.422,0,0,0-.13-.581.43.43,0,0,0-.133-.055l-1.363-.222-.164-.306.573-1.257a.419.419,0,0,0-.236-.544.426.426,0,0,0-.146-.029l-1.383.048L25.7,7.819l.318-1.347a.421.421,0,0,0-.343-.487.435.435,0,0,0-.144,0L24.183,6.3l-.266-.219L23.966,4.7a.421.421,0,0,0-.431-.411.426.426,0,0,0-.141.028l-1.257.573-.306-.164-.222-1.363a.421.421,0,0,0-.5-.318.43.43,0,0,0-.133.055l-1.121.806-.333-.1-.483-1.293a.421.421,0,0,0-.555-.215.442.442,0,0,0-.12.08L17.418,3.39l-.343-.033L16.347,2.18a.421.421,0,0,0-.688,0l-.728,1.177-.343.033-.943-1.012a.421.421,0,0,0-.595.015.442.442,0,0,0-.08.12L12.483,3.8l-.333.1-1.12-.8a.422.422,0,0,0-.581.13.43.43,0,0,0-.055.133l-.222,1.363-.306.164L8.608,4.317a.421.421,0,0,0-.544.239.444.444,0,0,0-.028.144l.048,1.383L7.818,6.3,6.471,5.984a.421.421,0,0,0-.487.343.435.435,0,0,0,0,.144L6.3,7.819l-.218.265L4.7,8.036a.422.422,0,0,0-.383.573L4.89,9.866l-.164.306-1.363.222a.42.42,0,0,0-.318.5.43.43,0,0,0,.055.133l.806,1.12-.1.334-1.293.483a.421.421,0,0,0-.215.555.414.414,0,0,0,.081.121l1.011.943-.033.343-1.177.728a.421.421,0,0,0,0,.688l1.177.728.033.343-1.011.943a.421.421,0,0,0,.015.595.436.436,0,0,0,.119.08l1.293.483.1.334L3.1,20.972a.421.421,0,0,0,.131.581.43.43,0,0,0,.133.055l1.363.222.164.307-.573,1.257a.422.422,0,0,0,.24.545.438.438,0,0,0,.143.028l1.383-.048.219.266-.317,1.348a.42.42,0,0,0,.341.486.4.4,0,0,0,.146,0L7.818,25.7l.266.218L8.035,27.3a.419.419,0,0,0,.429.41.413.413,0,0,0,.143-.028l1.257-.573.306.164.222,1.362a.421.421,0,0,0,.5.319.407.407,0,0,0,.133-.055l1.12-.807.334.1.483,1.292a.422.422,0,0,0,.556.214.436.436,0,0,0,.119-.08l.943-1.011.343.034.728,1.177a.422.422,0,0,0,.588.1.413.413,0,0,0,.1-.1l.728-1.177.343-.034.943,1.011a.421.421,0,0,0,.595-.015.436.436,0,0,0,.08-.119l.483-1.292.334-.1,1.12.807a.421.421,0,0,0,.581-.131.43.43,0,0,0,.055-.133l.222-1.362.306-.164,1.257.573a.421.421,0,0,0,.544-.239.438.438,0,0,0,.028-.143l-.048-1.384.265-.218,1.347.317a.421.421,0,0,0,.487-.34.447.447,0,0,0,0-.146L25.7,24.183l.218-.266,1.383.048a.421.421,0,0,0,.41-.431.4.4,0,0,0-.028-.142l-.573-1.257.164-.307,1.363-.222a.421.421,0,0,0,.319-.5.434.434,0,0,0-.056-.135l-.806-1.12.1-.334,1.293-.483a.42.42,0,0,0,.215-.554.414.414,0,0,0-.081-.121l-1.011-.943.033-.343,1.177-.728a.421.421,0,0,0,0-.688Z" style="fill:url(#a)"/></svg>',
|
|
29
|
+
"sql" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_sql</title><path d="M8.562,15.256A21.159,21.159,0,0,0,16,16.449a21.159,21.159,0,0,0,7.438-1.194c1.864-.727,2.525-1.535,2.525-2V9.7a10.357,10.357,0,0,1-2.084,1.076A22.293,22.293,0,0,1,16,12.078a22.36,22.36,0,0,1-7.879-1.3A10.28,10.28,0,0,1,6.037,9.7v3.55C6.037,13.724,6.7,14.528,8.562,15.256Z" style="fill:#ffda44"/><path d="M8.562,21.961a15.611,15.611,0,0,0,2.6.741A24.9,24.9,0,0,0,16,23.155a24.9,24.9,0,0,0,4.838-.452,15.614,15.614,0,0,0,2.6-.741c1.864-.727,2.525-1.535,2.525-2v-3.39a10.706,10.706,0,0,1-1.692.825A23.49,23.49,0,0,1,16,18.74a23.49,23.49,0,0,1-8.271-1.348,10.829,10.829,0,0,1-1.692-.825V19.96C6.037,20.426,6.7,21.231,8.562,21.961Z" style="fill:#ffda44"/><path d="M16,30c5.5,0,9.963-1.744,9.963-3.894V23.269a10.5,10.5,0,0,1-1.535.762l-.157.063A23.487,23.487,0,0,1,16,25.445a23.422,23.422,0,0,1-8.271-1.351c-.054-.02-.106-.043-.157-.063a10.5,10.5,0,0,1-1.535-.762v2.837C6.037,28.256,10.5,30,16,30Z" style="fill:#ffda44"/><ellipse cx="16" cy="5.894" rx="9.963" ry="3.894" style="fill:#ffda44"/></svg>',
|
|
30
|
+
"svelte" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_svelte</title><path d="M26.47,5.7A8.973,8.973,0,0,0,14.677,3.246L7.96,7.4a7.461,7.461,0,0,0-3.481,5.009,7.686,7.686,0,0,0,.8,5.058,7.358,7.358,0,0,0-1.151,2.8,7.789,7.789,0,0,0,1.4,6.028,8.977,8.977,0,0,0,11.794,2.458L24.04,24.6a7.468,7.468,0,0,0,3.481-5.009,7.673,7.673,0,0,0-.8-5.062,7.348,7.348,0,0,0,1.152-2.8A7.785,7.785,0,0,0,26.47,5.7" style="fill:#ff3e00"/><path d="M14.022,26.64A5.413,5.413,0,0,1,8.3,24.581a4.678,4.678,0,0,1-.848-3.625,4.307,4.307,0,0,1,.159-.61l.127-.375.344.238a8.76,8.76,0,0,0,2.628,1.274l.245.073-.025.237a1.441,1.441,0,0,0,.271.968,1.63,1.63,0,0,0,1.743.636,1.512,1.512,0,0,0,.411-.175l6.7-4.154a1.366,1.366,0,0,0,.633-.909,1.407,1.407,0,0,0-.244-1.091,1.634,1.634,0,0,0-1.726-.622,1.509,1.509,0,0,0-.413.176l-2.572,1.584a4.934,4.934,0,0,1-1.364.582,5.415,5.415,0,0,1-5.727-2.06A4.678,4.678,0,0,1,7.811,13.1,4.507,4.507,0,0,1,9.9,10.09l6.708-4.154a4.932,4.932,0,0,1,1.364-.581A5.413,5.413,0,0,1,23.7,7.414a4.679,4.679,0,0,1,.848,3.625,4.272,4.272,0,0,1-.159.61l-.127.375-.344-.237a8.713,8.713,0,0,0-2.628-1.274l-.245-.074.025-.237a1.438,1.438,0,0,0-.272-.968,1.629,1.629,0,0,0-1.725-.622,1.484,1.484,0,0,0-.411.176l-6.722,4.14a1.353,1.353,0,0,0-.631.908,1.394,1.394,0,0,0,.244,1.092,1.634,1.634,0,0,0,1.726.621,1.538,1.538,0,0,0,.413-.175l2.562-1.585a4.9,4.9,0,0,1,1.364-.581,5.417,5.417,0,0,1,5.728,2.059,4.681,4.681,0,0,1,.843,3.625A4.5,4.5,0,0,1,22.1,21.905l-6.707,4.154a4.9,4.9,0,0,1-1.364.581" style="fill:#fff"/></svg>',
|
|
31
|
+
"toml" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_toml</title><path d="M22.76,6.83v3.25h-5V25.17H14.26V10.08h-5V6.83Z" style="fill:#7f7f7f"/><path d="M2,2H8.2V5.09H5.34v21.8H8.2V30H2Z" style="fill:#bfbfbf"/><path d="M30,30H23.8V26.91h2.86V5.11H23.8V2H30Z" style="fill:#bfbfbf"/></svg>',
|
|
32
|
+
"ts" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_typescript</title><path d="M23.827,8.243A4.424,4.424,0,0,1,26.05,9.524a5.853,5.853,0,0,1,.852,1.143c.011.045-1.534,1.083-2.471,1.662-.034.023-.169-.124-.322-.35a2.014,2.014,0,0,0-1.67-1c-1.077-.074-1.771.49-1.766,1.433a1.3,1.3,0,0,0,.153.666c.237.49.677.784,2.059,1.383,2.544,1.095,3.636,1.817,4.31,2.843a5.158,5.158,0,0,1,.416,4.333,4.764,4.764,0,0,1-3.932,2.815,10.9,10.9,0,0,1-2.708-.028,6.531,6.531,0,0,1-3.616-1.884,6.278,6.278,0,0,1-.926-1.371,2.655,2.655,0,0,1,.327-.208c.158-.09.756-.434,1.32-.761L19.1,19.6l.214.312a4.771,4.771,0,0,0,1.35,1.292,3.3,3.3,0,0,0,3.458-.175,1.545,1.545,0,0,0,.2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8,8.8,0,0,1-3.349-2.055,4.687,4.687,0,0,1-.976-1.777,7.116,7.116,0,0,1-.062-2.268,4.332,4.332,0,0,1,3.644-3.374A9,9,0,0,1,23.827,8.243ZM15.484,9.726l.011,1.454h-4.63V24.328H7.6V11.183H2.97V9.755A13.986,13.986,0,0,1,3.01,8.289c.017-.023,2.832-.034,6.245-.028l6.211.017Z" style="fill:#007acc"/></svg>',
|
|
33
|
+
"vue" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_vue</title><path d="M24.4,3.925H30L16,28.075,2,3.925H12.71L16,9.525l3.22-5.6Z" style="fill:#41b883"/><path d="M2,3.925l14,24.15L30,3.925H24.4L16,18.415,7.53,3.925Z" style="fill:#41b883"/><path d="M7.53,3.925,16,18.485l8.4-14.56H19.22L16,9.525l-3.29-5.6Z" style="fill:#35495e"/></svg>',
|
|
34
|
+
"yaml" => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_yaml</title><path d="M2,12.218c.755,0,1.51-.008,2.264,0l.053.038Q5.7,13.638,7.078,15.014c.891-.906,1.8-1.794,2.7-2.7.053-.052.11-.113.192-.1.608,0,1.215,0,1.823,0a1.4,1.4,0,0,1,.353.019c-.7.67-1.377,1.369-2.069,2.05L5.545,18.8c-.331.324-.648.663-.989.975-.754.022-1.511.007-2.266.007,1.223-1.209,2.431-2.433,3.658-3.637C4.627,14.841,3.318,13.525,2,12.218Z" style="fill:#ffe885"/><path d="M12.7,12.218c.613,0,1.226,0,1.839,0q0,3.783,0,7.566c-.611,0-1.222.012-1.832-.008,0-1.664,0-3.329,0-4.994-1.6,1.607-3.209,3.2-4.811,4.8-.089.08-.166.217-.305.194-.824-.006-1.649,0-2.474,0Q8.916,16,12.7,12.218Z" style="fill:#ffe885"/><path d="M14.958,12.22c.47-.009.939,0,1.409,0,.836.853,1.69,1.689,2.536,2.532q1.268-1.267,2.539-2.532.7,0,1.4,0-.008,3.784,0,7.567c-.471,0-.943.006-1.414,0q.008-2.387,0-4.773c-.844.843-1.676,1.7-2.526,2.536-.856-.835-1.687-1.695-2.532-2.541,0,1.594-.006,3.188.006,4.781-.472,0-.943.005-1.415,0Q14.958,16,14.958,12.22Z" style="fill:#ffe885"/><path d="M23.259,12.217c.472,0,.944-.007,1.416,0q-.007,3.083,0,6.166c1.26,0,2.521,0,3.782,0,.063.006.144-.012.191.045.448.454.907.9,1.353,1.354q-3.371.007-6.741,0Q23.267,16,23.259,12.217Z" style="fill:#ffe885"/></svg>'
|
|
35
|
+
}.freeze
|
|
36
|
+
# rubocop:enable Layout/LineLength
|
|
37
|
+
|
|
38
|
+
# Map of file extensions/aliases to icon names
|
|
39
|
+
EXTENSIONS = {
|
|
40
|
+
"css" => "css",
|
|
41
|
+
"go" => "go",
|
|
42
|
+
"graphql" => "graphql",
|
|
43
|
+
"html" => "html",
|
|
44
|
+
"js" => "js",
|
|
45
|
+
"json" => "json",
|
|
46
|
+
"jsx" => "jsx",
|
|
47
|
+
"mysql" => "mysql",
|
|
48
|
+
"pgsql" => "pgsql",
|
|
49
|
+
"php" => "php",
|
|
50
|
+
"proto" => "proto",
|
|
51
|
+
"protobuf" => "proto",
|
|
52
|
+
"py" => "py",
|
|
53
|
+
"rb" => "rb",
|
|
54
|
+
"rs" => "rs",
|
|
55
|
+
"sql" => "sql",
|
|
56
|
+
"svelte" => "svelte",
|
|
57
|
+
"toml" => "toml",
|
|
58
|
+
"ts" => "ts",
|
|
59
|
+
"tsx" => "tsx",
|
|
60
|
+
"vue" => "vue",
|
|
61
|
+
"yaml" => "yaml",
|
|
62
|
+
"postgresql" => "pgsql"
|
|
63
|
+
}.freeze
|
|
64
|
+
|
|
65
|
+
# Get the SVG content for a file extension
|
|
66
|
+
#
|
|
67
|
+
# @param extension [String] The file extension (e.g., "js", "ts")
|
|
68
|
+
# @return [String, nil] The SVG content, or nil if not found
|
|
69
|
+
def self.svg(extension)
|
|
70
|
+
icon_name = EXTENSIONS[extension.to_s.downcase]
|
|
71
|
+
return nil unless icon_name
|
|
72
|
+
|
|
73
|
+
ICONS[icon_name]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Check if an icon exists for a file extension
|
|
77
|
+
#
|
|
78
|
+
# @param extension [String] The file extension to check
|
|
79
|
+
# @return [Boolean] true if icon exists
|
|
80
|
+
def self.exists?(extension)
|
|
81
|
+
EXTENSIONS.key?(extension.to_s.downcase)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Get all available file extensions
|
|
85
|
+
#
|
|
86
|
+
# @return [Array<String>] Array of supported extensions
|
|
87
|
+
def self.available
|
|
88
|
+
EXTENSIONS.keys.sort
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|