hunk_review_changes 0.2.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 +7 -0
- data/CHANGELOG.md +33 -0
- data/LICENSE.txt +27 -0
- data/README.md +126 -0
- data/exe/hunk-review-changes +6 -0
- data/lib/hunk_review_changes/app.rb +138 -0
- data/lib/hunk_review_changes/assets.rb +34 -0
- data/lib/hunk_review_changes/bundle.rb +122 -0
- data/lib/hunk_review_changes/cli.rb +106 -0
- data/lib/hunk_review_changes/diff.rb +205 -0
- data/lib/hunk_review_changes/export.rb +84 -0
- data/lib/hunk_review_changes/installer/base.rb +39 -0
- data/lib/hunk_review_changes/installer/claude_code.rb +44 -0
- data/lib/hunk_review_changes/installer/codex.rb +21 -0
- data/lib/hunk_review_changes/installer/cursor.rb +22 -0
- data/lib/hunk_review_changes/installer/directory_installer.rb +36 -0
- data/lib/hunk_review_changes/installer/opencode.rb +27 -0
- data/lib/hunk_review_changes/installer/runner.rb +122 -0
- data/lib/hunk_review_changes/installer/skill_source.rb +53 -0
- data/lib/hunk_review_changes/lifecycle.rb +42 -0
- data/lib/hunk_review_changes/markdown.rb +69 -0
- data/lib/hunk_review_changes/public/app.css +237 -0
- data/lib/hunk_review_changes/public/fonts/AtkinsonHyperlegibleMono.woff2 +0 -0
- data/lib/hunk_review_changes/public/fonts/AtkinsonHyperlegibleNext-Italic.woff2 +0 -0
- data/lib/hunk_review_changes/public/fonts/AtkinsonHyperlegibleNext.woff2 +0 -0
- data/lib/hunk_review_changes/public/fonts/OFL.txt +98 -0
- data/lib/hunk_review_changes/server.rb +99 -0
- data/lib/hunk_review_changes/state.rb +99 -0
- data/lib/hunk_review_changes/version.rb +5 -0
- data/lib/hunk_review_changes/views/index.erb +395 -0
- data/lib/hunk_review_changes.rb +35 -0
- metadata +185 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HunkReviewChanges
|
|
4
|
+
# Tracks the browser tab's liveness so the server can shut itself down shortly after
|
|
5
|
+
# the tab closes and never leak a process. The app records events here; the server's
|
|
6
|
+
# watchdog thread reads them.
|
|
7
|
+
class Lifecycle
|
|
8
|
+
BYE_GRACE = 8 # seconds to wait after a tab says it is closing
|
|
9
|
+
SILENT_LIMIT = 900 # a live tab that goes quiet this long is treated as crashed
|
|
10
|
+
CONNECT_LIMIT = 180 # give up if no tab ever connects
|
|
11
|
+
|
|
12
|
+
def initialize(clock: -> { Time.now })
|
|
13
|
+
@clock = clock
|
|
14
|
+
@mutex = Mutex.new
|
|
15
|
+
@last_heartbeat = nil
|
|
16
|
+
@bye_at = nil
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# A fresh heartbeat (e.g. from a reload) also cancels a pending goodbye.
|
|
20
|
+
def heartbeat!
|
|
21
|
+
@mutex.synchronize do
|
|
22
|
+
@last_heartbeat = @clock.call
|
|
23
|
+
@bye_at = nil
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def bye!
|
|
28
|
+
@mutex.synchronize { @bye_at = @clock.call + BYE_GRACE }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Whether the server should exit now, given when it booted.
|
|
32
|
+
def expired?(boot_time)
|
|
33
|
+
now = @clock.call
|
|
34
|
+
last, bye = @mutex.synchronize { [@last_heartbeat, @bye_at] }
|
|
35
|
+
return true if bye && now >= bye
|
|
36
|
+
return true if last && now - last > SILENT_LIMIT
|
|
37
|
+
return true if last.nil? && now - boot_time > CONNECT_LIMIT
|
|
38
|
+
|
|
39
|
+
false
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "kramdown"
|
|
4
|
+
require "kramdown-parser-gfm"
|
|
5
|
+
|
|
6
|
+
module HunkReviewChanges
|
|
7
|
+
# Renders the prose fields (what/why/framing/flags) as GitHub-flavored Markdown.
|
|
8
|
+
module Markdown
|
|
9
|
+
module_function
|
|
10
|
+
|
|
11
|
+
# Schemes allowed on rendered links and images. Kramdown does not sanitize URLs,
|
|
12
|
+
# so anything else (javascript:, data:, vbscript:, file:, ...) is neutralized to
|
|
13
|
+
# keep bundle prose from running script in the local app origin.
|
|
14
|
+
SAFE_SCHEMES = %w[http https mailto tel].freeze
|
|
15
|
+
|
|
16
|
+
def html(text)
|
|
17
|
+
return "" if text.nil? || text.to_s.strip.empty?
|
|
18
|
+
|
|
19
|
+
rendered = Kramdown::Document.new(
|
|
20
|
+
text.to_s,
|
|
21
|
+
input: "GFM",
|
|
22
|
+
hard_wrap: true,
|
|
23
|
+
auto_ids: false,
|
|
24
|
+
parse_block_html: false,
|
|
25
|
+
parse_span_html: false
|
|
26
|
+
).to_html.strip
|
|
27
|
+
sanitize_urls(rendered)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Unwrap a single top-level <p> so the prose can sit inline after a bold lead-in
|
|
31
|
+
# label ("What it does — ..."); multi-paragraph / list output is returned as-is.
|
|
32
|
+
def inline(text)
|
|
33
|
+
rendered = html(text)
|
|
34
|
+
if rendered.start_with?("<p>") && rendered.end_with?("</p>") && !rendered[3..-5].include?("<p")
|
|
35
|
+
rendered[3..-5]
|
|
36
|
+
else
|
|
37
|
+
rendered
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Replace the value of any href/src whose scheme is not allowlisted with "#", so a
|
|
42
|
+
# link like [x](javascript:alert(1)) renders inert while safe URLs pass untouched.
|
|
43
|
+
def sanitize_urls(html)
|
|
44
|
+
html.gsub(/(\s(?:href|src)=)(["'])(.*?)\2/im) do
|
|
45
|
+
attr = Regexp.last_match(1)
|
|
46
|
+
quote = Regexp.last_match(2)
|
|
47
|
+
url = Regexp.last_match(3)
|
|
48
|
+
"#{attr}#{quote}#{safe_url?(url) ? url : "#"}#{quote}"
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def safe_url?(url)
|
|
53
|
+
scheme = url_scheme(url)
|
|
54
|
+
scheme.nil? || SAFE_SCHEMES.include?(scheme)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# The scheme a browser would act on: it decodes numeric entities and ignores
|
|
58
|
+
# control/whitespace characters before parsing the scheme, so normalize the same
|
|
59
|
+
# way. Returns nil for relative/fragment/protocol-relative URLs (which are safe).
|
|
60
|
+
def url_scheme(url)
|
|
61
|
+
candidate = url
|
|
62
|
+
.gsub(/&#x([0-9a-f]+);/i) { [Regexp.last_match(1).to_i(16)].pack("U") }
|
|
63
|
+
.gsub(/&#(\d+);/) { [Regexp.last_match(1).to_i].pack("U") }
|
|
64
|
+
.gsub(/&/i, "&")
|
|
65
|
+
.gsub(/[[:cntrl:][:space:]]/, "")
|
|
66
|
+
candidate[/\A([a-z][a-z0-9+.-]*):/i, 1]&.downcase
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:"Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;--font-mono:"Atkinson Hyperlegible Mono", ui-monospace, SFMono-Regular, Menlo, monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-sky-100:oklch(95.1% .026 236.824);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-700:oklch(50% .134 242.749);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-700:oklch(45.7% .24 277.023);--color-violet-100:oklch(94.3% .029 294.588);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-700:oklch(49.1% .27 292.581);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.bottom-6{bottom:calc(var(--spacing) * 6)}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-full{height:100%}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-full{width:100%}.max-w-\[1440px\]{max-width:1440px}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 10) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 10) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:var(--spacing)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-400{border-color:var(--color-amber-400)}.border-emerald-500{border-color:var(--color-emerald-500)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-red-400{border-color:var(--color-red-400)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-transparent{border-color:#0000}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-200{background-color:var(--color-amber-200)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-red-200{background-color:var(--color-red-200)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-sky-100{background-color:var(--color-sky-100)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\/60{background-color:#0f172b99}@supports (color:color-mix(in lab, red, red)){.bg-slate-900\/60{background-color:color-mix(in oklab, var(--color-slate-900) 60%, transparent)}}.bg-violet-100{background-color:var(--color-violet-100)}.bg-white{background-color:var(--color-white)}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-700{color:var(--color-emerald-700)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-900{color:var(--color-red-900)}.text-rose-600{color:var(--color-rose-600)}.text-sky-700{color:var(--color-sky-700)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.group-hover\:text-slate-900:is(:where(.group):hover *){color:var(--color-slate-900)}.hover\:bg-emerald-700:hover{background-color:var(--color-emerald-700)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:text-slate-600:hover{color:var(--color-slate-600)}}.focus\:border-emerald-500:focus{border-color:var(--color-emerald-500)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-emerald-500:focus{--tw-ring-color:var(--color-emerald-500)}.focus\:ring-rose-500:focus{--tw-ring-color:var(--color-rose-500)}@media (min-width:64rem){.lg\:flex{display:flex}.lg\:w-80{width:calc(var(--spacing) * 80)}}@media (prefers-color-scheme:dark){.dark\:border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-amber-500\/30{border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.dark\:border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab, red, red)){.dark\:border-emerald-500\/50{border-color:color-mix(in oklab, var(--color-emerald-500) 50%, transparent)}}.dark\:border-indigo-400\/70{border-color:#7d87ffb3}@supports (color:color-mix(in lab, red, red)){.dark\:border-indigo-400\/70{border-color:color-mix(in oklab, var(--color-indigo-400) 70%, transparent)}}.dark\:border-slate-600{border-color:var(--color-slate-600)}.dark\:border-slate-700{border-color:var(--color-slate-700)}.dark\:border-slate-800{border-color:var(--color-slate-800)}.dark\:bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-500\/10{background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.dark\:bg-amber-500\/25{background-color:#f99c0040}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-500\/25{background-color:color-mix(in oklab, var(--color-amber-500) 25%, transparent)}}.dark\:bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-emerald-500\/15{background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.dark\:bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-indigo-500\/10{background-color:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.dark\:bg-indigo-500\/20{background-color:#625fff33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-indigo-500\/20{background-color:color-mix(in oklab, var(--color-indigo-500) 20%, transparent)}}.dark\:bg-red-500\/25{background-color:#fb2c3640}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-500\/25{background-color:color-mix(in oklab, var(--color-red-500) 25%, transparent)}}.dark\:bg-sky-500\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-sky-500\/15{background-color:color-mix(in oklab, var(--color-sky-500) 15%, transparent)}}.dark\:bg-slate-600{background-color:var(--color-slate-600)}.dark\:bg-slate-700{background-color:var(--color-slate-700)}.dark\:bg-slate-800{background-color:var(--color-slate-800)}.dark\:bg-slate-900{background-color:var(--color-slate-900)}.dark\:bg-slate-900\/40{background-color:#0f172b66}@supports (color:color-mix(in lab, red, red)){.dark\:bg-slate-900\/40{background-color:color-mix(in oklab, var(--color-slate-900) 40%, transparent)}}.dark\:bg-slate-900\/90{background-color:#0f172be6}@supports (color:color-mix(in lab, red, red)){.dark\:bg-slate-900\/90{background-color:color-mix(in oklab, var(--color-slate-900) 90%, transparent)}}.dark\:bg-slate-950{background-color:var(--color-slate-950)}.dark\:bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-violet-500\/15{background-color:color-mix(in oklab, var(--color-violet-500) 15%, transparent)}}.dark\:text-amber-200{color:var(--color-amber-200)}.dark\:text-emerald-300{color:var(--color-emerald-300)}.dark\:text-emerald-400{color:var(--color-emerald-400)}.dark\:text-indigo-300{color:var(--color-indigo-300)}.dark\:text-red-200{color:var(--color-red-200)}.dark\:text-sky-300{color:var(--color-sky-300)}.dark\:text-slate-200{color:var(--color-slate-200)}.dark\:text-slate-300{color:var(--color-slate-300)}.dark\:text-slate-400{color:var(--color-slate-400)}.dark\:text-slate-500{color:var(--color-slate-500)}.dark\:text-violet-300{color:var(--color-violet-300)}@media (hover:hover){.dark\:group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.dark\:hover\:bg-slate-700:hover{background-color:var(--color-slate-700)}.dark\:hover\:bg-slate-800\/60:hover{background-color:#1d293d99}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-slate-800\/60:hover{background-color:color-mix(in oklab, var(--color-slate-800) 60%, transparent)}}.dark\:hover\:text-slate-200:hover{color:var(--color-slate-200)}}}}@font-face{font-family:Atkinson Hyperlegible Next;font-style:normal;font-weight:400 700;font-display:swap;src:url(/fonts/AtkinsonHyperlegibleNext.woff2)format("woff2")}@font-face{font-family:Atkinson Hyperlegible Next;font-style:italic;font-weight:400 700;font-display:swap;src:url(/fonts/AtkinsonHyperlegibleNext-Italic.woff2)format("woff2")}@font-face{font-family:Atkinson Hyperlegible Mono;font-style:normal;font-weight:400 700;font-display:swap;src:url(/fonts/AtkinsonHyperlegibleMono.woff2)format("woff2")}.diff{border-collapse:collapse;width:max-content;min-width:100%;font-family:var(--font-mono);tab-size:4;font-size:13.5px;line-height:1.55}.diff-gutter{text-align:right;vertical-align:top;color:#9aa4b2;-webkit-user-select:none;user-select:none;white-space:nowrap;border-right:1px solid #e6e9ee;width:1%;min-width:3.25rem;padding:0 .75rem 0 .5rem}.diff-code{white-space:pre;vertical-align:top;padding:0 .5rem 0 .75rem}.diff-sign{color:#b6bec9;-webkit-user-select:none;user-select:none;width:1ch;margin-right:.5ch;display:inline-block}.diff-add{background:#e9f7ec}.diff-add .diff-sign{color:#1a7f37}.diff-del{background:#fbe9eb}.diff-del .diff-sign{color:#cf222e}.diff-hunk td{color:#6b7684;-webkit-user-select:none;user-select:none;background:#f2f4f7;padding:.35rem .75rem}.dw-del{background:#f6c6cb;border-radius:2px}.dw-add{background:#afe4bd;border-radius:2px}@media (prefers-color-scheme:dark){.diff-gutter{color:#6b7484;border-right-color:#2a2f3a}.diff-sign{color:#5a6373}.diff-add{background:#12261a}.diff-add .diff-sign{color:#3fb950}.diff-del{background:#2a1517}.diff-del .diff-sign{color:#f85149}.diff-hunk td{color:#8b95a5;background:#191d24}.dw-del{background:#6a2b30}.dw-add{background:#1f5a2e}}.markdown{max-width:75ch}.markdown code{font-family:var(--font-mono);color:#0f172a;white-space:break-spaces;background:#eef1f5;border-radius:.25rem;padding:.1em .35em;font-size:.85em}.markdown p{margin:0}.markdown p+p{margin-top:.5rem}.markdown ul{margin:.4rem 0;padding-left:1.25rem;list-style:outside}.markdown ol{margin:.4rem 0;padding-left:1.25rem;list-style:decimal}.markdown li{margin:.15rem 0}.markdown li>p{margin:0}.markdown strong{font-weight:700}.markdown em{font-style:italic}.markdown a{color:#0969da;text-decoration:underline}.markdown pre{font-family:var(--font-mono);background:#eef1f5;border-radius:.375rem;margin:.4rem 0;padding:.5rem .75rem;overflow-x:auto}.markdown pre code{background:0 0;padding:0}@media (prefers-color-scheme:dark){.markdown code{color:#e6e9ee;background:#20262f}.markdown a{color:#58a6ff}.markdown pre{background:#161b22}}.piece-active{outline-offset:2px;outline:2px solid #3b82f6}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}
|
|
3
|
+
/* Syntax highlighting — generated by `rake css` from Rouge themes. */
|
|
4
|
+
.highlight table td { padding: 5px; }
|
|
5
|
+
.highlight table pre { margin: 0; }
|
|
6
|
+
.highlight, .highlight .w {
|
|
7
|
+
color: #24292f;
|
|
8
|
+
background-color: #f6f8fa;
|
|
9
|
+
}
|
|
10
|
+
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kv {
|
|
11
|
+
color: #cf222e;
|
|
12
|
+
}
|
|
13
|
+
.highlight .gr {
|
|
14
|
+
color: #f6f8fa;
|
|
15
|
+
}
|
|
16
|
+
.highlight .gd {
|
|
17
|
+
color: #82071e;
|
|
18
|
+
background-color: #ffebe9;
|
|
19
|
+
}
|
|
20
|
+
.highlight .nb {
|
|
21
|
+
color: #953800;
|
|
22
|
+
}
|
|
23
|
+
.highlight .nc {
|
|
24
|
+
color: #953800;
|
|
25
|
+
}
|
|
26
|
+
.highlight .no {
|
|
27
|
+
color: #953800;
|
|
28
|
+
}
|
|
29
|
+
.highlight .nn {
|
|
30
|
+
color: #953800;
|
|
31
|
+
}
|
|
32
|
+
.highlight .sr {
|
|
33
|
+
color: #116329;
|
|
34
|
+
}
|
|
35
|
+
.highlight .na {
|
|
36
|
+
color: #116329;
|
|
37
|
+
}
|
|
38
|
+
.highlight .nt {
|
|
39
|
+
color: #116329;
|
|
40
|
+
}
|
|
41
|
+
.highlight .gi {
|
|
42
|
+
color: #116329;
|
|
43
|
+
background-color: #dafbe1;
|
|
44
|
+
}
|
|
45
|
+
.highlight .ges {
|
|
46
|
+
font-weight: bold;
|
|
47
|
+
font-style: italic;
|
|
48
|
+
}
|
|
49
|
+
.highlight .kc {
|
|
50
|
+
color: #0550ae;
|
|
51
|
+
}
|
|
52
|
+
.highlight .l, .highlight .ld, .highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
|
|
53
|
+
color: #0550ae;
|
|
54
|
+
}
|
|
55
|
+
.highlight .sb {
|
|
56
|
+
color: #0550ae;
|
|
57
|
+
}
|
|
58
|
+
.highlight .bp {
|
|
59
|
+
color: #0550ae;
|
|
60
|
+
}
|
|
61
|
+
.highlight .ne {
|
|
62
|
+
color: #0550ae;
|
|
63
|
+
}
|
|
64
|
+
.highlight .nl {
|
|
65
|
+
color: #0550ae;
|
|
66
|
+
}
|
|
67
|
+
.highlight .py {
|
|
68
|
+
color: #0550ae;
|
|
69
|
+
}
|
|
70
|
+
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm {
|
|
71
|
+
color: #0550ae;
|
|
72
|
+
}
|
|
73
|
+
.highlight .o, .highlight .ow {
|
|
74
|
+
color: #0550ae;
|
|
75
|
+
}
|
|
76
|
+
.highlight .gh {
|
|
77
|
+
color: #0550ae;
|
|
78
|
+
font-weight: bold;
|
|
79
|
+
}
|
|
80
|
+
.highlight .gu {
|
|
81
|
+
color: #0550ae;
|
|
82
|
+
font-weight: bold;
|
|
83
|
+
}
|
|
84
|
+
.highlight .s, .highlight .sa, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .sx, .highlight .s1, .highlight .ss {
|
|
85
|
+
color: #0a3069;
|
|
86
|
+
}
|
|
87
|
+
.highlight .nd {
|
|
88
|
+
color: #8250df;
|
|
89
|
+
}
|
|
90
|
+
.highlight .nf, .highlight .fm {
|
|
91
|
+
color: #8250df;
|
|
92
|
+
}
|
|
93
|
+
.highlight .err {
|
|
94
|
+
color: #f6f8fa;
|
|
95
|
+
background-color: #82071e;
|
|
96
|
+
}
|
|
97
|
+
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cp, .highlight .cpf, .highlight .c1, .highlight .cs {
|
|
98
|
+
color: #6e7781;
|
|
99
|
+
}
|
|
100
|
+
.highlight .gl {
|
|
101
|
+
color: #6e7781;
|
|
102
|
+
}
|
|
103
|
+
.highlight .gt {
|
|
104
|
+
color: #6e7781;
|
|
105
|
+
}
|
|
106
|
+
.highlight .ni {
|
|
107
|
+
color: #24292f;
|
|
108
|
+
}
|
|
109
|
+
.highlight .si {
|
|
110
|
+
color: #24292f;
|
|
111
|
+
}
|
|
112
|
+
.highlight .ge {
|
|
113
|
+
color: #24292f;
|
|
114
|
+
font-style: italic;
|
|
115
|
+
}
|
|
116
|
+
.highlight .gs {
|
|
117
|
+
color: #24292f;
|
|
118
|
+
font-weight: bold;
|
|
119
|
+
}
|
|
120
|
+
@media (prefers-color-scheme: dark) {
|
|
121
|
+
.highlight table td { padding: 5px; }
|
|
122
|
+
.highlight table pre { margin: 0; }
|
|
123
|
+
.highlight, .highlight .w {
|
|
124
|
+
color: #c9d1d9;
|
|
125
|
+
background-color: #161b22;
|
|
126
|
+
}
|
|
127
|
+
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kv {
|
|
128
|
+
color: #ff7b72;
|
|
129
|
+
}
|
|
130
|
+
.highlight .gr {
|
|
131
|
+
color: #f0f6fc;
|
|
132
|
+
}
|
|
133
|
+
.highlight .gd {
|
|
134
|
+
color: #ffdcd7;
|
|
135
|
+
background-color: #67060c;
|
|
136
|
+
}
|
|
137
|
+
.highlight .nb {
|
|
138
|
+
color: #ffa657;
|
|
139
|
+
}
|
|
140
|
+
.highlight .nc {
|
|
141
|
+
color: #ffa657;
|
|
142
|
+
}
|
|
143
|
+
.highlight .no {
|
|
144
|
+
color: #ffa657;
|
|
145
|
+
}
|
|
146
|
+
.highlight .nn {
|
|
147
|
+
color: #ffa657;
|
|
148
|
+
}
|
|
149
|
+
.highlight .sr {
|
|
150
|
+
color: #7ee787;
|
|
151
|
+
}
|
|
152
|
+
.highlight .na {
|
|
153
|
+
color: #7ee787;
|
|
154
|
+
}
|
|
155
|
+
.highlight .nt {
|
|
156
|
+
color: #7ee787;
|
|
157
|
+
}
|
|
158
|
+
.highlight .gi {
|
|
159
|
+
color: #aff5b4;
|
|
160
|
+
background-color: #033a16;
|
|
161
|
+
}
|
|
162
|
+
.highlight .ges {
|
|
163
|
+
font-weight: bold;
|
|
164
|
+
font-style: italic;
|
|
165
|
+
}
|
|
166
|
+
.highlight .kc {
|
|
167
|
+
color: #79c0ff;
|
|
168
|
+
}
|
|
169
|
+
.highlight .l, .highlight .ld, .highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
|
|
170
|
+
color: #79c0ff;
|
|
171
|
+
}
|
|
172
|
+
.highlight .sb {
|
|
173
|
+
color: #79c0ff;
|
|
174
|
+
}
|
|
175
|
+
.highlight .bp {
|
|
176
|
+
color: #79c0ff;
|
|
177
|
+
}
|
|
178
|
+
.highlight .ne {
|
|
179
|
+
color: #79c0ff;
|
|
180
|
+
}
|
|
181
|
+
.highlight .nl {
|
|
182
|
+
color: #79c0ff;
|
|
183
|
+
}
|
|
184
|
+
.highlight .py {
|
|
185
|
+
color: #79c0ff;
|
|
186
|
+
}
|
|
187
|
+
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm {
|
|
188
|
+
color: #79c0ff;
|
|
189
|
+
}
|
|
190
|
+
.highlight .o, .highlight .ow {
|
|
191
|
+
color: #79c0ff;
|
|
192
|
+
}
|
|
193
|
+
.highlight .gh {
|
|
194
|
+
color: #1f6feb;
|
|
195
|
+
font-weight: bold;
|
|
196
|
+
}
|
|
197
|
+
.highlight .gu {
|
|
198
|
+
color: #1f6feb;
|
|
199
|
+
font-weight: bold;
|
|
200
|
+
}
|
|
201
|
+
.highlight .s, .highlight .sa, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .sx, .highlight .s1, .highlight .ss {
|
|
202
|
+
color: #a5d6ff;
|
|
203
|
+
}
|
|
204
|
+
.highlight .nd {
|
|
205
|
+
color: #d2a8ff;
|
|
206
|
+
}
|
|
207
|
+
.highlight .nf, .highlight .fm {
|
|
208
|
+
color: #d2a8ff;
|
|
209
|
+
}
|
|
210
|
+
.highlight .err {
|
|
211
|
+
color: #f0f6fc;
|
|
212
|
+
background-color: #8e1519;
|
|
213
|
+
}
|
|
214
|
+
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cp, .highlight .cpf, .highlight .c1, .highlight .cs {
|
|
215
|
+
color: #8b949e;
|
|
216
|
+
}
|
|
217
|
+
.highlight .gl {
|
|
218
|
+
color: #8b949e;
|
|
219
|
+
}
|
|
220
|
+
.highlight .gt {
|
|
221
|
+
color: #8b949e;
|
|
222
|
+
}
|
|
223
|
+
.highlight .ni {
|
|
224
|
+
color: #c9d1d9;
|
|
225
|
+
}
|
|
226
|
+
.highlight .si {
|
|
227
|
+
color: #c9d1d9;
|
|
228
|
+
}
|
|
229
|
+
.highlight .ge {
|
|
230
|
+
color: #c9d1d9;
|
|
231
|
+
font-style: italic;
|
|
232
|
+
}
|
|
233
|
+
.highlight .gs {
|
|
234
|
+
color: #c9d1d9;
|
|
235
|
+
font-weight: bold;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next)
|
|
2
|
+
Copyright 2020-2024 The Atkinson Hyperlegible Mono Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next-mono)
|
|
3
|
+
|
|
4
|
+
The Atkinson Hyperlegible Next and Atkinson Hyperlegible Mono fonts bundled in
|
|
5
|
+
lib/hunk_review_changes/public/fonts are licensed under the SIL Open Font License,
|
|
6
|
+
Version 1.1. The full license text follows.
|
|
7
|
+
|
|
8
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
9
|
+
This license is copied below, and is also available with a FAQ at:
|
|
10
|
+
https://openfontlicense.org
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
-----------------------------------------------------------
|
|
14
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
15
|
+
-----------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
PREAMBLE
|
|
18
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
19
|
+
development of collaborative font projects, to support the font creation
|
|
20
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
21
|
+
open framework in which fonts may be shared and improved in partnership
|
|
22
|
+
with others.
|
|
23
|
+
|
|
24
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
25
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
26
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
27
|
+
redistributed and/or sold with any software provided that any reserved
|
|
28
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
29
|
+
however, cannot be released under any other type of license. The
|
|
30
|
+
requirement for fonts to remain under this license does not apply
|
|
31
|
+
to any document created using the fonts or their derivatives.
|
|
32
|
+
|
|
33
|
+
DEFINITIONS
|
|
34
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
35
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
36
|
+
include source files, build scripts and documentation.
|
|
37
|
+
|
|
38
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
39
|
+
copyright statement(s).
|
|
40
|
+
|
|
41
|
+
"Original Version" refers to the collection of Font Software components as
|
|
42
|
+
distributed by the Copyright Holder(s).
|
|
43
|
+
|
|
44
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
45
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
46
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
47
|
+
new environment.
|
|
48
|
+
|
|
49
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
50
|
+
writer or other person who contributed to the Font Software.
|
|
51
|
+
|
|
52
|
+
PERMISSION & CONDITIONS
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
54
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
55
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
56
|
+
Software, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
1) Neither the Font Software nor any of its individual components,
|
|
59
|
+
in Original or Modified Versions, may be sold by itself.
|
|
60
|
+
|
|
61
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
62
|
+
redistributed and/or sold with any software, provided that each copy
|
|
63
|
+
contains the above copyright notice and this license. These can be
|
|
64
|
+
included either as stand-alone text files, human-readable headers or
|
|
65
|
+
in the appropriate machine-readable metadata fields within text or
|
|
66
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
67
|
+
|
|
68
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
69
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
70
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
71
|
+
presented to the users.
|
|
72
|
+
|
|
73
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
74
|
+
Software shall not be used to promote, endorse or advertise any
|
|
75
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
76
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
77
|
+
permission.
|
|
78
|
+
|
|
79
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
80
|
+
must be distributed entirely under this license, and must not be
|
|
81
|
+
distributed under any other license. The requirement for fonts to
|
|
82
|
+
remain under this license does not apply to any document created
|
|
83
|
+
using the Font Software.
|
|
84
|
+
|
|
85
|
+
TERMINATION
|
|
86
|
+
This license becomes null and void if any of the above conditions are
|
|
87
|
+
not met.
|
|
88
|
+
|
|
89
|
+
DISCLAIMER
|
|
90
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
91
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
92
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
93
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
94
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
95
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
96
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
97
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
98
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "socket"
|
|
4
|
+
require "rbconfig"
|
|
5
|
+
|
|
6
|
+
require_relative "app"
|
|
7
|
+
require_relative "bundle"
|
|
8
|
+
require_relative "lifecycle"
|
|
9
|
+
|
|
10
|
+
module HunkReviewChanges
|
|
11
|
+
# Boots the review UI for a bundle: configures the app, picks a free localhost port,
|
|
12
|
+
# opens the browser, arms the watchdog, and runs Puma. Blocks until the user clicks
|
|
13
|
+
# Done (which writes export.md and exits) or the watchdog fires.
|
|
14
|
+
class Server
|
|
15
|
+
def initialize(bundle, port: nil, open: true)
|
|
16
|
+
@bundle = bundle
|
|
17
|
+
@port = port || free_port
|
|
18
|
+
@open = open
|
|
19
|
+
@lifecycle = Lifecycle.new
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def url = "http://127.0.0.1:#{@port}/"
|
|
23
|
+
def export_path = File.join(@bundle.dir, "export.md")
|
|
24
|
+
|
|
25
|
+
def run
|
|
26
|
+
configure_app
|
|
27
|
+
open_browser
|
|
28
|
+
arm_watchdog
|
|
29
|
+
announce
|
|
30
|
+
App.run!(port: @port, server: "puma")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def configure_app
|
|
36
|
+
App.set(:bundle, @bundle)
|
|
37
|
+
App.set(:state_path, File.join(@bundle.dir, "state.json"))
|
|
38
|
+
App.set(:export_path, export_path)
|
|
39
|
+
App.set(:lifecycle, @lifecycle)
|
|
40
|
+
App.on_done = method(:shutdown)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def shutdown
|
|
44
|
+
Thread.new do
|
|
45
|
+
sleep 0.6
|
|
46
|
+
exit!(0)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def open_browser
|
|
51
|
+
return unless @open
|
|
52
|
+
|
|
53
|
+
Thread.new do
|
|
54
|
+
sleep 1.0
|
|
55
|
+
launch_browser(url)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def launch_browser(url)
|
|
60
|
+
opened = system(*browser_command(url), out: File::NULL, err: File::NULL)
|
|
61
|
+
# A failed launch is recoverable — announce already printed the URL — so warn
|
|
62
|
+
# rather than crash. `system` returns false (bad exit) or nil (missing command).
|
|
63
|
+
warn "Could not open a browser automatically. Open #{url} to start the review." unless opened
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# The argv that opens `url` in the platform's default browser. macOS `open` is
|
|
67
|
+
# absent on Linux and Windows, where the gem and its agents also run.
|
|
68
|
+
def browser_command(url, host_os: RbConfig::CONFIG["host_os"])
|
|
69
|
+
case host_os
|
|
70
|
+
when /darwin/ then ["open", url]
|
|
71
|
+
when /mswin|mingw|cygwin/ then ["cmd", "/c", "start", "", url]
|
|
72
|
+
else ["xdg-open", url]
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def arm_watchdog
|
|
77
|
+
boot_time = Time.now
|
|
78
|
+
Thread.new do
|
|
79
|
+
loop do
|
|
80
|
+
sleep 2
|
|
81
|
+
exit!(0) if @lifecycle.expired?(boot_time)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def announce
|
|
87
|
+
warn "Review UI: #{url}"
|
|
88
|
+
warn "Bundle: #{@bundle.path}"
|
|
89
|
+
warn "Export → #{export_path} (written when you click Done)"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def free_port
|
|
93
|
+
server = TCPServer.new("127.0.0.1", 0)
|
|
94
|
+
port = server.addr[1]
|
|
95
|
+
server.close
|
|
96
|
+
port
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|