File tree Expand file tree Collapse file tree 3 files changed +40
-109
lines changed Expand file tree Collapse file tree 3 files changed +40
-109
lines changed Original file line number Diff line number Diff line change @@ -93,3 +93,21 @@ function lorem(ipsum, dolor = 1) {
93
93
return $sit and consectetur(ipsum) or []
94
94
}
95
95
```
96
+
97
+ With class
98
+
99
+ ``` js
100
+ function lorem (ipsum , dolor = 1 ) {
101
+ // withClass[15:19] annotation-class
102
+ const sit = ipsum == null && 0
103
+ // withClass(1:2) annotation-class
104
+ dolor = sit - amet (dolor)
105
+ return sit ? consectetur (ipsum) : []
106
+ }
107
+
108
+ function adipiscing (... elit ) {
109
+ console .log (" hover me" )
110
+ // withClass annotation-class
111
+ return elit .map (ipsum => ipsum .sit )
112
+ }
113
+ ```
Original file line number Diff line number Diff line change @@ -33,113 +33,6 @@ div#__next > div {
33
33
color : black;
34
34
}
35
35
36
- /*
37
- nav {
38
- height: 40px;
39
- overflow: hidden;
36
+ .annotation-class span {
37
+ text-decoration : line-through;
40
38
}
41
-
42
- main {
43
- flex: 1;
44
- overflow: auto;
45
- } */
46
-
47
- /* main */
48
- /*
49
- .columns {
50
- display: flex;
51
- min-height: 100%;
52
- }
53
-
54
- .column {
55
- margin-left: auto;
56
- margin-right: auto;
57
- flex: 1;
58
- box-sizing: border-box;
59
- padding: 0 6px 6px;
60
- min-width: 400px;
61
- max-width: 800px;
62
- }
63
-
64
- .column > h2 {
65
- padding: 6px;
66
- margin: 0;
67
- text-align: center;
68
- font-size: 20px;
69
- color: #ccc;
70
- }
71
-
72
- .column > .content {
73
- padding: 10px 18px;
74
- background-color: #fff;
75
- border-radius: 6px;
76
- }
77
-
78
-
79
- nav {
80
- display: flex;
81
- align-items: center;
82
- background-color: #222;
83
- color: #ccc;
84
- }
85
-
86
- nav h1 {
87
- margin: 0 16px 0 24px;
88
- }
89
- nav h1 a {
90
- color: unset;
91
- text-decoration: none;
92
- }
93
-
94
- nav .version {
95
- color: #aaa;
96
- font-size: 14px;
97
- }
98
-
99
- .radio {
100
- text-align: center;
101
- border: 1px solid #222;
102
- border-radius: 4px;
103
- overflow: hidden;
104
- display: inline-block;
105
- vertical-align: middle;
106
- margin-left: 6px;
107
- }
108
- .radio button {
109
- border: none;
110
- background-color: #444;
111
- color: #ccc;
112
- height: 24px;
113
- }
114
- .radio button.selected {
115
- background-color: #fafafa;
116
- color: #222;
117
- }
118
-
119
- nav label {
120
- margin-right: 24px;
121
- } */
122
-
123
- /* nav select {
124
- margin-left: 6px;
125
- border-radius: 4px;
126
- background-color: #fafafa;
127
- height: 24px;
128
- } */
129
-
130
- /* result */
131
- /*
132
- .result {
133
- min-width: 900px;
134
- width: 900px;
135
- max-width: 900px;
136
- }
137
-
138
- pre.shiki {
139
- white-space: pre-wrap;
140
- }
141
-
142
- .tailwind-font code {
143
- font-family: ui-monospace, SFMono-Regular, Consolas,
144
- "Liberation Mono", Menlo, monospace;
145
- } */
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export const annotationsMap: Record<
15
15
label : Label ,
16
16
link : CodeLink ,
17
17
mark : Mark ,
18
+ withClass : WithClass ,
18
19
}
19
20
20
21
function Mark ( {
@@ -97,6 +98,25 @@ function Box({
97
98
)
98
99
}
99
100
101
+ function WithClass ( {
102
+ children,
103
+ data,
104
+ style,
105
+ theme,
106
+ } : {
107
+ data : any
108
+ children : React . ReactNode
109
+ style ?: React . CSSProperties
110
+ theme : any
111
+ } ) {
112
+ const className = data as string
113
+ return (
114
+ < span style = { style } className = { className } >
115
+ { children }
116
+ </ span >
117
+ )
118
+ }
119
+
100
120
function Background ( {
101
121
children,
102
122
data,
You can’t perform that action at this time.
0 commit comments