You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
h2{"Want to preview a new syntax highlighting theme?"}
34
30
35
31
markdowndo
36
32
"This site uses [Pygments-style CSS](https://pygments.org/) for syntax highlighting. You can use the select menu to preview a new syntax highlighting theme. I have curated over 90 options for you from sources around the web."
37
33
end
38
34
39
-
ifpreviewing?
40
-
markdowndo
41
-
"You are currently previewing **#{@current_highlight.display_name}** as your syntax highlighting theme."
42
-
end
43
-
end
44
-
45
-
ifpreserving?
46
-
markdowndo
47
-
"You have saved **#{@session_syntax_highlight.display_name}** for syntax highlighting across the site."
48
-
end
49
-
end
50
35
preview_select
51
36
52
-
ifpreviewing?
53
-
markdowndo
54
-
"You can preview what the site looks with this syntax highlighting theme while you remain on this page. Click the **Reset preview** button to go back to #{@session_syntax_highlight ? "your saved color scheme, **#{@session_syntax_highlight.display_name}**" : "the default color scheme, **#{@default_syntax_highlight.display_name}**"}."
55
-
end
56
-
57
-
div(class: "outside"){reset_button}
37
+
h2{%(Preview)}
58
38
59
-
darkmode_section
39
+
markdowndo
40
+
"You can preview what the site looks with this syntax highlighting theme while you remain on this page."
41
+
end
60
42
61
-
markdowndo
62
-
"Click the Save button to preserve **#{@current_highlight.display_name}** as your new syntax highlighting theme."
"You can toggle the dark mode switch to see how the syntax highlighting looks in light or dark mode. Choosing **Light Mode** or **Dark Mode** will save in your browser local storage and will persist across page views on your current device. Choose **System Mode** to remove the saved choice and fall back to your system preference."
76
+
"Toggle this switch to see the syntax highlighting when the _site_ is Light or Dark Mode. Choosing **Light Mode** or **Dark Mode** will save in your browser local storage and will persist across page views on your current device. Choose **System Mode** to remove the saved choice and fall back to your system preference."
"You are currently using the default syntax highlighting theme, **#{@default_syntax_highlight.display_name}** as your syntax highlighting theme."
126
+
end
136
127
137
-
defm
138
-
Markdown::Application.new(yield).call.html_safe
139
-
end
128
+
darkmode_section
140
129
141
-
defpreview_select
142
-
form_with(
143
-
model: @settings,
144
-
url: settings_syntax_highlight_path,
145
-
method: :get
146
-
)do |form|
147
-
fieldsetdo
148
-
flex_blockdo
149
-
form.label:syntax_highlight_name,"Choose another syntax highlighting theme to preview:"
150
-
form.select:syntax_highlight_name,
151
-
syntax_highlight_options_for_select,
152
-
{
153
-
selected: @current_highlight.name
154
-
},
155
-
onchange: "this.form.requestSubmit()"
156
-
end
130
+
return
131
+
end
132
+
133
+
ifpreviewing?
134
+
h2{"Save your preview"}
135
+
136
+
markdowndo
137
+
"You are currently previewing **#{@current_highlight.display_name}** as your syntax highlighting theme."
138
+
end
139
+
140
+
darkmode_section
141
+
142
+
markdowndo
143
+
"Click the Save button to preserve **#{@current_highlight.display_name}** as your new syntax highlighting theme. Your choice will be saved in your browser session."
"Click the **Reset preview** button to go back to #{@session_syntax_highlight ? "your saved color scheme, **#{@session_syntax_highlight.display_name}**" : "the default color scheme, **#{@default_syntax_highlight.display_name}**"}."
155
+
end
156
+
157
+
div(class: "outside"){reset_button}
158
+
end
159
+
160
+
ifpreserving?
161
+
h2{"Your syntax highlighting theme"}
162
+
163
+
markdowndo
164
+
"You have saved **#{@session_syntax_highlight.display_name}** for syntax highlighting across the site."
157
165
end
166
+
167
+
darkmode_sectionif !previewing?
168
+
169
+
markdowndo
170
+
"You can delete #{@session_syntax_highlight.display_name} your saved syntax highlighting theme and go back to the default."
0 commit comments