docyard 0.8.0 → 1.0.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 +67 -1
- data/README.md +8 -253
- data/exe/docyard +6 -0
- data/lib/docyard/build/asset_bundler.rb +2 -2
- data/lib/docyard/build/file_copier.rb +12 -5
- data/lib/docyard/build/llms_txt_generator.rb +103 -0
- data/lib/docyard/build/sitemap_generator.rb +1 -1
- data/lib/docyard/build/static_generator.rb +115 -79
- data/lib/docyard/builder.rb +6 -2
- data/lib/docyard/cli.rb +14 -4
- data/lib/docyard/components/aliases.rb +12 -0
- data/lib/docyard/components/processors/abbreviation_processor.rb +72 -0
- data/lib/docyard/components/processors/accordion_processor.rb +81 -0
- data/lib/docyard/components/processors/badge_processor.rb +72 -0
- data/lib/docyard/components/processors/callout_processor.rb +9 -3
- data/lib/docyard/components/processors/cards_processor.rb +100 -0
- data/lib/docyard/components/processors/code_block_extended_fence_postprocessor.rb +24 -0
- data/lib/docyard/components/processors/code_block_extended_fence_preprocessor.rb +44 -0
- data/lib/docyard/components/processors/code_block_options_preprocessor.rb +34 -3
- data/lib/docyard/components/processors/code_block_processor.rb +11 -24
- data/lib/docyard/components/processors/code_group_processor.rb +182 -0
- data/lib/docyard/components/processors/code_snippet_import_preprocessor.rb +7 -1
- data/lib/docyard/components/processors/custom_anchor_processor.rb +42 -0
- data/lib/docyard/components/processors/file_tree_processor.rb +150 -0
- data/lib/docyard/components/processors/icon_processor.rb +8 -2
- data/lib/docyard/components/processors/image_caption_processor.rb +96 -0
- data/lib/docyard/components/processors/include_processor.rb +86 -0
- data/lib/docyard/components/processors/steps_processor.rb +89 -0
- data/lib/docyard/components/processors/tabs_processor.rb +9 -1
- data/lib/docyard/components/processors/tooltip_processor.rb +57 -0
- data/lib/docyard/components/processors/video_embed_processor.rb +207 -0
- data/lib/docyard/components/support/code_block/feature_extractor.rb +3 -1
- data/lib/docyard/components/support/code_block/icon_detector.rb +5 -12
- data/lib/docyard/components/support/code_block/line_number_resolver.rb +30 -0
- data/lib/docyard/components/support/code_detector.rb +2 -12
- data/lib/docyard/components/support/code_group/html_builder.rb +118 -0
- data/lib/docyard/components/support/markdown_code_block_helper.rb +56 -0
- data/lib/docyard/components/support/tabs/icon_detector.rb +6 -2
- data/lib/docyard/components/support/tabs/parser.rb +6 -23
- data/lib/docyard/config/analytics_resolver.rb +24 -0
- data/lib/docyard/config/branding_resolver.rb +84 -58
- data/lib/docyard/config/key_validator.rb +30 -0
- data/lib/docyard/config/logo_detector.rb +39 -0
- data/lib/docyard/config/schema.rb +39 -0
- data/lib/docyard/config/section.rb +21 -0
- data/lib/docyard/config/validation_helpers.rb +83 -0
- data/lib/docyard/config/validator.rb +45 -144
- data/lib/docyard/config/validators/navigation.rb +43 -0
- data/lib/docyard/config/validators/section.rb +114 -0
- data/lib/docyard/config.rb +45 -96
- data/lib/docyard/constants.rb +59 -0
- data/lib/docyard/{utils/errors.rb → errors.rb} +6 -0
- data/lib/docyard/initializer.rb +100 -49
- data/lib/docyard/navigation/page_navigation_builder.rb +65 -0
- data/lib/docyard/navigation/sidebar/auto_builder.rb +107 -0
- data/lib/docyard/navigation/sidebar/cache.rb +96 -0
- data/lib/docyard/navigation/sidebar/config_builder.rb +179 -0
- data/lib/docyard/navigation/sidebar/distributed_builder.rb +145 -0
- data/lib/docyard/navigation/sidebar/item.rb +6 -1
- data/lib/docyard/navigation/sidebar/local_config_loader.rb +69 -3
- data/lib/docyard/navigation/sidebar/renderer.rb +18 -3
- data/lib/docyard/navigation/sidebar_builder.rb +43 -81
- data/lib/docyard/rendering/branding_variables.rb +65 -0
- data/lib/docyard/rendering/icon_helpers.rb +14 -1
- data/lib/docyard/rendering/icons/devicons.rb +63 -0
- data/lib/docyard/rendering/icons.rb +26 -27
- data/lib/docyard/rendering/markdown.rb +20 -15
- data/lib/docyard/rendering/og_helpers.rb +36 -0
- data/lib/docyard/rendering/renderer.rb +87 -58
- data/lib/docyard/rendering/template_resolver.rb +14 -0
- data/lib/docyard/routing/fallback_resolver.rb +3 -3
- data/lib/docyard/search/build_indexer.rb +2 -2
- data/lib/docyard/search/dev_indexer.rb +36 -28
- data/lib/docyard/search/pagefind_support.rb +1 -1
- data/lib/docyard/server/asset_handler.rb +40 -15
- data/lib/docyard/server/dev_server.rb +90 -55
- data/lib/docyard/server/file_watcher.rb +68 -18
- data/lib/docyard/server/pagefind_handler.rb +1 -1
- data/lib/docyard/server/preview_server.rb +29 -33
- data/lib/docyard/server/rack_application.rb +38 -70
- data/lib/docyard/server/router.rb +11 -7
- data/lib/docyard/server/sse_server.rb +157 -0
- data/lib/docyard/server/static_file_app.rb +42 -0
- data/lib/docyard/templates/assets/css/components/abbreviation.css +86 -0
- data/lib/docyard/templates/assets/css/components/accordion.css +138 -0
- data/lib/docyard/templates/assets/css/components/badges.css +47 -0
- data/lib/docyard/templates/assets/css/components/banner.css +233 -0
- data/lib/docyard/templates/assets/css/components/breadcrumbs.css +2 -1
- data/lib/docyard/templates/assets/css/components/callout.css +26 -6
- data/lib/docyard/templates/assets/css/components/cards.css +100 -0
- data/lib/docyard/templates/assets/css/components/code-block.css +14 -2
- data/lib/docyard/templates/assets/css/components/code-group.css +294 -0
- data/lib/docyard/templates/assets/css/components/feedback.css +126 -0
- data/lib/docyard/templates/assets/css/components/figure.css +22 -0
- data/lib/docyard/templates/assets/css/components/file-tree.css +125 -0
- data/lib/docyard/templates/assets/css/components/heading-anchor.css +21 -13
- data/lib/docyard/templates/assets/css/components/icon.css +5 -0
- data/lib/docyard/templates/assets/css/components/lightbox.css +65 -0
- data/lib/docyard/templates/assets/css/components/nav-menu.css +20 -4
- data/lib/docyard/templates/assets/css/components/navigation.css +32 -3
- data/lib/docyard/templates/assets/css/components/page-actions.css +131 -0
- data/lib/docyard/templates/assets/css/components/prev-next.css +20 -22
- data/lib/docyard/templates/assets/css/components/search.css +6 -10
- data/lib/docyard/templates/assets/css/components/steps.css +122 -0
- data/lib/docyard/templates/assets/css/components/tab-bar.css +7 -4
- data/lib/docyard/templates/assets/css/components/table-of-contents.css +57 -11
- data/lib/docyard/templates/assets/css/components/tabs.css +13 -5
- data/lib/docyard/templates/assets/css/components/theme-toggle.css +3 -1
- data/lib/docyard/templates/assets/css/components/tooltip.css +113 -0
- data/lib/docyard/templates/assets/css/components/video.css +41 -0
- data/lib/docyard/templates/assets/css/landing.css +82 -13
- data/lib/docyard/templates/assets/css/layout.css +17 -0
- data/lib/docyard/templates/assets/css/markdown.css +25 -3
- data/lib/docyard/templates/assets/css/variables.css +13 -1
- data/lib/docyard/templates/assets/js/components/abbreviation.js +85 -0
- data/lib/docyard/templates/assets/js/components/banner.js +81 -0
- data/lib/docyard/templates/assets/js/components/code-group.js +286 -0
- data/lib/docyard/templates/assets/js/components/copy-page.js +115 -0
- data/lib/docyard/templates/assets/js/components/feedback.js +66 -0
- data/lib/docyard/templates/assets/js/components/file-tree.js +39 -0
- data/lib/docyard/templates/assets/js/components/lightbox.js +72 -0
- data/lib/docyard/templates/assets/js/components/navigation.js +3 -3
- data/lib/docyard/templates/assets/js/components/search.js +3 -3
- data/lib/docyard/templates/assets/js/components/table-of-contents.js +12 -6
- data/lib/docyard/templates/assets/js/components/tabs.js +45 -22
- data/lib/docyard/templates/assets/js/components/tooltip.js +118 -0
- data/lib/docyard/templates/assets/js/hot-reload.js +44 -0
- data/lib/docyard/templates/errors/404.html.erb +114 -5
- data/lib/docyard/templates/errors/500.html.erb +173 -10
- data/lib/docyard/templates/init/_sidebar.yml +36 -0
- data/lib/docyard/templates/init/docyard.yml +36 -0
- data/lib/docyard/templates/init/pages/components.md +146 -0
- data/lib/docyard/templates/init/pages/getting-started.md +94 -0
- data/lib/docyard/templates/init/pages/index.md +22 -0
- data/lib/docyard/templates/layouts/default.html.erb +11 -0
- data/lib/docyard/templates/layouts/splash.html.erb +15 -1
- data/lib/docyard/templates/partials/_accordion.html.erb +9 -0
- data/lib/docyard/templates/partials/_analytics.html.erb +24 -0
- data/lib/docyard/templates/partials/_banner.html.erb +27 -0
- data/lib/docyard/templates/partials/_card.html.erb +23 -0
- data/lib/docyard/templates/partials/_code_block.html.erb +1 -1
- data/lib/docyard/templates/partials/_feedback.html.erb +14 -0
- data/lib/docyard/templates/partials/_footer.html.erb +1 -1
- data/lib/docyard/templates/partials/_head.html.erb +79 -4
- data/lib/docyard/templates/partials/_icon_library.html.erb +8 -0
- data/lib/docyard/templates/partials/_nav_group.html.erb +6 -0
- data/lib/docyard/templates/partials/_nav_leaf.html.erb +3 -0
- data/lib/docyard/templates/partials/_page_actions.html.erb +21 -0
- data/lib/docyard/templates/partials/_scripts.html.erb +6 -3
- data/lib/docyard/templates/partials/_step.html.erb +14 -0
- data/lib/docyard/templates/partials/_tabs.html.erb +4 -1
- data/lib/docyard/utils/git_info.rb +157 -0
- data/lib/docyard/utils/hash_utils.rb +31 -0
- data/lib/docyard/utils/html_helpers.rb +8 -0
- data/lib/docyard/utils/logging.rb +44 -3
- data/lib/docyard/utils/path_resolver.rb +0 -10
- data/lib/docyard/utils/path_utils.rb +73 -0
- data/lib/docyard/version.rb +1 -1
- data/lib/docyard.rb +2 -2
- metadata +114 -47
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
- data/.github/pull_request_template.md +0 -14
- data/.github/workflows/ci.yml +0 -49
- data/.rubocop.yml +0 -42
- data/CODE_OF_CONDUCT.md +0 -132
- data/CONTRIBUTING.md +0 -55
- data/LICENSE.vscode-icons +0 -42
- data/Rakefile +0 -8
- data/lib/docyard/config/constants.rb +0 -31
- data/lib/docyard/navigation/sidebar/children_discoverer.rb +0 -51
- data/lib/docyard/navigation/sidebar/config_parser.rb +0 -208
- data/lib/docyard/navigation/sidebar/file_resolver.rb +0 -78
- data/lib/docyard/navigation/sidebar/file_system_scanner.rb +0 -78
- data/lib/docyard/navigation/sidebar/metadata_extractor.rb +0 -69
- data/lib/docyard/navigation/sidebar/metadata_reader.rb +0 -47
- data/lib/docyard/navigation/sidebar/path_prefixer.rb +0 -34
- data/lib/docyard/navigation/sidebar/sorter.rb +0 -21
- data/lib/docyard/navigation/sidebar/title_extractor.rb +0 -25
- data/lib/docyard/navigation/sidebar/tree_builder.rb +0 -139
- data/lib/docyard/rendering/icons/LICENSE.phosphor +0 -21
- data/lib/docyard/rendering/icons/file_types.rb +0 -79
- data/lib/docyard/rendering/icons/phosphor.rb +0 -90
- data/lib/docyard/rendering/language_mapping.rb +0 -52
- data/lib/docyard/templates/assets/js/reload.js +0 -98
- data/lib/docyard/templates/partials/_icon.html.erb +0 -1
- data/lib/docyard/templates/partials/_icon_file_extension.html.erb +0 -1
- data/sig/docyard.rbs +0 -4
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "socket"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Docyard
|
|
7
|
+
class SSEServer
|
|
8
|
+
HEARTBEAT_INTERVAL = 15
|
|
9
|
+
DEFAULT_PORT = 4201
|
|
10
|
+
|
|
11
|
+
def initialize(port: DEFAULT_PORT)
|
|
12
|
+
@port = port
|
|
13
|
+
@connections = []
|
|
14
|
+
@mutex = Mutex.new
|
|
15
|
+
@running = false
|
|
16
|
+
@server = nil
|
|
17
|
+
@accept_thread = nil
|
|
18
|
+
@heartbeat_thread = nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
attr_reader :port
|
|
22
|
+
|
|
23
|
+
def start
|
|
24
|
+
@running = true
|
|
25
|
+
@server = TCPServer.new("127.0.0.1", @port)
|
|
26
|
+
@server.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true)
|
|
27
|
+
|
|
28
|
+
start_accept_thread
|
|
29
|
+
start_heartbeat_thread
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def stop
|
|
33
|
+
@running = false
|
|
34
|
+
close_server
|
|
35
|
+
@accept_thread&.kill
|
|
36
|
+
@heartbeat_thread&.kill
|
|
37
|
+
close_all_connections
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def broadcast(event_type, data = {})
|
|
41
|
+
message = format_sse_message(event_type, data)
|
|
42
|
+
dead_connections = []
|
|
43
|
+
|
|
44
|
+
@mutex.synchronize do
|
|
45
|
+
@connections.each do |conn|
|
|
46
|
+
write_to_connection(conn, message) or dead_connections << conn
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
dead_connections.each { |conn| remove_connection_unsafe(conn) }
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def connection_count
|
|
54
|
+
@mutex.synchronize { @connections.size }
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def close_server
|
|
60
|
+
@server&.close
|
|
61
|
+
rescue StandardError
|
|
62
|
+
nil
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def start_accept_thread
|
|
66
|
+
@accept_thread = Thread.new do
|
|
67
|
+
while @running
|
|
68
|
+
begin
|
|
69
|
+
client = @server.accept
|
|
70
|
+
Thread.new { handle_new_connection(client) }
|
|
71
|
+
rescue IOError, Errno::EBADF
|
|
72
|
+
break unless @running
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def handle_new_connection(client)
|
|
79
|
+
request = read_http_request(client)
|
|
80
|
+
return close_client(client) unless valid_sse_request?(request)
|
|
81
|
+
|
|
82
|
+
send_sse_headers(client)
|
|
83
|
+
@mutex.synchronize { @connections << client }
|
|
84
|
+
rescue StandardError
|
|
85
|
+
close_client(client)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def close_client(client)
|
|
89
|
+
client.close
|
|
90
|
+
rescue StandardError
|
|
91
|
+
nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def read_http_request(client)
|
|
95
|
+
lines = []
|
|
96
|
+
while (line = client.gets)
|
|
97
|
+
break if line.strip.empty?
|
|
98
|
+
|
|
99
|
+
lines << line
|
|
100
|
+
end
|
|
101
|
+
lines.join
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def valid_sse_request?(request)
|
|
105
|
+
request.include?("GET /_docyard/events") || request.include?("GET / ")
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def send_sse_headers(client)
|
|
109
|
+
headers = [
|
|
110
|
+
"HTTP/1.1 200 OK",
|
|
111
|
+
"Content-Type: text/event-stream",
|
|
112
|
+
"Cache-Control: no-cache",
|
|
113
|
+
"Connection: keep-alive",
|
|
114
|
+
"Access-Control-Allow-Origin: *",
|
|
115
|
+
"",
|
|
116
|
+
""
|
|
117
|
+
].join("\r\n")
|
|
118
|
+
|
|
119
|
+
client.write(headers)
|
|
120
|
+
client.write("retry: 1000\n\n")
|
|
121
|
+
client.flush
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def start_heartbeat_thread
|
|
125
|
+
@heartbeat_thread = Thread.new do
|
|
126
|
+
while @running
|
|
127
|
+
sleep HEARTBEAT_INTERVAL
|
|
128
|
+
broadcast("heartbeat", { time: Time.now.to_i }) if @running
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def write_to_connection(conn, message)
|
|
134
|
+
conn.write_nonblock(message)
|
|
135
|
+
true
|
|
136
|
+
rescue IO::WaitWritable, IOError, Errno::EPIPE, Errno::ECONNRESET, Errno::ETIMEDOUT
|
|
137
|
+
false
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def format_sse_message(event_type, data)
|
|
141
|
+
json_data = data.to_json
|
|
142
|
+
"event: #{event_type}\ndata: #{json_data}\n\n"
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def remove_connection_unsafe(conn)
|
|
146
|
+
@connections.delete(conn)
|
|
147
|
+
close_client(conn)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def close_all_connections
|
|
151
|
+
@mutex.synchronize do
|
|
152
|
+
@connections.each { |conn| close_client(conn) }
|
|
153
|
+
@connections.clear
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rack/mime"
|
|
4
|
+
|
|
5
|
+
module Docyard
|
|
6
|
+
class StaticFileApp
|
|
7
|
+
def initialize(root)
|
|
8
|
+
@root = root
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def call(env)
|
|
12
|
+
path = env["PATH_INFO"]
|
|
13
|
+
file_path = File.join(@root, path)
|
|
14
|
+
|
|
15
|
+
if path.end_with?("/") || File.directory?(file_path)
|
|
16
|
+
index_path = File.join(file_path, "index.html")
|
|
17
|
+
return serve_file(index_path) if File.file?(index_path)
|
|
18
|
+
elsif File.file?(file_path)
|
|
19
|
+
return serve_file(file_path)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
serve_not_found
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def serve_file(path)
|
|
28
|
+
content = File.read(path)
|
|
29
|
+
content_type = Rack::Mime.mime_type(File.extname(path), "application/octet-stream")
|
|
30
|
+
[200, { "content-type" => content_type }, [content]]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def serve_not_found
|
|
34
|
+
error_page = File.join(@root, "404.html")
|
|
35
|
+
if File.file?(error_page)
|
|
36
|
+
[404, { "content-type" => "text/html; charset=utf-8" }, [File.read(error_page)]]
|
|
37
|
+
else
|
|
38
|
+
[404, { "content-type" => "text/plain" }, ["Not Found"]]
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
.docyard-abbr {
|
|
2
|
+
text-decoration: underline;
|
|
3
|
+
text-decoration-style: dotted;
|
|
4
|
+
text-decoration-color: var(--muted-foreground);
|
|
5
|
+
text-underline-offset: 3px;
|
|
6
|
+
cursor: help;
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.docyard-abbr:hover {
|
|
11
|
+
text-decoration-color: var(--primary);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.docyard-abbr-popover {
|
|
15
|
+
position: absolute;
|
|
16
|
+
z-index: 1000;
|
|
17
|
+
width: max-content;
|
|
18
|
+
max-width: 280px;
|
|
19
|
+
padding: var(--spacing-3) var(--spacing-4);
|
|
20
|
+
background: var(--background);
|
|
21
|
+
border: 1px solid var(--border);
|
|
22
|
+
border-radius: var(--radius-lg);
|
|
23
|
+
box-shadow:
|
|
24
|
+
0 4px 6px -1px oklch(from var(--foreground) l c h / 8%),
|
|
25
|
+
0 2px 4px -2px oklch(from var(--foreground) l c h / 6%);
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
transform: translateY(-4px) scale(0.96);
|
|
29
|
+
transition:
|
|
30
|
+
opacity 0.15s ease,
|
|
31
|
+
transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.docyard-abbr-popover.is-visible {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
transform: translateY(0) scale(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.docyard-abbr-popover::after {
|
|
40
|
+
content: "";
|
|
41
|
+
position: absolute;
|
|
42
|
+
bottom: -6px;
|
|
43
|
+
left: var(--arrow-left, 16px);
|
|
44
|
+
width: 10px;
|
|
45
|
+
height: 10px;
|
|
46
|
+
background: var(--background);
|
|
47
|
+
border-bottom: 1px solid var(--border);
|
|
48
|
+
border-right: 1px solid var(--border);
|
|
49
|
+
transform: rotate(45deg);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.docyard-abbr-popover.is-below::after {
|
|
53
|
+
top: -6px;
|
|
54
|
+
bottom: auto;
|
|
55
|
+
border-bottom: none;
|
|
56
|
+
border-right: none;
|
|
57
|
+
border-top: 1px solid var(--border);
|
|
58
|
+
border-left: 1px solid var(--border);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.docyard-abbr-popover__term {
|
|
62
|
+
display: block;
|
|
63
|
+
font-weight: var(--font-semibold);
|
|
64
|
+
font-size: var(--text-sm);
|
|
65
|
+
color: var(--foreground);
|
|
66
|
+
margin-bottom: var(--spacing-1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.docyard-abbr-popover__definition {
|
|
70
|
+
display: block;
|
|
71
|
+
font-size: var(--text-sm);
|
|
72
|
+
color: var(--muted-foreground);
|
|
73
|
+
line-height: var(--leading-relaxed);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (max-width: 640px) {
|
|
77
|
+
.docyard-abbr-popover {
|
|
78
|
+
max-width: 240px;
|
|
79
|
+
padding: var(--spacing-2) var(--spacing-3);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.docyard-abbr-popover__term,
|
|
83
|
+
.docyard-abbr-popover__definition {
|
|
84
|
+
font-size: var(--text-xs);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
.docyard-accordion {
|
|
2
|
+
margin: var(--spacing-4) 0;
|
|
3
|
+
border: 1px solid var(--border);
|
|
4
|
+
border-radius: var(--radius-xl);
|
|
5
|
+
background-color: var(--card);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.docyard-accordion__summary {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: var(--spacing-3);
|
|
12
|
+
padding: var(--spacing-3) var(--spacing-4);
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
user-select: none;
|
|
15
|
+
font-weight: var(--font-medium);
|
|
16
|
+
font-size: var(--text-sm);
|
|
17
|
+
color: var(--foreground);
|
|
18
|
+
list-style: none;
|
|
19
|
+
transition: background-color var(--transition-fast);
|
|
20
|
+
border-radius: var(--radius-xl);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.docyard-accordion__summary::-webkit-details-marker {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.docyard-accordion__summary::marker {
|
|
28
|
+
display: none;
|
|
29
|
+
content: "";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.docyard-accordion__summary:hover {
|
|
33
|
+
background-color: var(--accent);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.docyard-accordion__summary:focus-visible {
|
|
37
|
+
outline: 2px solid var(--ring);
|
|
38
|
+
outline-offset: -2px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.docyard-accordion[open] .docyard-accordion__summary {
|
|
42
|
+
border-bottom-left-radius: 0;
|
|
43
|
+
border-bottom-right-radius: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.docyard-accordion__icon {
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
width: 1rem;
|
|
49
|
+
height: 1rem;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
color: var(--muted-foreground);
|
|
54
|
+
transition: transform var(--transition-fast);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.docyard-accordion__icon svg {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.docyard-accordion[open] .docyard-accordion__icon {
|
|
63
|
+
transform: rotate(90deg);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.docyard-accordion__title {
|
|
67
|
+
flex: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.docyard-accordion__content {
|
|
71
|
+
padding: var(--spacing-4);
|
|
72
|
+
font-size: var(--text-sm);
|
|
73
|
+
color: var(--foreground);
|
|
74
|
+
line-height: var(--leading-relaxed);
|
|
75
|
+
border-top: 1px solid var(--border);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.docyard-accordion__content > *:first-child {
|
|
79
|
+
margin-top: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.docyard-accordion__content > *:last-child {
|
|
83
|
+
margin-bottom: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.docyard-accordion__content a {
|
|
87
|
+
color: var(--primary);
|
|
88
|
+
text-decoration: underline;
|
|
89
|
+
text-underline-offset: 3px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.docyard-accordion__content a:hover {
|
|
93
|
+
color: var(--foreground);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.docyard-accordion__content pre {
|
|
97
|
+
margin: var(--spacing-4) 0;
|
|
98
|
+
border-radius: var(--radius-lg);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.docyard-accordion__content :not(pre) > code {
|
|
102
|
+
background-color: var(--muted);
|
|
103
|
+
padding: 0.125rem 0.375rem;
|
|
104
|
+
border-radius: var(--radius-sm);
|
|
105
|
+
font-size: 0.875em;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.docyard-accordion + .docyard-accordion {
|
|
109
|
+
margin-top: -1px;
|
|
110
|
+
border-top-left-radius: 0;
|
|
111
|
+
border-top-right-radius: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.docyard-accordion + .docyard-accordion .docyard-accordion__summary {
|
|
115
|
+
border-top-left-radius: 0;
|
|
116
|
+
border-top-right-radius: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.docyard-accordion:has(+ .docyard-accordion) {
|
|
120
|
+
border-bottom-left-radius: 0;
|
|
121
|
+
border-bottom-right-radius: 0;
|
|
122
|
+
margin-bottom: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.docyard-accordion:has(+ .docyard-accordion) .docyard-accordion__summary {
|
|
126
|
+
border-bottom-left-radius: 0;
|
|
127
|
+
border-bottom-right-radius: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@media (prefers-reduced-motion: reduce) {
|
|
131
|
+
.docyard-accordion__icon {
|
|
132
|
+
transition: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.docyard-accordion__summary {
|
|
136
|
+
transition: none;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.docyard-badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
padding: 0.125rem 0.5rem;
|
|
5
|
+
font-size: var(--text-xs);
|
|
6
|
+
font-weight: var(--font-medium);
|
|
7
|
+
line-height: var(--leading-normal);
|
|
8
|
+
border-radius: var(--radius-4xl);
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.docyard-badge--default {
|
|
14
|
+
background-color: var(--muted);
|
|
15
|
+
color: var(--muted-foreground);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.docyard-badge--success {
|
|
19
|
+
background-color: var(--callout-tip-background);
|
|
20
|
+
color: var(--callout-tip-foreground);
|
|
21
|
+
border: 1px solid var(--callout-tip-border);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.docyard-badge--warning {
|
|
25
|
+
background-color: var(--callout-warning-background);
|
|
26
|
+
color: var(--callout-warning-foreground);
|
|
27
|
+
border: 1px solid var(--callout-warning-border);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.docyard-badge--danger {
|
|
31
|
+
background-color: var(--callout-danger-background);
|
|
32
|
+
color: var(--callout-danger-foreground);
|
|
33
|
+
border: 1px solid var(--callout-danger-border);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h1 .docyard-badge,
|
|
37
|
+
h2 .docyard-badge,
|
|
38
|
+
h3 .docyard-badge,
|
|
39
|
+
h4 .docyard-badge,
|
|
40
|
+
h5 .docyard-badge,
|
|
41
|
+
h6 .docyard-badge {
|
|
42
|
+
margin-left: var(--spacing-2);
|
|
43
|
+
font-size: var(--text-xs);
|
|
44
|
+
vertical-align: middle;
|
|
45
|
+
position: relative;
|
|
46
|
+
top: -0.1em;
|
|
47
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
.docyard-announcement {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
padding: 0.4rem 3rem;
|
|
10
|
+
background: linear-gradient(135deg, oklch(0.68 0.13 215) 0%, var(--primary) 15%, var(--primary) 85%, oklch(0.52 0.10 225) 100%);
|
|
11
|
+
color: white;
|
|
12
|
+
font-size: var(--text-sm);
|
|
13
|
+
z-index: 9999;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.docyard-announcement.is-dismissed {
|
|
17
|
+
animation: docyard-announcement-exit 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes docyard-announcement-exit {
|
|
21
|
+
from {
|
|
22
|
+
transform: translateY(0);
|
|
23
|
+
opacity: 1;
|
|
24
|
+
}
|
|
25
|
+
to {
|
|
26
|
+
transform: translateY(-100%);
|
|
27
|
+
opacity: 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
body.has-announcement {
|
|
32
|
+
--announcement-height: 2rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body.has-announcement .header {
|
|
36
|
+
top: var(--announcement-height);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
body.has-announcement .tab-bar {
|
|
40
|
+
top: calc(var(--header-height) + var(--announcement-height));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body.has-announcement .sidebar {
|
|
44
|
+
top: calc(var(--header-height) + var(--tab-bar-height) + var(--announcement-height));
|
|
45
|
+
height: calc(100vh - var(--header-height) - var(--tab-bar-height) - var(--announcement-height));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
body.has-announcement .doc-aside {
|
|
49
|
+
top: calc(var(--header-height) + var(--tab-bar-height) + var(--announcement-height));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
body.has-announcement .secondary-header {
|
|
53
|
+
top: calc(var(--header-height) + var(--tab-bar-height) + var(--announcement-height));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
body.has-announcement:not(.has-tabs) .secondary-header {
|
|
57
|
+
top: calc(var(--header-height) + var(--announcement-height));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
body.has-announcement .layout {
|
|
61
|
+
padding-top: calc(var(--header-height) + var(--tab-bar-height) + var(--announcement-height));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
body.has-announcement:not(.has-tabs) .sidebar {
|
|
65
|
+
top: calc(var(--header-height) + var(--announcement-height));
|
|
66
|
+
height: calc(100vh - var(--header-height) - var(--announcement-height));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
body.has-announcement:not(.has-tabs) .doc-aside {
|
|
70
|
+
top: calc(var(--header-height) + var(--announcement-height));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
body.has-announcement:not(.has-tabs) .layout {
|
|
74
|
+
padding-top: calc(var(--header-height) + var(--announcement-height));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (max-width: 1280px) and (min-width: 1025px) {
|
|
78
|
+
body.has-announcement .layout {
|
|
79
|
+
padding-top: calc(var(--header-height) + var(--tab-bar-height) + var(--announcement-height) + 3rem);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
body.has-announcement:not(.has-tabs) .layout {
|
|
83
|
+
padding-top: calc(var(--header-height) + var(--announcement-height) + 3rem);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Mobile: tab bar is hidden, so don't include tab-bar-height */
|
|
88
|
+
@media (max-width: 1024px) {
|
|
89
|
+
body.has-announcement .secondary-header {
|
|
90
|
+
top: calc(var(--header-height) + var(--announcement-height));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
body.has-announcement .layout {
|
|
94
|
+
padding-top: calc(var(--header-height) + var(--announcement-height) + 3rem);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
body.has-announcement .sidebar {
|
|
98
|
+
top: 0;
|
|
99
|
+
height: 100vh;
|
|
100
|
+
height: 100dvh;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.docyard-announcement__content {
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
gap: 0.75rem;
|
|
109
|
+
min-width: 0;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.docyard-announcement__text {
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
letter-spacing: -0.01em;
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
text-overflow: ellipsis;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.docyard-announcement__link {
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: 0.375rem;
|
|
125
|
+
color: white;
|
|
126
|
+
text-decoration: none;
|
|
127
|
+
min-width: 0;
|
|
128
|
+
transition: gap 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.docyard-announcement__link:hover {
|
|
132
|
+
gap: 0.5rem;
|
|
133
|
+
color: white;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.docyard-announcement__link .icon {
|
|
137
|
+
width: 1rem;
|
|
138
|
+
height: 1rem;
|
|
139
|
+
flex-shrink: 0;
|
|
140
|
+
transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.docyard-announcement__link:hover .icon {
|
|
144
|
+
transform: translateX(2px);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.docyard-announcement[data-has-button="true"] .docyard-announcement__link .icon {
|
|
148
|
+
display: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.docyard-announcement__button {
|
|
152
|
+
display: inline-flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
flex-shrink: 0;
|
|
155
|
+
padding: 0.175rem 0.625rem;
|
|
156
|
+
background: rgba(255, 255, 255, 0.15);
|
|
157
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
158
|
+
border-radius: 9999px;
|
|
159
|
+
color: white;
|
|
160
|
+
font-size: var(--text-xs);
|
|
161
|
+
font-weight: 600;
|
|
162
|
+
text-decoration: none;
|
|
163
|
+
backdrop-filter: blur(4px);
|
|
164
|
+
transition:
|
|
165
|
+
transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
|
|
166
|
+
background 0.2s cubic-bezier(0.16, 1, 0.3, 1),
|
|
167
|
+
border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.docyard-announcement__button:hover {
|
|
171
|
+
background: rgba(255, 255, 255, 0.25);
|
|
172
|
+
border-color: rgba(255, 255, 255, 0.4);
|
|
173
|
+
color: white;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.docyard-announcement__button:active {
|
|
177
|
+
transform: scale(0.95);
|
|
178
|
+
transition: transform 0.1s cubic-bezier(0.4, 0, 1, 1);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.docyard-announcement__dismiss {
|
|
182
|
+
position: absolute;
|
|
183
|
+
right: 0.75rem;
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
width: 1.5rem;
|
|
188
|
+
height: 1.5rem;
|
|
189
|
+
padding: 0;
|
|
190
|
+
background: transparent;
|
|
191
|
+
border: none;
|
|
192
|
+
border-radius: var(--radius-4xl);
|
|
193
|
+
color: white;
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
transition: background-color var(--transition-fast), color var(--transition-fast);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.docyard-announcement__dismiss:hover {
|
|
199
|
+
color: white;
|
|
200
|
+
background-color: rgba(255, 255, 255, 0.15);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.docyard-announcement__dismiss .icon {
|
|
204
|
+
width: 0.875rem;
|
|
205
|
+
height: 0.875rem;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media (max-width: 768px) {
|
|
209
|
+
.docyard-announcement {
|
|
210
|
+
padding: 0.4rem 2.5rem;
|
|
211
|
+
font-size: var(--text-xs);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.docyard-announcement__content {
|
|
215
|
+
gap: 0.5rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.docyard-announcement[data-has-button="true"] .docyard-announcement__link .icon {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.docyard-announcement__button {
|
|
223
|
+
display: none;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.docyard-announcement__dismiss {
|
|
227
|
+
right: 0.5rem;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.dark .docyard-announcement {
|
|
232
|
+
background: linear-gradient(135deg, oklch(0.78 0.14 210) 0%, var(--primary) 15%, var(--primary) 85%, oklch(0.58 0.11 225) 100%);
|
|
233
|
+
}
|