forked from MycroftAI/mycroft-skills
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meta_editor.html
1043 lines (882 loc) · 35.6 KB
/
meta_editor.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!-- Copyright Mycroft AI, Inc. 2017. All Rights Reserved. -->
<!-- Thanks to https://www.sanwebe.com/2014/08/css-html-forms-designs for the basis of this. -->
<html class="gr__rawgit_com" lang="en">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Mobile Styles */
@media only screen and (max-width: 400px) {
.page {
margin: 0 5% 0 5%;
}
}
/* Tablet Styles */
@media only screen and (min-width: 401px) and (max-width: 960px) {
.page {
margin: 0 10% 0 10%;
}
}
/* Desktop Styles */
@media only screen and (min-width: 961px) {
.pageEdit {
margin: 0 15% 0 15%;
}
}
body {
text-align: left;
font-family: "Roboto";
font-size: 16px;
line-height: 1.5;
color: #2c3e50;
/* margin-right: 2em;
margin-left: 2em; */
}
a {
text-decoration: none;
color: #22a7f0;
}
h1 {
display: block;
text-align: left;
padding: 20px 0px;
/* margin: 0 0; */
color: #22a7f0;
/* font-variant: small-caps; */
font-size: 2.5em;
font-weight: 900;
line-height: 1.2;
}
h2 {
color: #22a7f0;
padding: 10px 0px;
font-size: 1em;
font-variant: small-caps;
/* text-transform: uppercase; */
font-weight: 500;
}
p {
padding: 0px 0px 30px 0px;
}
ol {
list-style: none;
}
i {
display: inline;
color: #6c7a89;
/* padding-right: 10px; */
}
.topnav {
height: 64px;
background-color: #22a7f0;
margin-bottom: 0px;
color: white;
font-weight: 400;
font-size: 18px;
padding: 17px 20px;
}
.logo {
margin-right: 10px;
/* margin-top: 10px; */
}
.instructions {
max-width: 100%;
margin: 0px auto 30px auto;
padding: 30px 50px 50px 50px;
background-color: #f1f3f4;
border-radius: 6px;
line-height: 2;
}
.entry-form placeholder {
background-color: #ff0000;
}
.entry-form {
max-width: 100%;
margin: 0px auto;
background: #fff;
border-radius: 6px;
/* padding: 20px; */
/* font-family: Georgia, "Times New Roman", Times, serif; */
}
.entry-form ul {
list-style: none;
padding: 0;
margin: 0;
/* background-color: ff0000; */
}
.entry-form li {
display: block;
padding: 8px 0px 0px 0px;
border: 2px solid #f1f3f4;
margin-bottom: 36px;
border-radius: 6px;
/* font-weight: bold; */
}
.entry-form li > label {
display: block;
/* float: left; */
/* margin-top: -19px; */
background: #fff;
/* height: 14px; */
padding: 0px 10px;
color: #22a7f0;
font-size: 16px;
overflow: hidden;
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
font-weight: 500;
}
.entry-form input[type="text"],
.entry-form input[type="date"],
.entry-form input[type="datetime"],
.entry-form input[type="email"],
.entry-form input[type="number"],
.entry-form input[type="search"],
.entry-form input[type="time"],
.entry-form input[type="url"],
.entry-form input[type="password"],
.entry-form textarea,
.entry-form select {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
width: 100%;
display: block;
outline: none;
border: none;
/* height: 25px; */
/* line-height: 25px; */
font-size: 16px;
padding: 12px 10px;
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
color: #2c3e50;
}
.entry-form input[type="text"]:focus,
.entry-form input[type="date"]:focus,
.entry-form input[type="datetime"]:focus,
.entry-form input[type="email"]:focus,
.entry-form input[type="number"]:focus,
.entry-form input[type="search"]:focus,
.entry-form input[type="time"]:focus,
.entry-form input[type="url"]:focus,
.entry-form input[type="password"]:focus,
.entry-form textarea:focus,
.entry-form select:focus {
}
.entry-form li > span {
background: #f1f3f4;
display: block;
padding: 8px 10px;
/* margin: 0 -9px -9px -9px; */
text-align: left;
color: grey;
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
font-size: 13px;
}
.entry-form textarea {
/* This is just Long Description field */
resize: none;
padding: 12px 10px;
/* background-color: ff0000; */
/* color: #ff0000; */
}
.device {
padding-left: 20px;
padding-bottom: 4px;
}
.category {
padding-left: 20px;
padding-bottom: 4px;
}
.first {
padding-top: 8px;
}
#page_README input[type="button"] {
background: #40dbb0;
border: none;
padding: 12px 20px;
/* border-bottom: 3px solid #ff0000; */
border-radius: 3px;
color: #2c3e50;
float:right;
margin-bottom: 5px;
}
#page_README input[type="button"]:hover {
background: #fd9e66;
cursor: pointer;
color: #2c3e50;
}
.entry-form .noborder {
border: none;
text-align: center;
margin-bottom: 38px;
margin-top: -8px;
}
.ex[id^="ex_"][name^="ex_"] {
background: #fff;
/* margin: 3px 0 3px 0; */
padding: 12px 10px;
margin-left: 20px;
counter-reset: item;
list-style-type: decimal;
}
.ex::before {
content: "»";
background-color: red;
background: red;
color: red;
}
.author[id^="author_"][name^="author_"] {
background: #fff;
/* margin: 3px 0 3px 0; */
padding: 14px 10px;
/* color: #ff0000; */
/* font-weight: 900; */
}
input::placeholder {
color: #AAAFB2;
/* background-color: red; */
}
textarea::placeholder {
color: #AAAFB2;
}
code {
font-family: monospace;
/* display: none; */
}
#output {
width: 100%;
height: 60vh;
}
#github_preview_frame {
width: 100%;
height: 60vh;
}
.primary_category span {
color: black;
font-weight: 900;
}
tt {
font-family: monospace;
font-size: 0.9em;
font-weight: 700;
}
.card {
/* Add shadows to create the "card" effect */
box-shadow: 2px 4px 8px 2px rgba(0,0,0,0.2);
border-radius: 5px; /* 5px rounded corners */
padding: 2px 16px;
}
.card:hover {
box-shadow: 2px 8px 16px 2px rgba(0,0,0,0.2);
}
.card_content {
height: 100%;
}
.icon {
width: 50px;
height: 50px;
font-size: 50px;
}
/**********************/
/* Small card preview */
/**********************/
#card_small_category {
font-size: 30px;
color: #FD9E66;
}
#card_small_preview {
width: 300px;
height: 330px;
padding: 20px;
position: relative;
}
#title_small {
font-size: 30px;
margin-bottom: 5px;
}
#utt_small {
background-color: #E4F1FE;
width: 260px;
padding: 5px;
margin-bottom: 15px;
border-radius: 3px;
}
.utt_large {
background-color: #E4F1FE;
padding: 5px;
border-radius: 3px;
}
#card_small_preview input[type="button"] {
border: none;
padding: 12px 20px;
/* border-bottom: 3px solid #ff0000; */
border-radius: 3px;
background: #cccccc;
width: 260px;
position: absolute;
bottom: 20px;
}
/**********************/
/* Large card preview */
/**********************/
#cardb_large_preview {
width: 700px;
height: 500px;
padding: 20px;
position: relative;
}
#cardb_large_preview input[type="button"] {
border: none;
padding: 12px 20px;
/* border-bottom: 3px solid #ff0000; */
border-radius: 3px;
background: #cccccc;
width: 260px;
position: absolute;
bottom: 20px;
right: 20px;
}
#by_large {
position: absolute;
bottom: 20px;
left: 20px;
}
#title_large {
font-size: 30px;
margin-bottom: 5px;
}
/******************/
/* Style the tabs */
/******************/
.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f1f1f1;
}
/* Style the buttons that are used to open the tab content */
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 1px 8px;
height: 3em;
transition: 0.3s;
}
/* Change background color of buttons on hover */
.tab button:hover {
background-color: #ddd;
}
/* Create an active/current tablink class */
.tab button.active {
background-color: #ccc;
font-weight: 900;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
xxborder: 1px solid #ccc;
xxborder-top: none;
}
</style>
<head>
<meta http-equiv='Content-Type' content='text/html' ; charset='UTF-8'>
<title>Mycroft Skill Readme Generator</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,500,700,900">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
<script type="application/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/commonmark.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pickr-widget/dist/pickr.min.css"/>
<script src="https://cdn.jsdelivr.net/npm/pickr-widget/dist/pickr.min.js"></script>
<script type="text/javascript">
var colorPicker = null;
//auto expand textarea
function adjust_textarea(h) {
new_height = h.scrollHeight;
if (new_height < 130) {
new_height = 130;
}
h.style.height = "20px";
h.style.height = new_height + "px";
}
function generateREADME() {
// Convert the filled-out form to a markdown description (README.md) for
// the mycroft-skill on Github
var elem = document.getElementById("output");
var elIcon = document.getElementById("icon");
var elName = document.getElementById("name");
var elShortDesc = document.getElementById("short_desc");
var elLongDesc = document.getElementById("long_desc");
if (elIcon.value.startsWith("http"))
icon_url = elIcon.value;
else
icon_url = "https://rawgithub.com/FortAwesome/Font-Awesome/master/advanced-options/raw-svg/solid/"+elIcon.value+".svg";
markdown = "# <img src='"+icon_url+"' card_color='"+colorPicker.getColor().toHEX().toString()+"' width='50' height='50' style='vertical-align:bottom'/>";
markdown += " " + elName.value + "\n";
markdown += elShortDesc.value + "\n\n";
markdown += "## About \n";
markdown += elLongDesc.value + "\n\n";
markdown += "## Examples \n";
for (var i = 1; ; i++) {
var ex = document.getElementById("ex_" + i);
if (!ex) break;
if (ex.value != "") markdown += '* "' + ex.value + '"\n';
}
markdown += "\n## Credits \n";
for (var i = 1; ; i++) {
var ex = document.getElementById("author_" + i);
if (!ex) break;
if (ex.value != "") markdown += ex.value + "\n";
}
var req_mark1 = document.getElementById("req_mark1").checked;
var req_mark2 = document.getElementById("req_mark2").checked;
var req_picroft = document.getElementById("req_picroft").checked;
var req_plasmoid = document.getElementById("req_plasmoid").checked;
if (req_mark1 || req_mark2 || req_picroft || req_plasmoid) {
markdown += "\n## Supported Devices \n";
if (req_mark1) markdown += "platform_mark1 ";
if (req_mark2) markdown += "platform_mark2 ";
if (req_picroft) markdown += "platform_picroft ";
if (req_plasmoid) markdown += "platform_plasmoid ";
markdown += "\n";
}
var categoryEl = document.getElementsByClassName("category_section");
markdown += "\n## Category" + "\n";
for (var i = 0; i < categoryEl.length; i++) {
if (categoryEl[i].checked)
{
id = categoryEl[i].id;
category = id.substring(4); // skip "cat_"
if (document.getElementById("for_"+id).className.includes("primary_category"))
markdown += "**" + category + "**\n";
else
markdown += category + "\n";
}
}
var tagEl = document.getElementsByClassName("tag");
markdown += "\n## Tags\n";
for (var i = 1; ; i++) {
var tag = document.getElementById("tag_" + i);
if (!tag) break;
if (tag.value != "") markdown += tag.value + "\n";
}
elem.value = markdown;
}
function addNext(input, id_prefix) {
if (input.value == "") return true;
inputNext = input.cloneNode(true);
input.onkeyup = "";
// ## <input class="ex" type="text" id="ex_1" maxlength="100" placeholder="example 1"...
num = input.id.substring(id_prefix.length) * 1 + 1;
inputNext.id = id_prefix + num;
inputNext.value = "";
if (input.placeholder) {
placeholder_prefix = input.placeholder.substring(0, input.placeholder.length - (''+(num-1)).length)
inputNext.placeholder = placeholder_prefix + num;
}
// Add after the last
input.parentElement.insertBefore(inputNext, input.nextSibling);
}
function validateTag(elem)
{
if (elem.value[0] != '#')
elem.value = '#'+elem.value;
elem.value = elem.value.replace(/ /g, "");
}
function categoryClick(cb) {
var elements = document.getElementsByClassName("category_section");
var checks = 0;
var iChecked = null;
for (var i = 0; i < elements.length; i++) {
if (elements[i].checked) {
checks++;
iChecked = i;
}
// TODO: Remove this logic?
if (elements[i].id === "suggest") {
if (elements[i].value !== "") {
checks++;
}
}
}
if (checks <= 1) {
for (var i = 0; i < elements.length; i++) {
var label = document.getElementById("for_"+elements[i].id);
if (label)
if (i == iChecked)
label.className = "primary_category";
else
label.className = "";
}
}
}
function toTab(evt) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById("page_"+evt.currentTarget.id).style.display = "block";
evt.currentTarget.className += " active";
}
function generatePreviewCard()
{
var elCategory = document.getElementById("card_small_category");
var categoryEl = document.getElementsByClassName("category_section");
var cat = "";
for (var i = 0; i < categoryEl.length; i++) {
if (categoryEl[i].checked)
{
id = categoryEl[i].id;
category = id.substring(4); // skip "cat_"
if (document.getElementById("for_"+id).className.includes("primary_category")) {
cat = category;
break;
}
}
}
document.getElementById("card_small_category").innerText = cat;
var elName = document.getElementById("name");
document.getElementById("title_small").innerText = elName.value;
var elShortDesc = document.getElementById("short_desc");
document.getElementById("desc_small").innerText = elShortDesc.value;
var elUtt0 = document.getElementById("ex_1");
document.getElementById("utt_0_small").innerText = elUtt0.value;
// TODO: Validate icon and color
var elIcon = document.getElementById("icon");
if (elIcon.value.startsWith("http"))
{
document.getElementById("img_icon_small").src = elIcon.value;
document.getElementById("img_icon_small").style.display = "inline";
document.getElementById("icon_small").style.display = "none";
}
else
{
document.getElementById("icon_small").className = "fa-3x fas fa-"+elIcon.value;
document.getElementById("icon_small").style.color= colorPicker.getColor().toHEX().toString();
document.getElementById("img_icon_small").style.display = "none";
document.getElementById("icon_small").style.display = "inline";
}
}
function generatePreviewDetail()
{
var elName = document.getElementById("name");
document.getElementById("title_large").innerText = elName.value;
var elShortDesc = document.getElementById("short_desc");
document.getElementById("desc_large").innerText = elShortDesc.value;
var elLongDesc = document.getElementById("long_desc");
document.getElementById("fulldesc_large").innerText = elLongDesc.value;
// TODO: All authors
var elAuthor = document.getElementById("author_1");
document.getElementById("author_large").innerText = elAuthor.value;
var phrases = "";
for (var i = 1; ; i++) {
var ex = document.getElementById("ex_" + i);
if (!ex) break;
if (ex.value) {
if (phrases != "")
phrases += "; "
phrases += "<span class='utt_large'>"+ex.value+"</span>";
}
}
document.getElementById("utt_1_large").innerHTML = phrases;
// TODO: Validate icon and color
var elIcon = document.getElementById("icon");
document.getElementById("icon_large").className = "fa-3x fas fa-"+elIcon.value;
document.getElementById("icon_large").style.color= colorPicker.getColor().toHEX().toString();
if (elIcon.value.startsWith("http"))
{
document.getElementById("img_icon_large").src = elIcon.value;
document.getElementById("img_icon_large").style.display = "inline";
document.getElementById("icon_large").style.display = "none";
}
else
{
document.getElementById("icon_large").className = "fa-3x fas fa-"+elIcon.value;
document.getElementById("icon_large").style.color= colorPicker.getColor().toHEX().toString();
document.getElementById("img_icon_large").style.display = "none";
document.getElementById("icon_large").style.display = "inline";
}
}
function generatePreview()
{
var elem = document.getElementById("output");
var reader = new commonmark.Parser();
var writer = new commonmark.HtmlRenderer();
var parsed = reader.parse(elem.value); // parsed is a 'Node' tree
// transform parsed if you like...
var result = writer.render(parsed); // result is a String
// Get the CSS used by Github to render
fetch("https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css").then(function(response) {
response.text().then(function(githubcss) {
var preview2 = document.getElementById("github_preview_frame");
preview2.src = "data:text/html;charset=utf-8," +
escape("<!doctype html><html><style>"+githubcss+"</style><body>"+
"<article class='markdown-body'>"+result+"</article"+
"</body></html>");
});
});
}
function checkAllDevices()
{
if (document.getElementById("support_all").checked)
{
document.getElementById("req_mark1").checked = false;
document.getElementById("req_mark2").checked = false;
document.getElementById("req_picroft").checked = false;
document.getElementById("req_plasmoid").checked = false;
}
}
function checkDevices()
{
if (document.getElementById("req_mark1").checked ||
document.getElementById("req_mark2").checked ||
document.getElementById("req_picroft").checked ||
document.getElementById("req_plasmoid").checked)
{
document.getElementById("support_all").checked = false;
document.getElementById("support_specific").checked = true;
}
else
{
document.getElementById("support_all").checked = true;
document.getElementById("support_specific").checked = false;
}
}
function update_icon()
{
var elIcon = document.getElementById("icon");
var elPreview = document.getElementById("icon_preview");
var elImgPreview = document.getElementById("img_preview");
if (elIcon.value.startsWith("http"))
{
elPreview.style.display = "none";
elImgPreview.style.display = "block";
elImgPreview.src = elIcon.value;
}
else
{
elPreview.className = "fa-2x fas fa-"+elIcon.value;
elPreview.style.color = colorPicker.getColor().toHEX().toString();
elPreview.style.display = "block";
elImgPreview.style.display = "none";
}
}
function copyToREADMEClipboard()
{
var elem = document.getElementById("output");
elem.select();
document.execCommand('copy');
elem.style.backgroundColor = "#000";
elem.setSelectionRange(0,0);
elem.style.backgroundColor = "#FFF";
}
function initializeColorPicker(elSelector,defaultColorHex,onChangeCallback){
return new Pickr({
el: elSelector,
default: defaultColorHex,
comparison: false,
components: {
preview: true,
opacity: false,
hue: true,
interaction: {
hex: true,
rgba: true,
hsva: true,
input: true,
clear: false,
save: false
}
},
onChange(hsva, instance) {
onChangeCallback();
},
onSave(hsva, instance) {
onChangeCallback();
}
});
}
function initialize() {
var evt = [];
evt.currentTarget = document.getElementById("Intro");
toTab(evt);
colorPicker = initializeColorPicker('#icon_color','#40DBB0',update_icon);
}
</script>
</head>
<body onload="initialize();">
<div class="topnav">
<img class="logo" src="mycroft.svg" height="24px" />
<!-- | Skills -->
</div>
<div class="tab">
<button id="Intro" class="tablinks" onclick="toTab(event)">Intro</button>
<button id="Edit" class="tablinks" onclick="toTab(event)"><i class="fas fa-edit" style="color:#22a7f0;"></i> Edit</button>
<button id="Preview" class="tablinks" onclick="generateREADME(); generatePreview(); toTab(event)"><i class="fas fa-cogs" style="color:#40DBB0;"></i> Github Preview</button>
<button id="PreviewCard" class="tablinks" onclick="generatePreviewCard(); generatePreview(); toTab(event)"><i class="fas fa-cogs" style="color:#40DBB0;"></i> Card Preview</button>
<button id="PreviewDetail" class="tablinks" onclick="generatePreviewDetail(); generatePreview(); toTab(event)"><i class="fas fa-cogs" style="color:#40DBB0;"></i> Details Preview</button>
<button id="README" class="tablinks" onclick="generateREADME(); toTab(event)"><i class="fas fa-copy" style="color:#FD9E66;"></i> README.md</button>
</div>
<div id="page_Intro" class="tabcontent">
<h1>Mycroft Skill Readme Generator</h1>
<p>This tool generates a README.md for your Mycroft Skill repository on GitHub. It will be machine-parsed to fill the Mycroft Skill Marketplace and will explain your Skill to users in a standardized, easy to read format.</p>
<div class="instructions">
<h2>How it works</h2>
<i class="fas fa-edit" style="color:#22a7f0;"></i> Edit the form<br/>
<i class="fas fa-cogs" style="color:#40DBB0;"></i> Generate and examine previews<br/>
<i class="fas fa-copy" style="color:#FD9E66;"></i> Copy the output into a README.md file for your Skill's repo<br/>
</div>
<div id="community-links" class="instructions">
<p>
<a href="https://mycroft.ai/documentation/">Documentation</a> is also available on writing Skills for Mycroft, and you are welcome to join the <a href="https://chat.mycroft.ai/community/channels/skills">Skills development Chat channel</a>, where you can liaise with other Skill Authors and request assistance.
</p>
</div>
</div>
<div id="page_Edit" class="tabcontent">
<form class="entry-form">
<ul>
<li>
<label for="name">Name</label>
<input type="text" id="name" maxlength="100" onkeyup="generate()" placeholder="Your skill name"/>
<span>Brief, speakable skill name. Capitalize most words. Ex: "Podcast Player".<br/>NOTE: Avoid the word "Skill" in the name.</span>
</li>
<li>
<label for="icon">Icon</label>
<div>
<table width="100%" style="margin-left: 20px">
<tr>
<td style="vertical-align:top">Preview:<br/><i id="icon_preview" class="fa-2x fas fa-robot" style="color:#40DBB0;"></i><img id="img_preview" src="" width="41" height="41" style="display:none;"/></td>
<td width="70%">Font Awesome Name / or image URL:<input type="text" id="icon" maxlength="255" placeholder="robot" value="robot" onkeyup="update_icon()"/></td>
<td>Color:<br/>
<div id="icon_color"></div>
</td>
</table>
</div>
<span>Go to <a href="https://fontawesome.com/cheatsheet" target="_blank">Font Awesome</a>,
pick a free icon and copy its name here (eg. 'paw'), along with a <a href="https://mycroft.ai/colors" target="_blank">color</a>. Alternately, provide a full URL to your 50x50 icon image (.png or .jpg only).</span>
</li>
<li>
<label for="short_desc">One-line Description</label>
<input type="text" id="short_desc" "=" maxlength="100" placeholder="Brief one line description"/>
<span>Enter a one-line description of your skill. Ex: "Play and subscribe to podcasts"</span>
</li>
<li>
<label for="long_desc">Long Description</label>
<textarea id="long_desc" onkeyup="adjust_textarea(this)" placeholder="Full, multi-paragraph description..."></textarea>
<span>Free form, multi-paragraph description of the Skill. You can use <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">Github markdown</a>.</span>
</li>
<li>
<label for="ex_1">User Phrases: Hey Mycroft...</label>
<input class="ex" type="text" id="ex_1" maxlength="100" placeholder="Phrase 1" onkeyup="addNext(this, 'ex_')"/>
<span>Provide examples of phrases handled by the Skill after the Wake Word is spoken. The first may be highlighted and should be a prime example.<br/>Ex: "play the news", "set a 10-minute timer"</span>
</li>
<li>
<label for="author_1">Author(s)</label>
<input class="author" type="text" id="author_1" maxlength="100" placeholder="Author name (@github_handle) 1" onkeyup="addNext(this, 'author_')"/>
<span>Credits for people or organizations involved (name, email, and/or GitHub @handle).</span>
</li>
<li>
<label>Supported Devices</label>
<div class="device first"><input type="radio" id="support_all" name="supported" onchange="checkAllDevices()" checked="true" value="all"/>
<label for="support_all">All Devices (no specific requirements)</label></div>
<div class="device first"><input type="radio" id="support_specific" name="supported" value="specific"/>
<label for="support_specific">Specific devices</label>
<div class="device"><input type="checkbox" id="req_mark1" onchange="checkDevices()" value="mark1"/>
<label for="req_mark1">Platform: Mark I</label></div>
<div class="device"><input type="checkbox" id="req_mark2" onchange="checkDevices()" value="mark2"/>
<label for="req_mark2">Platform: Mark II</label></div>
<div class="device"><input type="checkbox" id="req_picroft" onchange="checkDevices()" value="picroft"/>
<label for="req_picroft">Platform: Picroft</label></div>
<div class="device"><input type="checkbox" id="req_plasmoid" onchange="checkDevices()" value="plasmoid"/>
<label for="req_plasmoid">Platform: KDE Plasmoid</label></div>
</div>
<span>If only for specific platforms, check one or more (blank means any platform).</span>
</li>
<li>
<label>Category</label>
<div class="category first"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Daily" value="Daily"/>
<label for="cat_Daily" id="for_cat_Daily"><span>Daily</span> — time, alarms, timers, and weather</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Configuration" value="Configuration"/>
<label for="cat_Configuration" id="for_cat_Configuration"><span>Configuration</span> — query and change account or device settings</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Entertainment" value="Entertainment"/>
<label for="cat_Entertainment" id="for_cat_Entertainment"><span>Entertainment</span> — jokes, sport scores, games</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Information" value="Information"/>
<label for="cat_Information" id="for_cat_Information"><span>Information</span> — stocks, quotes, general knowledge</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_IoT" value="IoT"/>
<label for="cat_IoT" id="for_cat_IoT"><span>IoT</span> — home automation, lighting controlling</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Music" value="Music"/>
<label for="cat_Music" id="for_cat_Music"><span>Music & Audio</span> — listen to streaming services</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Media" value="Media"/>
<label for="cat_Media" id="for_cat_Media"><span>Media</span> — controlling video streamer, stereo</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Productivity" value="Productivity"/>
<label for="cat_Productivity" id="for_cat_Productivity"><span>Productivity</span> — mail, calendar, Pomodoro</label></div>
<div class="category"><input class="category_section" type="checkbox" onclick='categoryClick(this);' id="cat_Transport" value="Transport"/>
<label for="cat_Transport" id="for_cat_Transport"><span>Transport</span> — bus/train schedules, ride services</label></div>
<span>The first Category selected will be bold as the Primary Category for display, all others are secondary for searches.</span>
</li>
<li>
<label for="tag_1">Tags</label>
<input class="tag" type="text" id="tag_1" maxlength="100" placeholder="#Tag 1" onkeyup="addNext(this, 'tag_')" onchange="validateTag(this)"/>
<span>Tags are single word identifiers, such as #kids, #crypto and are used for searching.</span>
</li>
</ul>
For help, see the ~skills channel at <a href="https://chat.mycroft.ai/community/channels/skills">https://chat.mycroft.ai</a>.
</form>
</div>
<div id="page_Preview" class="tabcontent">
<p>Below is a preview of how the README.md will look in your Skill's Github repo.</p>
<iframe id="github_preview_frame" class="markdown-body">abc</iframe>
<div id="github_preview" class="markdown-body">
</div>
</div>
<div id="page_PreviewCard" class="tabcontent">
<p>Below is a preview of a small reference card.</p>
<div><span id="card_small_category">Tester</span></div>
<div id="card_small_preview" class="card">
<div class="card_content">
<div><i id="icon_small" class="fa-2x fas fa-comment" style="color:#22a7f0;"></i><img id="img_icon_small" src="" width="45" height="45" style="dispaly:none"/> <span id="title_small">Coin Flip</span></div>