ConvertToHtml(string markdown)
34 | {
35 | var htmlWriter = (_htmlWriterStatic ??= new StringWriter());
36 | htmlWriter.GetStringBuilder().Clear();
37 |
38 | try
39 | {
40 | var markdownDocument = Markdown.Parse(markdown, _markdownPipeline);
41 |
42 | HtmlRenderer htmlRenderer = new(htmlWriter);
43 | //Document.Pipeline.Setup(htmlRenderer);
44 | htmlRenderer.UseNonAsciiNoEscape = true;
45 | htmlRenderer.Render(markdownDocument);
46 |
47 | await htmlWriter.FlushAsync();
48 | string html = htmlWriter.ToString();
49 | html = Regex.Replace(html, "\"language-(c|C)#\"", "\"language-csharp\"", RegexOptions.Compiled);
50 | return html;
51 | }
52 | catch (Exception ex)
53 | {
54 | // We could output this to the exception pane of VS?
55 | // Though, it's easier to output it directly to the browser
56 | return "An unexpected exception occurred:
" +
57 | ex.ToString().Replace("<", "<").Replace("&", "&") + "
";
58 | }
59 | finally
60 | {
61 | // Free any resources allocated by HtmlWriter
62 | htmlWriter?.GetStringBuilder().Clear();
63 | }
64 | }
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/MarkupCodeHighlighter.cs:
--------------------------------------------------------------------------------
1 | using AskChatGPT.Options;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 |
10 | namespace AskChatGPT.Utils;
11 |
12 | public class MarkupCodeHighlighter
13 | {
14 | readonly Dictionary _copyCode = new();
15 |
16 | public MarkupCodeHighlighter()
17 | {
18 | }
19 |
20 | internal void ClearCopyCodeLinks()
21 | {
22 | _copyCode.Clear();
23 | }
24 |
25 | internal void Copy(string copyId)
26 | {
27 | if (_copyCode.TryGetValue(copyId, out var codeToCopy))
28 | {
29 | Clipboard.SetText(codeToCopy);
30 | }
31 | }
32 |
33 | public string TransformMarkdown(string text)
34 | {
35 | using StringReader reader = new(text);
36 |
37 | string line;
38 | const string codeSeparator = "```";
39 | bool insideCode = false;
40 | string sourceCopyId = null;
41 | StringBuilder codeToCopy = new();
42 |
43 | StringBuilder outputText = new();
44 |
45 | while ((line = reader.ReadLine()) != null)
46 | {
47 | int indexOfSeparator = line.IndexOf(codeSeparator);
48 | if (indexOfSeparator > -1)
49 | {
50 | if (!insideCode)
51 | {
52 | insideCode = true;
53 |
54 | sourceCopyId = Guid.NewGuid().ToString("N");
55 |
56 | var linkToCopyText = $@"
57 | [Copy](#copy_{sourceCopyId})
58 | ";
59 |
60 | if (line.Length == indexOfSeparator + 3)
61 | {
62 | line = line.Insert(indexOfSeparator + 3, AdvancedOptions.Instance.PreferredSourceLanguage);
63 | }
64 |
65 | outputText.AppendLine(linkToCopyText);
66 | }
67 | else
68 | {
69 | insideCode = false;
70 | if (sourceCopyId != null)
71 | {
72 | _copyCode.Add(sourceCopyId, codeToCopy.ToString());
73 | }
74 |
75 | codeToCopy.Clear();
76 | }
77 |
78 | outputText.AppendLine(line);
79 | }
80 | else
81 | {
82 | if (insideCode)
83 | {
84 | codeToCopy.AppendLine(line);
85 | }
86 |
87 | outputText.AppendLine(line);
88 | }
89 | }
90 |
91 | return outputText.ToString();
92 | }
93 |
94 | // public string TransformMarkdown(string text)
95 | // {
96 | // int index = 0;
97 | // while (true)
98 | // {
99 | // int startingIndexOfCode = text.IndexOf($"```", index);
100 | // if (startingIndexOfCode == -1)
101 | // {
102 | // break;
103 | // }
104 |
105 | // int endingIndexOfCode = text.IndexOf("```", startingIndexOfCode + 3);
106 | // if (endingIndexOfCode == -1)
107 | // {
108 | // break;
109 | // }
110 |
111 | // int startIndexOfCodeToCopy = text.IndexOfAny(new[] { '\r', '\n' }, startingIndexOfCode);
112 |
113 | // if (startIndexOfCodeToCopy == -1)
114 | // {
115 | // break;
116 | // }
117 |
118 | // bool languageSpecPresent = startIndexOfCodeToCopy > startingIndexOfCode + 3;
119 |
120 | // if (text[startIndexOfCodeToCopy] == '\r' &&
121 | // startIndexOfCodeToCopy < text.Length-1 &&
122 | // text[startIndexOfCodeToCopy + 1]=='\n')
123 | // {
124 | // startIndexOfCodeToCopy+=2;
125 | // }
126 | // else
127 | // {
128 | // startingIndexOfCode++;
129 | // }
130 |
131 | // var codeToCopy = text
132 | // .Substring(startIndexOfCodeToCopy, endingIndexOfCode - startIndexOfCodeToCopy)
133 | // ;
134 |
135 | // if (!string.IsNullOrWhiteSpace(codeToCopy))
136 | // {
137 | // string sourceCopyId = Guid.NewGuid().ToString("N");
138 | // _copyCode.Add(sourceCopyId, codeToCopy);
139 |
140 | // if (!languageSpecPresent)
141 | // {
142 | // text = text.Insert(startingIndexOfCode + 3, AdvancedOptions.Instance.PreferredSourceLanguage);
143 | // }
144 |
145 | // var linkToCopyText = $@"
146 | //[Copy](#copy_{sourceCopyId})
147 | //";
148 | // text = text.Insert(startingIndexOfCode, linkToCopyText);
149 |
150 | // index = text.IndexOf("```", startingIndexOfCode + linkToCopyText.Length + (languageSpecPresent ? 0 : AdvancedOptions.Instance.PreferredSourceLanguage.Length)) + 3;
151 | // continue;
152 | // }
153 |
154 | // index = endingIndexOfCode + 3;
155 | // }
156 |
157 | // return text;
158 | // }
159 |
160 |
161 | }
162 |
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/highlight-dark.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #1f1f1f
3 | }
4 | .markdown-body {
5 | color-scheme: dark;
6 | -ms-text-size-adjust: 100%;
7 | -webkit-text-size-adjust: 100%;
8 | margin: 0;
9 | color: #c9d1d9;
10 | background-color: #1f1f1f;
11 | font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
12 | font-size: 16px;
13 | line-height: 1.5;
14 | word-wrap: break-word;
15 | }
16 |
17 | .markdown-body .octicon {
18 | display: inline-block;
19 | fill: currentColor;
20 | vertical-align: text-bottom;
21 | }
22 |
23 | .markdown-body h1:hover .anchor .octicon-link:before,
24 | .markdown-body h2:hover .anchor .octicon-link:before,
25 | .markdown-body h3:hover .anchor .octicon-link:before,
26 | .markdown-body h4:hover .anchor .octicon-link:before,
27 | .markdown-body h5:hover .anchor .octicon-link:before,
28 | .markdown-body h6:hover .anchor .octicon-link:before {
29 | width: 16px;
30 | height: 16px;
31 | content: ' ';
32 | display: inline-block;
33 | background-color: currentColor;
34 | -webkit-mask-image: url("data:image/svg+xml,");
35 | mask-image: url("data:image/svg+xml,");
36 | }
37 |
38 | .markdown-body details,
39 | .markdown-body figcaption,
40 | .markdown-body figure {
41 | display: block;
42 | }
43 |
44 | .markdown-body summary {
45 | display: list-item;
46 | }
47 |
48 | .markdown-body [hidden] {
49 | display: none !important;
50 | }
51 |
52 | .markdown-body a {
53 | background-color: transparent;
54 | color: #58a6ff;
55 | text-decoration: none;
56 | }
57 |
58 | .markdown-body a:active,
59 | .markdown-body a:hover {
60 | outline-width: 0;
61 | }
62 |
63 | .markdown-body abbr[title] {
64 | border-bottom: none;
65 | text-decoration: underline dotted;
66 | }
67 |
68 | .markdown-body b,
69 | .markdown-body strong {
70 | font-weight: 600;
71 | }
72 |
73 | .markdown-body dfn {
74 | font-style: italic;
75 | }
76 |
77 | .markdown-body h1 {
78 | margin: .67em 0;
79 | font-weight: 600;
80 | padding-bottom: .3em;
81 | font-size: 2em;
82 | border-bottom: 1px solid #21262d;
83 | }
84 |
85 | .markdown-body mark {
86 | background-color: rgba(187,128,9,0.15);
87 | color: #c9d1d9;
88 | }
89 |
90 | .markdown-body small {
91 | font-size: 90%;
92 | }
93 |
94 | .markdown-body sub,
95 | .markdown-body sup {
96 | font-size: 75%;
97 | line-height: 0;
98 | position: relative;
99 | vertical-align: baseline;
100 | }
101 |
102 | .markdown-body sub {
103 | bottom: -0.25em;
104 | }
105 |
106 | .markdown-body sup {
107 | top: -0.5em;
108 | }
109 |
110 | .markdown-body img {
111 | border-style: none;
112 | max-width: 100%;
113 | box-sizing: content-box;
114 | background-color: #1f1f1f;
115 | }
116 |
117 | .markdown-body code,
118 | .markdown-body kbd,
119 | .markdown-body pre,
120 | .markdown-body samp {
121 | font-family: monospace,monospace;
122 | font-size: 1em;
123 | }
124 |
125 | .markdown-body figure {
126 | margin: 1em 40px;
127 | }
128 |
129 | .markdown-body hr {
130 | box-sizing: content-box;
131 | overflow: hidden;
132 | background: transparent;
133 | border-bottom: 1px solid #21262d;
134 | height: .25em;
135 | padding: 0;
136 | margin: 24px 0;
137 | background-color: #30363d;
138 | border: 0;
139 | }
140 |
141 | .markdown-body input {
142 | font: inherit;
143 | margin: 0;
144 | overflow: visible;
145 | font-family: inherit;
146 | font-size: inherit;
147 | line-height: inherit;
148 | }
149 |
150 | .markdown-body [type=button],
151 | .markdown-body [type=reset],
152 | .markdown-body [type=submit] {
153 | -webkit-appearance: button;
154 | }
155 |
156 | .markdown-body [type=button]::-moz-focus-inner,
157 | .markdown-body [type=reset]::-moz-focus-inner,
158 | .markdown-body [type=submit]::-moz-focus-inner {
159 | border-style: none;
160 | padding: 0;
161 | }
162 |
163 | .markdown-body [type=button]:-moz-focusring,
164 | .markdown-body [type=reset]:-moz-focusring,
165 | .markdown-body [type=submit]:-moz-focusring {
166 | outline: 1px dotted ButtonText;
167 | }
168 |
169 | .markdown-body [type=checkbox],
170 | .markdown-body [type=radio] {
171 | box-sizing: border-box;
172 | padding: 0;
173 | }
174 |
175 | .markdown-body [type=number]::-webkit-inner-spin-button,
176 | .markdown-body [type=number]::-webkit-outer-spin-button {
177 | height: auto;
178 | }
179 |
180 | .markdown-body [type=search] {
181 | -webkit-appearance: textfield;
182 | outline-offset: -2px;
183 | }
184 |
185 | .markdown-body [type=search]::-webkit-search-cancel-button,
186 | .markdown-body [type=search]::-webkit-search-decoration {
187 | -webkit-appearance: none;
188 | }
189 |
190 | .markdown-body ::-webkit-input-placeholder {
191 | color: inherit;
192 | opacity: .54;
193 | }
194 |
195 | .markdown-body ::-webkit-file-upload-button {
196 | -webkit-appearance: button;
197 | font: inherit;
198 | }
199 |
200 | .markdown-body a:hover {
201 | text-decoration: underline;
202 | }
203 |
204 | .markdown-body hr::before {
205 | display: table;
206 | content: "";
207 | }
208 |
209 | .markdown-body hr::after {
210 | display: table;
211 | clear: both;
212 | content: "";
213 | }
214 |
215 | .markdown-body table {
216 | border-spacing: 0;
217 | border-collapse: collapse;
218 | display: block;
219 | width: max-content;
220 | max-width: 100%;
221 | overflow: auto;
222 | }
223 |
224 | .markdown-body td,
225 | .markdown-body th {
226 | padding: 0;
227 | }
228 |
229 | .markdown-body details summary {
230 | cursor: pointer;
231 | }
232 |
233 | .markdown-body details:not([open]) > *:not(summary) {
234 | display: none !important;
235 | }
236 |
237 | .markdown-body kbd {
238 | display: inline-block;
239 | padding: 3px 5px;
240 | font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
241 | line-height: 10px;
242 | color: #c9d1d9;
243 | vertical-align: middle;
244 | background-color: #161b22;
245 | border: solid 1px rgba(110,118,129,0.4);
246 | border-bottom-color: rgba(110,118,129,0.4);
247 | border-radius: 6px;
248 | box-shadow: inset 0 -1px 0 rgba(110,118,129,0.4);
249 | }
250 |
251 | .markdown-body h1,
252 | .markdown-body h2,
253 | .markdown-body h3,
254 | .markdown-body h4,
255 | .markdown-body h5,
256 | .markdown-body h6 {
257 | margin-top: 24px;
258 | margin-bottom: 16px;
259 | font-weight: 600;
260 | line-height: 1.25;
261 | }
262 |
263 | .markdown-body h2 {
264 | font-weight: 600;
265 | padding-bottom: .3em;
266 | font-size: 1.5em;
267 | border-bottom: 1px solid #21262d;
268 | }
269 |
270 | .markdown-body h3 {
271 | font-weight: 600;
272 | font-size: 1.25em;
273 | }
274 |
275 | .markdown-body h4 {
276 | font-weight: 600;
277 | font-size: 1em;
278 | }
279 |
280 | .markdown-body h5 {
281 | font-weight: 600;
282 | font-size: .875em;
283 | }
284 |
285 | .markdown-body h6 {
286 | font-weight: 600;
287 | font-size: .85em;
288 | color: #8b949e;
289 | }
290 |
291 | .markdown-body p {
292 | margin-top: 0;
293 | margin-bottom: 10px;
294 | }
295 |
296 | .markdown-body blockquote {
297 | margin: 0;
298 | padding: 0 1em;
299 | color: #8b949e;
300 | border-left: .25em solid #30363d;
301 | }
302 |
303 | .markdown-body ul {
304 | list-style: disc
305 | }
306 |
307 | .markdown-body ul,
308 | .markdown-body ol {
309 | margin-top: 0;
310 | margin-bottom: 0;
311 | padding-left: 2em;
312 | }
313 |
314 | .markdown-body ol ol,
315 | .markdown-body ul ol {
316 | list-style-type: lower-roman;
317 | }
318 |
319 | .markdown-body ul ul ol,
320 | .markdown-body ul ol ol,
321 | .markdown-body ol ul ol,
322 | .markdown-body ol ol ol {
323 | list-style-type: lower-alpha;
324 | }
325 |
326 | .markdown-body dd {
327 | margin-left: 0;
328 | }
329 |
330 | .markdown-body tt,
331 | .markdown-body code {
332 | font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
333 | font-size: 12px;
334 | }
335 |
336 | .markdown-body pre {
337 | margin-top: 0;
338 | margin-bottom: 0;
339 | font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
340 | font-size: 12px;
341 | word-wrap: normal;
342 | }
343 |
344 | .markdown-body .octicon {
345 | display: inline-block;
346 | overflow: visible !important;
347 | vertical-align: text-bottom;
348 | fill: currentColor;
349 | }
350 |
351 | .markdown-body ::placeholder {
352 | color: #484f58;
353 | opacity: 1;
354 | }
355 |
356 | .markdown-body input::-webkit-outer-spin-button,
357 | .markdown-body input::-webkit-inner-spin-button {
358 | margin: 0;
359 | -webkit-appearance: none;
360 | appearance: none;
361 | }
362 |
363 | .markdown-body .pl-c {
364 | color: #8b949e;
365 | }
366 |
367 | .markdown-body .pl-c1,
368 | .markdown-body .pl-s .pl-v {
369 | color: #79c0ff;
370 | }
371 |
372 | .markdown-body .pl-e,
373 | .markdown-body .pl-en {
374 | color: #d2a8ff;
375 | }
376 |
377 | .markdown-body .pl-smi,
378 | .markdown-body .pl-s .pl-s1 {
379 | color: #c9d1d9;
380 | }
381 |
382 | .markdown-body .pl-ent {
383 | color: #7ee787;
384 | }
385 |
386 | .markdown-body .pl-k {
387 | color: #ff7b72;
388 | }
389 |
390 | .markdown-body .pl-s,
391 | .markdown-body .pl-pds,
392 | .markdown-body .pl-s .pl-pse .pl-s1,
393 | .markdown-body .pl-sr,
394 | .markdown-body .pl-sr .pl-cce,
395 | .markdown-body .pl-sr .pl-sre,
396 | .markdown-body .pl-sr .pl-sra {
397 | color: #a5d6ff;
398 | }
399 |
400 | .markdown-body .pl-v,
401 | .markdown-body .pl-smw {
402 | color: #ffa657;
403 | }
404 |
405 | .markdown-body .pl-bu {
406 | color: #f85149;
407 | }
408 |
409 | .markdown-body .pl-ii {
410 | color: #f0f6fc;
411 | background-color: #8e1519;
412 | }
413 |
414 | .markdown-body .pl-c2 {
415 | color: #f0f6fc;
416 | background-color: #b62324;
417 | }
418 |
419 | .markdown-body .pl-sr .pl-cce {
420 | font-weight: bold;
421 | color: #7ee787;
422 | }
423 |
424 | .markdown-body .pl-ml {
425 | color: #f2cc60;
426 | }
427 |
428 | .markdown-body .pl-mh,
429 | .markdown-body .pl-mh .pl-en,
430 | .markdown-body .pl-ms {
431 | font-weight: bold;
432 | color: #1f6feb;
433 | }
434 |
435 | .markdown-body .pl-mi {
436 | font-style: italic;
437 | color: #c9d1d9;
438 | }
439 |
440 | .markdown-body .pl-mb {
441 | font-weight: bold;
442 | color: #c9d1d9;
443 | }
444 |
445 | .markdown-body .pl-md {
446 | color: #ffdcd7;
447 | background-color: #67060c;
448 | }
449 |
450 | .markdown-body .pl-mi1 {
451 | color: #aff5b4;
452 | background-color: #033a16;
453 | }
454 |
455 | .markdown-body .pl-mc {
456 | color: #ffdfb6;
457 | background-color: #5a1e02;
458 | }
459 |
460 | .markdown-body .pl-mi2 {
461 | color: #c9d1d9;
462 | background-color: #1158c7;
463 | }
464 |
465 | .markdown-body .pl-mdr {
466 | font-weight: bold;
467 | color: #d2a8ff;
468 | }
469 |
470 | .markdown-body .pl-ba {
471 | color: #8b949e;
472 | }
473 |
474 | .markdown-body .pl-sg {
475 | color: #484f58;
476 | }
477 |
478 | .markdown-body .pl-corl {
479 | text-decoration: underline;
480 | color: #a5d6ff;
481 | }
482 |
483 | .markdown-body [data-catalyst] {
484 | display: block;
485 | }
486 |
487 | .markdown-body g-emoji {
488 | font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
489 | font-size: 1em;
490 | font-style: normal !important;
491 | font-weight: 400;
492 | line-height: 1;
493 | vertical-align: -0.075em;
494 | }
495 |
496 | .markdown-body g-emoji img {
497 | width: 1em;
498 | height: 1em;
499 | }
500 |
501 | .markdown-body::before {
502 | display: table;
503 | content: "";
504 | }
505 |
506 | .markdown-body::after {
507 | display: table;
508 | clear: both;
509 | content: "";
510 | }
511 |
512 | .markdown-body > *:first-child {
513 | margin-top: 0 !important;
514 | }
515 |
516 | .markdown-body > *:last-child {
517 | margin-bottom: 0 !important;
518 | }
519 |
520 | .markdown-body a:not([href]) {
521 | color: inherit;
522 | text-decoration: none;
523 | }
524 |
525 | .markdown-body .absent {
526 | color: #f85149;
527 | }
528 |
529 | .markdown-body .anchor {
530 | float: left;
531 | padding-right: 4px;
532 | margin-left: -20px;
533 | line-height: 1;
534 | }
535 |
536 | .markdown-body .anchor:focus {
537 | outline: none;
538 | }
539 |
540 | .markdown-body p,
541 | .markdown-body blockquote,
542 | .markdown-body ul,
543 | .markdown-body ol,
544 | .markdown-body dl,
545 | .markdown-body table,
546 | .markdown-body pre,
547 | .markdown-body details {
548 | margin-top: 0;
549 | margin-bottom: 16px;
550 | }
551 |
552 | .markdown-body blockquote > :first-child {
553 | margin-top: 0;
554 | }
555 |
556 | .markdown-body blockquote > :last-child {
557 | margin-bottom: 0;
558 | }
559 |
560 | .markdown-body sup > a::before {
561 | content: "[";
562 | }
563 |
564 | .markdown-body sup > a::after {
565 | content: "]";
566 | }
567 |
568 | .markdown-body h1 .octicon-link,
569 | .markdown-body h2 .octicon-link,
570 | .markdown-body h3 .octicon-link,
571 | .markdown-body h4 .octicon-link,
572 | .markdown-body h5 .octicon-link,
573 | .markdown-body h6 .octicon-link {
574 | color: #c9d1d9;
575 | vertical-align: middle;
576 | visibility: hidden;
577 | }
578 |
579 | .markdown-body h1:hover .anchor,
580 | .markdown-body h2:hover .anchor,
581 | .markdown-body h3:hover .anchor,
582 | .markdown-body h4:hover .anchor,
583 | .markdown-body h5:hover .anchor,
584 | .markdown-body h6:hover .anchor {
585 | text-decoration: none;
586 | }
587 |
588 | .markdown-body h1:hover .anchor .octicon-link,
589 | .markdown-body h2:hover .anchor .octicon-link,
590 | .markdown-body h3:hover .anchor .octicon-link,
591 | .markdown-body h4:hover .anchor .octicon-link,
592 | .markdown-body h5:hover .anchor .octicon-link,
593 | .markdown-body h6:hover .anchor .octicon-link {
594 | visibility: visible;
595 | }
596 |
597 | .markdown-body h1 tt,
598 | .markdown-body h1 code,
599 | .markdown-body h2 tt,
600 | .markdown-body h2 code,
601 | .markdown-body h3 tt,
602 | .markdown-body h3 code,
603 | .markdown-body h4 tt,
604 | .markdown-body h4 code,
605 | .markdown-body h5 tt,
606 | .markdown-body h5 code,
607 | .markdown-body h6 tt,
608 | .markdown-body h6 code {
609 | padding: 0 .2em;
610 | font-size: inherit;
611 | }
612 |
613 | .markdown-body ul.no-list,
614 | .markdown-body ol.no-list {
615 | padding: 0;
616 | list-style-type: none;
617 | }
618 |
619 | .markdown-body ol[type="1"] {
620 | list-style-type: decimal;
621 | }
622 |
623 | .markdown-body ol[type=a] {
624 | list-style-type: lower-alpha;
625 | }
626 |
627 | .markdown-body ol[type=i] {
628 | list-style-type: lower-roman;
629 | }
630 |
631 | .markdown-body div > ol:not([type]) {
632 | list-style-type: decimal;
633 | }
634 |
635 | .markdown-body ul ul,
636 | .markdown-body ul ol,
637 | .markdown-body ol ol,
638 | .markdown-body ol ul {
639 | margin-top: 0;
640 | margin-bottom: 0;
641 | }
642 |
643 | .markdown-body li > p {
644 | margin-top: 16px;
645 | }
646 |
647 | .markdown-body li + li {
648 | margin-top: .25em;
649 | }
650 |
651 | .markdown-body dl {
652 | padding: 0;
653 | }
654 |
655 | .markdown-body dl dt {
656 | padding: 0;
657 | margin-top: 16px;
658 | font-size: 1em;
659 | font-style: italic;
660 | font-weight: 600;
661 | }
662 |
663 | .markdown-body dl dd {
664 | padding: 0 16px;
665 | margin-bottom: 16px;
666 | }
667 |
668 | .markdown-body table th {
669 | font-weight: 600;
670 | }
671 |
672 | .markdown-body table th,
673 | .markdown-body table td {
674 | padding: 6px 13px;
675 | border: 1px solid #30363d;
676 | }
677 |
678 | .markdown-body table tr {
679 | background-color: #1f1f1f;
680 | border-top: 1px solid #21262d;
681 | }
682 |
683 | .markdown-body table tr:nth-child(2n) {
684 | background-color: #161b22;
685 | }
686 |
687 | .markdown-body table img {
688 | background-color: transparent;
689 | }
690 |
691 | .markdown-body img[align=right] {
692 | padding-left: 20px;
693 | }
694 |
695 | .markdown-body img[align=left] {
696 | padding-right: 20px;
697 | }
698 |
699 | .markdown-body .emoji {
700 | max-width: none;
701 | vertical-align: text-top;
702 | background-color: transparent;
703 | }
704 |
705 | .markdown-body span.frame {
706 | display: block;
707 | overflow: hidden;
708 | }
709 |
710 | .markdown-body span.frame > span {
711 | display: block;
712 | float: left;
713 | width: auto;
714 | padding: 7px;
715 | margin: 13px 0 0;
716 | overflow: hidden;
717 | border: 1px solid #30363d;
718 | }
719 |
720 | .markdown-body span.frame span img {
721 | display: block;
722 | float: left;
723 | }
724 |
725 | .markdown-body span.frame span span {
726 | display: block;
727 | padding: 5px 0 0;
728 | clear: both;
729 | color: #c9d1d9;
730 | }
731 |
732 | .markdown-body span.align-center {
733 | display: block;
734 | overflow: hidden;
735 | clear: both;
736 | }
737 |
738 | .markdown-body span.align-center > span {
739 | display: block;
740 | margin: 13px auto 0;
741 | overflow: hidden;
742 | text-align: center;
743 | }
744 |
745 | .markdown-body span.align-center span img {
746 | margin: 0 auto;
747 | text-align: center;
748 | }
749 |
750 | .markdown-body span.align-right {
751 | display: block;
752 | overflow: hidden;
753 | clear: both;
754 | }
755 |
756 | .markdown-body span.align-right > span {
757 | display: block;
758 | margin: 13px 0 0;
759 | overflow: hidden;
760 | text-align: right;
761 | }
762 |
763 | .markdown-body span.align-right span img {
764 | margin: 0;
765 | text-align: right;
766 | }
767 |
768 | .markdown-body span.float-left {
769 | display: block;
770 | float: left;
771 | margin-right: 13px;
772 | overflow: hidden;
773 | }
774 |
775 | .markdown-body span.float-left span {
776 | margin: 13px 0 0;
777 | }
778 |
779 | .markdown-body span.float-right {
780 | display: block;
781 | float: right;
782 | margin-left: 13px;
783 | overflow: hidden;
784 | }
785 |
786 | .markdown-body span.float-right > span {
787 | display: block;
788 | margin: 13px auto 0;
789 | overflow: hidden;
790 | text-align: right;
791 | }
792 |
793 | .markdown-body code,
794 | .markdown-body tt {
795 | padding: .2em .4em;
796 | margin: 0;
797 | font-size: 85%;
798 | background-color: rgba(110,118,129,0.4);
799 | border-radius: 6px;
800 | }
801 |
802 | .markdown-body code br,
803 | .markdown-body tt br {
804 | display: none;
805 | }
806 |
807 | .markdown-body del code {
808 | text-decoration: inherit;
809 | }
810 |
811 | .markdown-body pre code {
812 | font-size: 100%;
813 | }
814 |
815 | .markdown-body pre > code {
816 | padding: 0;
817 | margin: 0;
818 | word-break: normal;
819 | white-space: pre;
820 | background: transparent;
821 | border: 0;
822 | }
823 |
824 | .markdown-body .highlight {
825 | margin-bottom: 16px;
826 | }
827 |
828 | .markdown-body .highlight pre {
829 | margin-bottom: 0;
830 | word-break: normal;
831 | }
832 |
833 | .markdown-body .highlight pre,
834 | .markdown-body pre {
835 | padding: 16px;
836 | overflow: auto;
837 | font-size: 85%;
838 | line-height: 1.45;
839 | background-color: #161b22;
840 | border-radius: 6px;
841 | }
842 |
843 | .markdown-body pre code,
844 | .markdown-body pre tt {
845 | display: inline;
846 | max-width: auto;
847 | padding: 0;
848 | margin: 0;
849 | overflow: visible;
850 | line-height: inherit;
851 | word-wrap: normal;
852 | background-color: transparent;
853 | border: 0;
854 | }
855 |
856 | .markdown-body .csv-data td,
857 | .markdown-body .csv-data th {
858 | padding: 5px;
859 | overflow: hidden;
860 | font-size: 12px;
861 | line-height: 1;
862 | text-align: left;
863 | white-space: nowrap;
864 | }
865 |
866 | .markdown-body .csv-data .blob-num {
867 | padding: 10px 8px 9px;
868 | text-align: right;
869 | background: #1f1f1f;
870 | border: 0;
871 | }
872 |
873 | .markdown-body .csv-data tr {
874 | border-top: 0;
875 | }
876 |
877 | .markdown-body .csv-data th {
878 | font-weight: 600;
879 | background: #161b22;
880 | border-top: 0;
881 | }
882 |
883 | .markdown-body .footnotes {
884 | font-size: 12px;
885 | color: #8b949e;
886 | border-top: 1px solid #30363d;
887 | }
888 |
889 | .markdown-body .footnotes ol {
890 | padding-left: 16px;
891 | }
892 |
893 | .markdown-body .footnotes li {
894 | position: relative;
895 | }
896 |
897 | .markdown-body .footnotes li:target::before {
898 | position: absolute;
899 | top: -8px;
900 | right: -8px;
901 | bottom: -8px;
902 | left: -24px;
903 | pointer-events: none;
904 | content: "";
905 | border: 2px solid #1f6feb;
906 | border-radius: 6px;
907 | }
908 |
909 | .markdown-body .footnotes li:target {
910 | color: #c9d1d9;
911 | }
912 |
913 | .markdown-body .footnotes .data-footnote-backref g-emoji {
914 | font-family: monospace;
915 | }
916 |
917 | .markdown-body .task-list-item {
918 | list-style-type: none;
919 | }
920 |
921 | .markdown-body .task-list-item label {
922 | font-weight: 400;
923 | }
924 |
925 | .markdown-body .task-list-item.enabled label {
926 | cursor: pointer;
927 | }
928 |
929 | .markdown-body .task-list-item + .task-list-item {
930 | margin-top: 3px;
931 | }
932 |
933 | .markdown-body .task-list-item .handle {
934 | display: none;
935 | }
936 |
937 | .markdown-body .task-list-item-checkbox {
938 | margin: 0 .2em .25em -1.6em;
939 | vertical-align: middle;
940 | }
941 |
942 | .markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox {
943 | margin: 0 -1.6em .25em .2em;
944 | }
945 |
946 | .markdown-body ::-webkit-calendar-picker-indicator {
947 | filter: invert(50%);
948 | }
949 |
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/highlight.css:
--------------------------------------------------------------------------------
1 | /* From https://github.com/sindresorhus/github-markdown-css */
2 |
3 | .markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;color:#24292f;background-color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{width:16px;height:16px;content:' ';display:inline-block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,");mask-image:url("data:image/svg+xml,")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none !important}
4 | .markdown-body a{background-color:transparent;color:#0969da;text-decoration:none}.markdown-body a:active,.markdown-body a:hover{outline-width:0}.markdown-body abbr[title]{border-bottom:none;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:600}.markdown-body dfn{font-style:italic}.markdown-body h1{margin:.67em 0;font-weight:600;padding-bottom:.3em;font-size:2em;border-bottom:1px solid hsla(210,18%,87%,1)}.markdown-body mark{background-color:#fff8c5;color:#24292f}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.markdown-body sub{bottom:-.25em}.markdown-body sup{top:-.5em}.markdown-body img{border-style:none;max-width:100%;box-sizing:content-box;background-color:#fff}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace,monospace;font-size:1em}.markdown-body figure{margin:1em 40px}.markdown-body hr{box-sizing:content-box;overflow:hidden;background:0 0;border-bottom:1px solid hsla(210,18%,87%,1);height:.25em;padding:0;margin:24px 0;background-color:#d0d7de;border:0}
5 | .markdown-body input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{-webkit-appearance:button}.markdown-body [type=button]::-moz-focus-inner,.markdown-body [type=reset]::-moz-focus-inner,.markdown-body [type=submit]::-moz-focus-inner{border-style:none;padding:0}.markdown-body [type=button]:-moz-focusring,.markdown-body [type=reset]:-moz-focusring,.markdown-body [type=submit]:-moz-focusring{outline:1px dotted ButtonText}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button,.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.markdown-body [type=search]::-webkit-search-cancel-button,.markdown-body [type=search]::-webkit-search-decoration{-webkit-appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}
6 | .markdown-body ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body hr:before{display:table;content:""}.markdown-body hr:after{display:table;clear:both;content:""}.markdown-body table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body details:not([open])>*:not(summary){display:none !important}.markdown-body kbd{display:inline-block;padding:3px 5px;font:11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;line-height:10px;color:#24292f;vertical-align:middle;background-color:#f6f8fa;border:solid 1px rgba(175,184,193,.2);border-bottom-color:rgba(175,184,193,.2);border-radius:6px;box-shadow:inset 0 -1px 0 rgba(175,184,193,.2)}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}
7 | .markdown-body h2{font-weight:600;padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid hsla(210,18%,87%,1)}.markdown-body h3{font-weight:600;font-size:1.25em}.markdown-body h4{font-weight:600;font-size:1em}.markdown-body h5{font-weight:600;font-size:.875em}.markdown-body h6{font-weight:600;font-size:.85em;color:#57606a}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body ul {list-style:disc}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px}.markdown-body pre{margin-top:0;margin-bottom:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;word-wrap:normal}
8 | .markdown-body .octicon{display:inline-block;overflow:visible !important;vertical-align:text-bottom;fill:currentColor}.markdown-body ::placeholder{color:#6e7781;opacity:1}.markdown-body input::-webkit-outer-spin-button,.markdown-body input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none;appearance:none}.markdown-body .pl-c{color:#6e7781}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:#0550ae}.markdown-body .pl-e,.markdown-body .pl-en{color:#8250df}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:#24292f}.markdown-body .pl-ent{color:#116329}.markdown-body .pl-k{color:#cf222e}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:#0a3069}.markdown-body .pl-v,.markdown-body .pl-smw{color:#953800}.markdown-body .pl-bu{color:#82071e}.markdown-body .pl-ii{color:#f6f8fa;background-color:#82071e}.markdown-body .pl-c2{color:#f6f8fa;background-color:#cf222e}
9 | .markdown-body .pl-sr .pl-cce{font-weight:700;color:#116329}.markdown-body .pl-ml{color:#3b2300}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{font-weight:700;color:#0550ae}.markdown-body .pl-mi{font-style:italic;color:#24292f}.markdown-body .pl-mb{font-weight:700;color:#24292f}.markdown-body .pl-md{color:#82071e;background-color:#ffebe9}.markdown-body .pl-mi1{color:#116329;background-color:#dafbe1}.markdown-body .pl-mc{color:#953800;background-color:#ffd8b5}.markdown-body .pl-mi2{color:#eaeef2;background-color:#0550ae}.markdown-body .pl-mdr{font-weight:700;color:#8250df}.markdown-body .pl-ba{color:#57606a}.markdown-body .pl-sg{color:#8c959f}.markdown-body .pl-corl{text-decoration:underline;color:#0a3069}.markdown-body [data-catalyst]{display:block}.markdown-body g-emoji{font-family:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1em;font-style:normal !important;font-weight:400;line-height:1;vertical-align:-.075em}.markdown-body g-emoji img{width:1em;height:1em}
10 | .markdown-body:before{display:table;content:""}.markdown-body:after{display:table;clear:both;content:""}.markdown-body>*:first-child{margin-top:0 !important}.markdown-body>*:last-child{margin-bottom:0 !important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:#cf222e}.markdown-body .anchor{float:left;padding-right:4px;margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:16px}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body sup>a:before{content:"["}.markdown-body sup>a:after{content:"]"}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:#24292f;vertical-align:middle;visibility:hidden}
11 | .markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{padding:0 .2em;font-size:inherit}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type="1"]{list-style-type:decimal}.markdown-body ol[type=a]{list-style-type:lower-alpha}
12 | .markdown-body ol[type=i]{list-style-type:lower-roman}.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:16px}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:600}.markdown-body dl dd{padding:0 16px;margin-bottom:16px}.markdown-body table th{font-weight:600}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid #d0d7de}.markdown-body table tr{background-color:#fff;border-top:1px solid hsla(210,18%,87%,1)}.markdown-body table tr:nth-child(2n){background-color:#f6f8fa}.markdown-body table img{background-color:transparent}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}
13 | .markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid #d0d7de}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:#24292f}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}
14 | .markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:.2em .4em;margin:0;font-size:85%;background-color:rgba(175,184,193,.2);border-radius:6px}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body pre code{font-size:100%}.markdown-body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:0 0;border:0}.markdown-body .highlight{margin-bottom:16px}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f6f8fa;border-radius:6px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}
15 | .markdown-body .csv-data .blob-num{padding:10px 8px 9px;text-align:right;background:#fff;border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:600;background:#f6f8fa;border-top:0}.markdown-body .footnotes{font-size:12px;color:#57606a;border-top:1px solid #d0d7de}.markdown-body .footnotes ol{padding-left:16px}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target:before{position:absolute;top:-8px;right:-8px;bottom:-8px;left:-24px;pointer-events:none;content:"";border:2px solid #0969da;border-radius:6px}.markdown-body .footnotes li:target{color:#24292f}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:400}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:3px}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{margin:0 .2em .25em -1.6em;vertical-align:middle}
16 | .markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/md-template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | [title]
5 |
6 |
7 |
8 |
9 | [content]
10 |
11 |
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/mermaid.min.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*!
2 | * Wait for document loaded before starting the execution
3 | */
4 |
5 | /*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */
6 |
7 | /*! Check if previously processed */
8 |
9 | /*! sequence config was passed as #1 */
10 |
11 | /**
12 | * @license
13 | * Copyright (c) 2012-2013 Chris Pettitt
14 | *
15 | * Permission is hereby granted, free of charge, to any person obtaining a copy
16 | * of this software and associated documentation files (the "Software"), to deal
17 | * in the Software without restriction, including without limitation the rights
18 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19 | * copies of the Software, and to permit persons to whom the Software is
20 | * furnished to do so, subject to the following conditions:
21 | *
22 | * The above copyright notice and this permission notice shall be included in
23 | * all copies or substantial portions of the Software.
24 | *
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31 | * THE SOFTWARE.
32 | */
33 |
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/prism-dark.css:
--------------------------------------------------------------------------------
1 | /* PrismJS 1.25.0
2 | https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript */
3 | code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/prism.css:
--------------------------------------------------------------------------------
1 | /* PrismJS 1.25.0
2 | https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+aspnet+basic+c+csharp+cpp+clojure+dart+docker+fsharp+go+graphql+java+json+kotlin+markdown+markup-templating+perl+php+powershell+protobuf+python+qsharp+r+cshtml+ruby+rust+scss+sql+typescript+vbnet+visual-basic+yaml */
3 | code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
--------------------------------------------------------------------------------
/src/AskChatGPT/Utils/prism.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adospace/chatgpt-vs-tool/3cd9c220103e218bdf9a3fcc9482a9c47566bf5a/src/AskChatGPT/Utils/prism.js
--------------------------------------------------------------------------------
/src/AskChatGPT/VSCommandTable.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by VSIX Synchronizer
4 | //
5 | // ------------------------------------------------------------------------------
6 | namespace AskChatGPT
7 | {
8 | using System;
9 |
10 | ///
11 | /// Helper class that exposes all GUIDs used across VS Package.
12 | ///
13 | internal sealed partial class PackageGuids
14 | {
15 | public const string AskChatGPTString = "dacfd347-05d7-43aa-9d44-b132e3bee4f7";
16 | public static Guid AskChatGPT = new Guid(AskChatGPTString);
17 | }
18 | ///
19 | /// Helper class that encapsulates all CommandIDs uses across VS Package.
20 | ///
21 | internal sealed partial class PackageIds
22 | {
23 | public const int MyCommand = 0x0100;
24 | }
25 | }
--------------------------------------------------------------------------------
/src/AskChatGPT/VSCommandTable.vsct:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/AskChatGPT/source.extension.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by VSIX Synchronizer
4 | //
5 | // ------------------------------------------------------------------------------
6 | namespace AskChatGPT
7 | {
8 | internal sealed partial class Vsix
9 | {
10 | public const string Id = "AskChatGPT.809330fd-3f8f-4d94-98a8-7214d273c896";
11 | public const string Name = "AskChatGPT";
12 | public const string Description = @"This extension allows you to get help from ChatGPT directly inside Visual Studio.";
13 | public const string Language = "en-US";
14 | public const string Version = "1.4";
15 | public const string Author = "Adolfo Marinucci";
16 | public const string Tags = "";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/AskChatGPT/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | AskChatGPT
6 | This extension allows you to get help from ChatGPT directly inside Visual Studio.
7 | Resources\Icon.png
8 | Resources\Icon.png
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------