Skip to content

Commit 2ef5885

Browse files
angusbezzinaclaude
andcommitted
feat(web): Shiki at build time replaces the regex highlighter; postfix #if sits flush
Shiki 4 runs in a Vite plugin over the snippets in copy.ts and hands the page finished markup through a virtual module: no grammar or engine ships. The theme is the page's own, written against the scopes the Swift, Markdown and shell grammars emit, with colours replaced by the palette's CSS variables so both themes are one theme. One transformer does what the Swift grammar cannot: colour a capitalised name in call or member position as a type, as Xcode does. Tests pin the roles against the real grammars. The iOS snippet, README and doc comment now indent the modifier inside #if/#endif rather than the directives themselves, per SE-0308 and Xcode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 9f665ea commit 2ef5885

18 files changed

Lines changed: 900 additions & 185 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ struct MyApp: App {
8181

8282
```swift
8383
ContentView()
84-
#if DEBUG
84+
#if DEBUG
8585
.installAnnotation()
86-
#endif
86+
#endif
8787
```
8888

8989
UIKit iOS hosts call `Annotation.install()` from the scene delegate once the

Sources/AnnotKit/iOS/InstallAnnotation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import SwiftUI
55
/// tree. Dev-gated like ``Annotation/install(source:sink:)``.
66
///
77
/// ContentView()
8-
/// #if DEBUG
8+
/// #if DEBUG
99
/// .installAnnotation()
10-
/// #endif
10+
/// #endif
1111
public extension View {
1212
func installAnnotation(sink: AnnotationSink? = nil) -> some View {
1313
onAppear { Annotation.install(sink: sink) }

0 commit comments

Comments
 (0)