forked from b3m2a1/mathematica-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackageDataPacletInstall.nb
2735 lines (2665 loc) · 119 KB
/
PackageDataPacletInstall.nb
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
Notebook[{
Cell[CellGroupData[{
Cell["PDInstallPaclet", "CodeSection",
CellChangeTimes->{{3.710422012837708*^9,
3.710422017107584*^9}},ExpressionUUID->"44dc985d-7d58-4187-b9e8-\
c1ac91e72092"],
Cell[BoxData[
RowBox[{
RowBox[{
RowBox[{"PDInstallPaclet", "::", "usage"}], "=", "\n", "\t",
"\"\<Installs a paclet from a site\>\""}], ";"}]], "CodeInput",
CellChangeTimes->{{3.710422047099622*^9, 3.710422063850913*^9},
3.710426099272492*^9,
3.7104291105736513`*^9},ExpressionUUID->"43d3db56-9e13-4cf5-b887-\
8f62a5888358"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"Begin", "[", "\"\<`Private`\>\"", "]"}],
";"}]], "InputSection",ExpressionUUID->"a1e9c4b5-c44f-4537-9d7a-\
d8dbdc163ce7"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"PDInstallPaclet", "::", "howdo"}], "=",
"\"\<Unsure how to pack a paclet from file type ``\>\""}], ";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"PDInstallPaclet", "::", "laywha"}], "=",
"\"\<Couldn't detect package layout from directory ``\>\""}],
";"}]}], "CodeInput",
CellChangeTimes->{{3.710429342321012*^9,
3.710429342322266*^9}},ExpressionUUID->"11976e96-1ff0-4f13-b5d0-\
cdf65d12f3a5"],
Cell[CellGroupData[{
Cell["PDpacletInfo", "Subsubsubsection",
CellChangeTimes->{{3.699937572999563*^9, 3.699937574968251*^9},
3.7027305115789537`*^9, {3.705594811172037*^9, 3.705594820072814*^9},
3.7104223364737253`*^9},ExpressionUUID->"1dce3dd0-6325-42b0-91ca-\
8862cd40430d"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"PDpacletInfoAssociation", "[",
RowBox[{"PacletManager`Paclet", "[", "k__", "]"}], "]"}], ":=", "\n",
RowBox[{
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"o", "=",
RowBox[{"Options", "[", "PDpacletExpression", "]"}]}], "}"}], ",",
"\n", "\t",
RowBox[{"KeySortBy", "[",
RowBox[{
RowBox[{"First", "@",
RowBox[{"FirstPosition", "[",
RowBox[{"o", ",", "#"}], "]"}]}], "&"}], "]"}]}], "\n", "\t", "]"}],
"@", "\n",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"base", "=", "\n", "\t\t",
RowBox[{"KeyMap", "[",
RowBox[{
RowBox[{"Replace", "[",
RowBox[{"s_Symbol", ":>",
RowBox[{"SymbolName", "[", "s", "]"}]}], "]"}], ",",
RowBox[{"<|", "k", "|>"}]}], "]"}]}], "\n", "\t\t", "}"}], ",",
"\n", "\t",
RowBox[{"ReplacePart", "[",
RowBox[{"base", ",", "\n", "\t\t",
RowBox[{"\"\<Extensions\>\"", "->", "\n", "\t\t",
RowBox[{"AssociationThread", "[", "\n", "\t\t\t",
RowBox[{
RowBox[{"First", "/@",
RowBox[{"base", "[", "\"\<Extensions\>\"", "]"}]}], ",", "\n",
"\t\t\t",
RowBox[{
RowBox[{"Association", "@*", "Rest"}], "/@",
RowBox[{"base", "[", "\"\<Extensions\>\"", "]"}]}]}], "\n",
"\t\t\t", "]"}]}]}], "\n", "\t\t", "]"}]}], "\n", "\t", "]"}]}]}],
";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"PDpacletInfoAssociation", "[", "infoFile_", "]"}], ":=", "\n",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"PDpacletInfo", "[", "infoFile", "]"}], ",",
RowBox[{"{", "\n", "\t\t",
RowBox[{
RowBox[{
RowBox[{"p", ":",
RowBox[{"PacletManager`Paclet", "[", "__", "]"}]}], ":>", "\n",
"\t\t",
RowBox[{"PDpacletInfoAssociation", "@", "p"}]}], ",", "\n", "\t\t",
RowBox[{"_", "\[Rule]",
RowBox[{"<|", "|>"}]}]}], "\n", "\t\t", "}"}]}], "]"}]}], ";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"PDpacletInfo", "[", "infoFile_", "]"}], ":=", "\n",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"PDpacletInfo", "=", "\n", "\t\t",
RowBox[{"Replace", "[",
RowBox[{"infoFile", ",",
RowBox[{"{", "\n", "\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"d", ":",
RowBox[{
RowBox[{"(",
RowBox[{"_String", "|", "_File"}], ")"}], "?",
"DirectoryQ"}]}], ":>", "\n", "\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{"d", ",", "\"\<PacletInfo.m\>\""}], "}"}]}]}], ",",
"\n", "\t\t\t\t",
RowBox[{
RowBox[{"f", ":",
RowBox[{
RowBox[{"(",
RowBox[{"_String", "|", "_File"}], ")"}], "?",
RowBox[{"(",
RowBox[{
RowBox[{
RowBox[{"FileExtension", "[", "#", "]"}], "\[Equal]",
"\"\<PDpaclet\>\""}], "&"}], ")"}]}]}], ":>", "\n",
"\t\t\t\t",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"rd", "=",
RowBox[{"CreateDirectory", "[", "]"}]}], "}"}], ",", "\n",
"\t\t\t\t\t",
RowBox[{"First", "@",
RowBox[{"ExtractArchive", "[",
RowBox[{"f", ",", "rd", ",", "\"\<*PacletInfo.m\>\""}],
"]"}]}]}], "\n", "\t\t\t\t\t", "]"}]}]}], "\n", "\t\t\t\t",
"}"}]}], "]"}]}], "\n", "\t\t", "}"}], ",", "\n", "\t",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"If", "[", "\n", "\t\t\t",
RowBox[{
RowBox[{
RowBox[{"StringContainsQ", "[", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Nest", "[",
RowBox[{"DirectoryName", ",", "PDpacletInfo", ",", "3"}],
"]"}], ",", "\n", "\t\t\t\t", "$TemporaryDirectory"}], "\n",
"\t\t\t\t", "]"}], "&&", "\n", "\t\t\t",
RowBox[{"(",
RowBox[{
RowBox[{"StringTrim", "[",
RowBox[{
RowBox[{"DirectoryName", "@", "PDpacletInfo"}], ",",
RowBox[{"$PathnameSeparator", "~~", "EndOfString"}]}], "]"}],
"!=", "\n", "\t\t\t\t",
RowBox[{"StringTrim", "[", "\n", "\t\t\t\t\t",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{"DirectoryQ", "@", "infoFile"}], ",", "\n",
"\t\t\t\t\t\t", "infoFile", ",", "\n", "\t\t\t\t\t\t",
RowBox[{"DirectoryName", "@", "infoFile"}]}], "]"}], ",",
"\n", "\t\t\t\t\t",
RowBox[{"$PathnameSeparator", "~~", "EndOfString"}]}], "\n",
"\t\t\t\t\t", "]"}]}], ")"}]}], ",", "\n", "\t\t\t",
RowBox[{"DeleteDirectory", "[",
RowBox[{
RowBox[{"Nest", "[",
RowBox[{"DirectoryName", ",", "PDpacletInfo", ",", "2"}], "]"}],
",",
RowBox[{"DeleteContents", "\[Rule]", "True"}]}], "]"}]}], "\n",
"\t\t\t", "]"}], ";", "#"}], ")"}], "&"}], "@", "\n", "\t",
RowBox[{"If", "[",
RowBox[{
RowBox[{"FileExistsQ", "@", "PDpacletInfo"}], ",", "\n", "\t\t", "\n",
"\t\t",
RowBox[{
RowBox[{"Begin", "[", "\"\<PacletManager`\>\"", "]"}], ";", "\n",
"\t\t",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"End", "[", "]"}], ";", "\n", "\t\t\t",
RowBox[{"Map", "[", "\n", "\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"Replace", "[",
RowBox[{"#", ",", "\n", "\t\t\t\t\t",
RowBox[{
RowBox[{"(",
RowBox[{"s_Symbol", "\[Rule]", "v_"}], ")"}], ":>", "\n",
"\t\t\t\t\t",
RowBox[{"(",
RowBox[{
RowBox[{"SymbolName", "[", "s", "]"}], "\[Rule]", "v"}],
")"}]}]}], "\n", "\t\t\t\t\t", "]"}], "&"}], ",", "\n",
"\t\t\t\t", "#"}], "]"}]}], ")"}], "&"}], "@",
RowBox[{"Import", "[", "PDpacletInfo", "]"}]}]}], ",", "\n", "\t\t",
RowBox[{"PacletManager`Paclet", "[", "]"}]}], "\n", "\t\t", "]"}]}]}],
"\n", "\t", "]"}]}], ";"}]}], "CodeInput",
CellChangeTimes->{{3.699937576561064*^9, 3.699937842671096*^9}, {
3.699937980781375*^9, 3.699937981170021*^9}, {3.6999380430549593`*^9,
3.699938109137146*^9}, {3.6999409404964237`*^9, 3.699940944162681*^9}, {
3.700356113008729*^9, 3.700356161020547*^9}, {3.7003563778199*^9,
3.700356384326764*^9}, {3.700363907511817*^9, 3.7003639180829287`*^9}, {
3.702730389132752*^9, 3.7027304608831263`*^9}, {3.7027305189399643`*^9,
3.702730618184128*^9}, {3.7027308647499313`*^9, 3.702730882483536*^9}, {
3.702731451855854*^9, 3.702731492829652*^9}, {3.7027704241645308`*^9,
3.702770469507577*^9}, {3.7027707198433657`*^9, 3.702770722958209*^9}, {
3.7034688435426683`*^9, 3.703468856670109*^9}, {3.703469462143456*^9,
3.70346946912667*^9}, {3.7034695247867603`*^9, 3.703469589138899*^9}, {
3.703606453538665*^9, 3.703606480277062*^9}, {3.704668580351658*^9,
3.704668665624916*^9}, {3.7046688430998783`*^9, 3.704668928474918*^9}, {
3.704668990805851*^9, 3.704669023592943*^9}, {3.704669060430234*^9,
3.704669152129554*^9}, {3.704669222280706*^9, 3.704669275481935*^9}, {
3.704669379542976*^9, 3.704669429734663*^9}, {3.704669461072893*^9,
3.704669467181246*^9}, {3.705594369386701*^9, 3.705594428441638*^9},
3.705596850456167*^9, {3.710422336482489*^9, 3.710422336544141*^9}, {
3.710427615147128*^9, 3.710427615768461*^9}, {3.710428373950049*^9,
3.710428395785067*^9},
3.710429110633007*^9},ExpressionUUID->"632f6c1c-bf18-430c-9205-\
e0b2d54d720a"]
}, Closed]],
Cell[CellGroupData[{
Cell["PDpacletDocsInfo", "Subsubsubsection",
CellChangeTimes->{{3.702731329446846*^9, 3.7027313313654203`*^9},
3.7055944322821407`*^9,
3.7104223365567703`*^9},ExpressionUUID->"de64f531-053f-4f4f-b125-\
8cf016e634a3"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"Options", "[", "PDpacletDocsInfo", "]"}], "=",
RowBox[{"{", "\n", "\t",
RowBox[{
RowBox[{"\"\<Language\>\"", "\[Rule]", "\"\<English\>\""}], ",", "\n",
"\t",
RowBox[{"\"\<Root\>\"", "\[Rule]", "None"}], ",", "\n", "\t",
RowBox[{"\"\<LinkBase\>\"", "\[Rule]", "None"}], ",", "\n", "\t",
RowBox[{"\"\<MainPage\>\"", "\[Rule]", "None"}]}],
RowBox[{"(*",
RowBox[{",", "\n", "\t",
RowBox[{"\"\<Resources\>\"", "\[Rule]", "None"}]}], "*)"}], "\n", "\t",
"}"}]}], ";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"PDpacletDocsInfo", "[",
RowBox[{"ops", ":",
RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], ":=", "\n",
RowBox[{"SortBy", "[",
RowBox[{
RowBox[{"DeleteCases", "[",
RowBox[{
RowBox[{"DeleteDuplicatesBy", "[",
RowBox[{
RowBox[{"{", "ops", "}"}], ",", "First"}], "]"}], ",",
RowBox[{"_", "\[Rule]", "None"}]}], "]"}], ",", "\n", "\t",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"o", "=",
RowBox[{"Options", "@", "PDpacletDocsInfo"}]}], "}"}], ",",
RowBox[{
RowBox[{"Position", "[",
RowBox[{"o", ",",
RowBox[{"First", "@", "#"}]}], "]"}], "&"}]}], "]"}]}], "]"}]}],
";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"PDpacletDocsInfo", "[",
RowBox[{
RowBox[{"dest_String", "?", "DirectoryQ"}], ",",
RowBox[{"ops", ":",
RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", "\n",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"lang", "=", "\n", "\t\t",
RowBox[{"FileBaseName", "@", "\n", "\t\t",
RowBox[{"SelectFirst", "[", "\n", "\t\t\t",
RowBox[{
RowBox[{"FileNames", "[",
RowBox[{"\"\<*\>\"", ",",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{"dest", ",", "\"\<Documentation\>\""}], "}"}]}]}],
"]"}], ",", "\n", "\t\t\t", "DirectoryQ"}], "]"}]}]}], "}"}], ",",
"\n", "\t",
RowBox[{"If", "[",
RowBox[{
RowBox[{"MissingQ", "@", "lang"}], ",", "\n", "\t\t",
RowBox[{"{", "}"}], ",", "\n", "\t\t",
RowBox[{"PDpacletDocsInfo", "[",
RowBox[{"ops", ",", "\n", "\t\t\t",
RowBox[{"\"\<Language\>\"", "\[Rule]", "\n", "\t\t\t", "lang"}], ",",
"\n", "\t\t\t",
RowBox[{"\"\<MainPage\>\"", "->", "\n", "\t\t\t",
RowBox[{"Replace", "[", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Map", "[", "\n", "\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"FileNameTake", "[",
RowBox[{"#", ",",
RowBox[{"-", "2"}]}], "]"}], "&"}], ",", "\n", "\t\t\t\t\t",
RowBox[{"Replace", "[", "\n", "\t\t\t\t\t\t",
RowBox[{
RowBox[{"FileNames", "[",
RowBox[{"\"\<*.nb\>\"", ",", "\n", "\t\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{
"dest", ",", "\"\<Documentation\>\"", ",", "lang", ",",
"\"\<Guides\>\""}], "}"}]}]}], "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t\t\t\t",
RowBox[{
RowBox[{"{", "}"}], ":>", "\n", "\t\t\t\t\t\t\t",
RowBox[{"FileNames", "[",
RowBox[{"\"\<*.nb\>\"", ",", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{
"dest", ",", "\"\<Documentation\>\"", ",", "lang"}],
"}"}]}], ",", "\n", "\t\t\t\t\t\t\t\t", "2"}], "]"}]}],
"\n", "\t\t\t\t\t\t\t", "}"}]}], "]"}]}], "\n", "\t\t\t\t\t",
"]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"{", "}"}], "\[Rule]", "None"}], ",", "\n",
"\t\t\t\t\t",
RowBox[{
RowBox[{"p", ":",
RowBox[{"{", "__", "}"}]}], ":>", "\n", "\t\t\t\t\t",
RowBox[{"First", "@", "\n", "\t\t\t\t\t",
RowBox[{"SortBy", "[",
RowBox[{
RowBox[{"StringTrim", "[",
RowBox[{"p", ",", "\"\<.nb\>\""}], "]"}], ",", "\n",
"\t\t\t\t\t\t",
RowBox[{
RowBox[{"EditDistance", "[",
RowBox[{
RowBox[{"FileBaseName", "@", "dest"}], ",",
RowBox[{"FileBaseName", "@", "#"}]}], "]"}], "&"}]}],
"]"}]}]}]}], "\n", "\t\t\t\t\t", "}"}]}], "]"}]}]}], "\n",
"\t\t\t", "]"}]}], "\n", "\t\t", "]"}]}], "\n", "\t", "]"}]}],
";"}]}], "CodeInput",
CellChangeTimes->{{3.702731029659607*^9, 3.702731111924505*^9}, {
3.703469785443849*^9, 3.703469821543401*^9}, {3.7034706071369047`*^9,
3.7034706098812037`*^9}, 3.703470702999569*^9, {3.703470733925055*^9,
3.703470736892271*^9}, 3.70347117860063*^9, 3.705594362952306*^9, {
3.7055944330984907`*^9, 3.705594436529271*^9}, {3.710422336577326*^9,
3.710422336595326*^9},
3.710429110715848*^9},ExpressionUUID->"27f16f82-a556-4c20-93a0-\
d0bd34a15ace"]
}, Closed]],
Cell[CellGroupData[{
Cell["PDpacletExtensionData", "Subsubsubsection",
CellChangeTimes->{{3.703450897443469*^9, 3.703450900273913*^9},
3.70559443824907*^9,
3.710422336604162*^9},ExpressionUUID->"7c793db3-3b53-46dc-a3a7-\
a21f6e26138d"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"Options", "[", "PDpacletExtensionData", "]"}], "=",
RowBox[{"{", "\n", "\t",
RowBox[{
RowBox[{"\"\<Documentation\>\"", "\[Rule]", "Automatic"}], ",", "\n",
"\t",
RowBox[{"\"\<Kernel\>\"", "\[Rule]", "Automatic"}], ",", "\n", "\t",
RowBox[{"\"\<FrontEnd\>\"", "\[Rule]", "Automatic"}], ",", "\n", "\t",
RowBox[{"\"\<Resource\>\"", "\[Rule]", "Automatic"}], ",", "\n", "\t",
RowBox[{"\"\<AutoCompletionData\>\"", "\[Rule]", "Automatic"}]}], "\n",
"\t", "}"}]}], ";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"PDpacletExtensionData", "[",
RowBox[{"PDpacletInfo_Association", ",", "dest_", ",",
RowBox[{"ops", ":",
RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", "\n",
RowBox[{
RowBox[{"Merge", "[",
RowBox[{"Merge", "[", "Last", "]"}], "]"}], "@",
RowBox[{"{", "\n", "\t",
RowBox[{
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"Lookup", "[",
RowBox[{"PDpacletInfo", ",", "\"\<Extensions\>\""}], "]"}], ",",
"\n", "\t\t",
RowBox[{
RowBox[{"Except", "[",
RowBox[{"_Association", "?", "AssociationQ"}], "]"}], ":>", "\n",
"\t\t",
RowBox[{"<|", "|>"}]}]}], "\n", "\t\t", "]"}], ",", "\n", "\t",
RowBox[{"{", "\n", "\t\t",
RowBox[{
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<Documentation\>\"", "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Automatic", ":>", "\n", "\t\t\t\t",
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Length", "@", "\n", "\t\t\t\t\t",
RowBox[{"FileNames", "[",
RowBox[{"\"\<*.nb\>\"", ",", "\n", "\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{"dest", ",", "\"\<Documentation\>\""}], "}"}]}],
",", "\n", "\t\t\t\t\t\t", "\[Infinity]"}], "]"}]}], ">",
"0"}], ",", "\n", "\t\t\t\t\t",
RowBox[{"\"\<Documentation\>\"", "->", "\n", "\t\t\t\t\t",
RowBox[{"PDpacletDocsInfo", "[", "dest", "]"}]}], ",", "\n",
"\t\t\t\t\t", "Nothing"}], "\n", "\t\t\t\t\t", "]"}]}], ",",
"\n", "\t\t\t\t",
RowBox[{
RowBox[{"r", ":",
RowBox[{"_Rule", "|",
RowBox[{"{", "___Rule", "}"}]}]}], ":>", "\n", "\t\t\t\t",
RowBox[{"\"\<Documentation\>\"", "\[Rule]",
RowBox[{"Association", "@",
RowBox[{"Flatten", "@",
RowBox[{"{", "r", "}"}]}]}]}]}], ",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Except", "[", "_Association", "]"}], "\[Rule]",
"Nothing"}]}], "\n", "\t\t\t\t", "}"}]}], "]"}], ",", "\n",
"\t\t",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<Kernel\>\"", "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Automatic", ":>", "\n", "\t\t\t\t",
RowBox[{"\"\<Kernel\>\"", "->", "\n", "\t\t\t\t",
RowBox[{"<|", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Root", " ", "->", " ", "\"\<.\>\""}], ",", " ", "\n",
"\t\t\t\t",
RowBox[{"Context", " ", "->", " ",
RowBox[{
RowBox[{"FileBaseName", "@", "dest"}], "<>",
"\"\<`\>\""}]}]}], "\n", "\t\t\t\t", "|>"}]}]}], ",", "\n",
"\t\t\t\t",
RowBox[{
RowBox[{"r", ":",
RowBox[{"_Rule", "|",
RowBox[{"{", "___Rule", "}"}]}]}], ":>", "\n", "\t\t\t\t",
RowBox[{"\"\<Kernel\>\"", "\[Rule]",
RowBox[{"Association", "@",
RowBox[{"Flatten", "@",
RowBox[{"{", "r", "}"}]}]}]}]}], ",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Except", "[", "_Association", "]"}], "\[Rule]",
"Nothing"}]}], "\n", "\t\t\t\t", "}"}]}], "]"}], ",", "\n",
"\t\t",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<FrontEnd\>\"", "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Automatic", ":>", "\n", "\t\t\t\t",
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Length", "@",
RowBox[{
RowBox[{"Select", "[",
RowBox[{"Not", "@*", "DirectoryQ"}], "]"}], "@", "\n",
"\t\t\t\t\t",
RowBox[{"Flatten", "@",
RowBox[{"Join", "[", "\n", "\t\t\t\t\t\t",
RowBox[{
RowBox[{"Map", "[", "\n", "\t\t\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"FileNames", "[",
RowBox[{"\"\<*.nb\>\"", ",", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{
"dest", ",", "\"\<FrontEnd\>\"", ",",
"\"\<Documentation\>\"", ",", "#"}], "}"}]}], ",", "\n",
"\t\t\t\t\t\t\t\t", "\[Infinity]"}], "]"}], "&"}], ",",
RowBox[{"{", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{
"\"\<ReferencePages\>\"", ",", "\n", "\t\t\t\t\t\t\t\t",
"\"\<Guides\>\"", ",", "\n", "\t\t\t\t\t\t\t\t",
"\"\<Tutorials\>\""}], "\n", "\t\t\t\t\t\t\t\t", "}"}]}],
"]"}], ",", "\n", "\t\t\t\t\t\t",
RowBox[{"Map", "[", "\n", "\t\t\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"FileNames", "[",
RowBox[{"\"\<*\>\"", ",", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{"dest", ",", "\"\<FrontEnd\>\"", ",", "#"}],
"}"}]}], ",", "\n", "\t\t\t\t\t\t\t\t", "\[Infinity]"}],
"\n", "\t\t\t\t\t\t\t\t", "]"}], "&"}], ",",
RowBox[{"{", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{
"\"\<TextResources\>\"", ",", "\n", "\t\t\t\t\t\t\t\t",
"\"\<SystemResources\>\""}], "\n", "\t\t\t\t\t\t\t\t",
"}"}]}], "]"}]}], "\n", "\t\t\t\t\t\t", "]"}]}]}]}], ">",
"0"}], ",", "\n", "\t\t\t\t\t",
RowBox[{"\"\<FrontEnd\>\"", "\[Rule]", "\n", "\t\t\t\t\t",
RowBox[{"If", "[", "\n", "\t\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"DirectoryQ", "@", "\n", "\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{
"dest", ",", "\n", "\t\t\t\t\t\t\t", "\"\<FrontEnd\>\"",
",", "\n", "\t\t\t\t\t\t\t", "\"\<TextResources\>\""}],
"\n", "\t\t\t\t\t\t\t", "}"}]}]}], "||", "\n",
"\t\t\t\t\t\t",
RowBox[{"DirectoryQ", "@", "\n", "\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{
"dest", ",", "\n", "\t\t\t\t\t\t\t", "\"\<FrontEnd\>\"",
",", "\n", "\t\t\t\t\t\t\t", "\"\<SystemResources\>\""}],
"\n", "\t\t\t\t\t\t\t", "}"}]}]}]}], ",", "\n",
"\t\t\t\t\t\t",
RowBox[{"<|",
RowBox[{"Prepend", "\[Rule]", "True"}], "|>"}], ",", "\n",
"\t\t\t\t\t\t",
RowBox[{"<|", "|>"}]}], "\n", "\t\t\t\t\t\t", "]"}]}], ",",
"\n", "\t\t\t\t\t", "Nothing"}], "\n", "\t\t\t\t\t", "]"}]}],
",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"r", ":",
RowBox[{"_Rule", "|",
RowBox[{"{", "___Rule", "}"}]}]}], ":>", "\n", "\t\t\t\t",
RowBox[{"\"\<FrontEnd\>\"", "\[Rule]",
RowBox[{"Association", "@",
RowBox[{"Flatten", "@",
RowBox[{"{", "r", "}"}]}]}]}]}], ",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Except", "[", "_Association", "]"}], "\[Rule]",
"Nothing"}]}], "\n", "\t\t\t\t", "}"}]}], "]"}], ",", "\n",
"\t\t",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<Resource\>\"", "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Automatic", ":>", "\n", "\t\t\t\t",
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Length", "@", "\n", "\t\t\t\t\t",
RowBox[{"Select", "[", "\n", "\t\t\t\t\t\t",
RowBox[{
RowBox[{"FileNames", "[",
RowBox[{"\"\<*\>\"", ",", "\n", "\t\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{"dest", ",", "\"\<Data\>\""}], "}"}]}], ",", "\n",
"\t\t\t\t\t\t\t", "\[Infinity]"}], "]"}], ",", "\n",
"\t\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"Not", "@",
RowBox[{"DirectoryQ", "@", "#"}]}], "&&", "\n",
"\t\t\t\t\t\t",
RowBox[{"Not", "@",
RowBox[{"StringMatchQ", "[",
RowBox[{
RowBox[{"FileNameTake", "@", "#"}], ",",
"\"\<.DS_Store\>\""}], "]"}]}]}], "&"}]}], "\n",
"\t\t\t\t\t\t", "]"}]}], ">", "0"}], ",", "\n",
"\t\t\t\t\t",
RowBox[{"\"\<Resource\>\"", "->", "\n", "\t\t\t\t\t",
RowBox[{"<|", "\n", "\t\t\t\t\t",
RowBox[{
RowBox[{"\"\<Root\>\"", " ", "->", " ", "\"\<Data\>\""}],
",", "\n", "\t\t\t\t\t",
RowBox[{
"\"\<Resources\>\"", " ", "->", " ", "\n", "\t\t\t\t\t",
RowBox[{"Map", "[", "\n", "\t\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"FileNameDrop", "[",
RowBox[{"#", ",", "\n", "\t\t\t\t\t\t\t",
RowBox[{
RowBox[{"FileNameDepth", "[", "dest", "]"}], "+", "1"}]}],
"\n", "\t\t\t\t\t\t\t", "]"}], "&"}], ",", "\n",
"\t\t\t\t\t\t",
RowBox[{"Select", "[", "\n", "\t\t\t\t\t\t\t",
RowBox[{
RowBox[{"FileNames", "[",
RowBox[{"\"\<*\>\"", ",", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{"dest", ",", "\"\<Data\>\""}], "}"}]}], ",", "\n",
"\t\t\t\t\t\t\t\t", "\[Infinity]"}], "]"}], ",", "\n",
"\t\t\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"Not", "@",
RowBox[{"DirectoryQ", "@", "#"}]}], "&&", "\n",
"\t\t\t\t\t\t\t",
RowBox[{"Not", "@",
RowBox[{"StringMatchQ", "[",
RowBox[{
RowBox[{"FileNameTake", "@", "#"}], ",",
"\"\<.DS_Store\>\""}], "]"}]}]}], "&"}]}], "\n",
"\t\t\t\t\t\t\t", "]"}]}], "\n", "\t\t\t\t\t\t",
"]"}]}]}], "\n", "\t\t\t\t\t", "|>"}]}], ",", "\n",
"\t\t\t\t\t", "Nothing"}], "\n", "\t\t\t\t\t", "]"}]}], ",",
"\n", "\t\t\t\t",
RowBox[{
RowBox[{"r", ":",
RowBox[{"_Rule", "|",
RowBox[{"{", "___Rule", "}"}]}]}], ":>", "\n", "\t\t\t\t",
RowBox[{"\"\<Resource\>\"", "\[Rule]",
RowBox[{"Association", "@",
RowBox[{"Flatten", "@",
RowBox[{"{", "r", "}"}]}]}]}]}], ",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Except", "[", "_Association", "]"}], "\[Rule]",
"Nothing"}]}], "\n", "\t\t\t\t", "}"}]}], "]"}], ",", "\n",
"\t\t",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<AutoCompletionData\>\"", "]"}],
",",
RowBox[{"{", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Automatic", ":>", "\n", "\t\t\t\t",
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Length", "@", "\n", "\t\t\t\t\t",
RowBox[{"FileNames", "[",
RowBox[{
RowBox[{
"\"\<*.tr\>\"", "|", "\"\<documentedContexts.m\>\""}], ",",
"\n", "\t\t\t\t\t\t",
RowBox[{"FileNameJoin", "@",
RowBox[{"{",
RowBox[{"dest", ",", "\"\<AutoCompletionData\>\""}],
"}"}]}], ",", "\n", "\t\t\t\t\t\t", "\[Infinity]"}],
"]"}]}], ">", "0"}], ",", "\n", "\t\t\t\t\t",
RowBox[{"\"\<AutoCompletionData\>\"", "->", "\n", "\t\t\t\t\t",
RowBox[{"<|", "\n", "\t\t\t\t\t",
RowBox[{
"\"\<Root\>\"", " ", "->", " ",
"\"\<AutoCompletionData\>\""}], "\n", "\t\t\t\t\t",
"|>"}]}], ",", "\n", "\t\t\t\t\t", "Nothing"}], "\n",
"\t\t\t\t\t", "]"}]}], ",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"r", ":",
RowBox[{"_Rule", "|",
RowBox[{"{", "___Rule", "}"}]}]}], ":>", "\n", "\t\t\t\t",
RowBox[{"\"\<Documentation\>\"", "\[Rule]",
RowBox[{"Association", "@",
RowBox[{"Flatten", "@",
RowBox[{"{", "r", "}"}]}]}]}]}], ",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Except", "[", "_Association", "]"}], "\[Rule]",
"Nothing"}]}], "\n", "\t\t\t\t", "}"}]}], "]"}]}], "\n", "\t\t",
"}"}]}], "\n", "\t", "}"}]}]}], ";"}]}], "CodeInput",
CellChangeTimes->{{3.703450904465002*^9, 3.70345097650543*^9}, {
3.7034510552736397`*^9, 3.703451060631516*^9}, {3.703451185218995*^9,
3.7034511876643963`*^9}, {3.703467950958033*^9, 3.703468104304346*^9}, {
3.703468272011835*^9, 3.703468386173727*^9}, {3.703468417997353*^9,
3.703468580809701*^9}, {3.7034686316810617`*^9, 3.703468636719306*^9},
3.703468672649283*^9, {3.7034687085833483`*^9, 3.703468745774809*^9}, {
3.703469424284089*^9, 3.703469425898272*^9}, {3.703469975371531*^9,
3.7034699887334843`*^9}, {3.703470770623753*^9, 3.703470783145918*^9}, {
3.703470868140491*^9, 3.703470922866765*^9}, {3.703470960273962*^9,
3.703470968767466*^9}, {3.703471111771553*^9, 3.703471119079247*^9}, {
3.703471198477932*^9, 3.703471202875317*^9}, {3.7034713957096863`*^9,
3.703471399970703*^9}, {3.703471454042104*^9, 3.7034714789845963`*^9}, {
3.703799347881113*^9, 3.703799415700016*^9}, {3.7038718518760023`*^9,
3.703871884104478*^9}, {3.7038719933854723`*^9, 3.7038720587580214`*^9}, {
3.703872187593163*^9, 3.70387218773909*^9}, 3.703872688859228*^9, {
3.70387332106469*^9, 3.703873333021936*^9}, {3.704933002327221*^9,
3.704933070565832*^9}, {3.7049331540731983`*^9, 3.7049332110251923`*^9}, {
3.7049332789253597`*^9, 3.704933301238986*^9}, {3.7049338174070873`*^9,
3.7049338182133007`*^9}, {3.704933864349413*^9, 3.704933936307232*^9}, {
3.704934803907208*^9, 3.704934804071639*^9}, 3.705594356008121*^9, {
3.705594438797793*^9, 3.7055944413256617`*^9}, {3.710422336629513*^9,
3.710422336659424*^9},
3.710429110826561*^9},ExpressionUUID->"91a7dcc1-5425-42fe-b18f-\
99e6e28d72e2"]
}, Closed]],
Cell[CellGroupData[{
Cell["PDpacletExpression", "Subsubsubsection",
CellChangeTimes->{{3.69993520784684*^9, 3.699935209336134*^9},
3.7027313408184547`*^9, 3.705594442520713*^9,
3.71042233666893*^9},ExpressionUUID->"13f75305-f7f0-4876-b9c2-\
4ec3fbc25d95"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"Options", "[", "PDpacletExpression", "]"}], "=", "\n",
RowBox[{"Join", "[", "\n", "\t",
RowBox[{
RowBox[{"{", "\n", "\t\t",
RowBox[{
RowBox[{"\"\<Name\>\"", "\[Rule]", "\"\<MyPaclet\>\""}], ",", "\n",
"\t\t",
RowBox[{"\"\<Version\>\"", "\[Rule]", "Automatic"}], ",", "\n", "\t\t",
RowBox[{"\"\<Creator\>\"", "\[Rule]", "Automatic"}], ",", "\n", "\t\t",
RowBox[{"\"\<Description\>\"", "\[Rule]", "Automatic"}], ",", "\n",
"\t\t",
RowBox[{"\"\<Root\>\"", "\[Rule]", "Automatic"}], ",", "\n", "\t\t",
RowBox[{"\"\<WolframVersion\>\"", "\[Rule]", "Automatic"}], ",", "\n",
"\t\t",
RowBox[{"\"\<Internal\>\"", "\[Rule]", "Automatic"}], ",", "\n",
"\t\t",
RowBox[{"\"\<Loading\>\"", "\[Rule]", "Automatic"}], ",", "\n", "\t\t",
RowBox[{"\"\<Qualifier\>\"", "\[Rule]", "Automatic"}], ",", "\n",
"\t\t",
RowBox[{"\"\<BuildNumber\>\"", "\[Rule]", "Automatic"}], ",", "\n",
"\t\t",
RowBox[{"\"\<Extensions\>\"", "\[Rule]", "Automatic"}]}], "\n", "\t\t",
"}"}], ",", "\n", "\t",
RowBox[{"Options", "@", "PDpacletExtensionData"}]}], "\n", "\t", "]"}]}],
";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"PDpacletExpression", "[",
RowBox[{"ops", ":",
RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], ":=", "\n",
RowBox[{"PacletManager`Paclet", "@@", "\n",
RowBox[{"SortBy", "[",
RowBox[{
RowBox[{"DeleteCases", "[",
RowBox[{
RowBox[{"DeleteDuplicatesBy", "[",
RowBox[{
RowBox[{"{", "ops", "}"}], ",", "First"}], "]"}], ",",
RowBox[{"_", "\[Rule]", "None"}]}], "]"}], ",", "\n", "\t",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"o", "=",
RowBox[{"Options", "@", "PDpacletExpression"}]}], "}"}], ",",
RowBox[{
RowBox[{"Position", "[",
RowBox[{"o", ",",
RowBox[{"First", "@", "#"}]}], "]"}], "&"}]}], "]"}]}], "\n", "\t",
"]"}]}]}], ";"}]}], "CodeInput",
CellChangeTimes->{{3.69993521029556*^9, 3.69993525248245*^9}, {
3.699935289370064*^9, 3.699935381071134*^9}, {3.699935450310876*^9,
3.69993562813696*^9}, 3.6999361433766537`*^9, 3.699936323687511*^9, {
3.6999389750574093`*^9, 3.699938977865988*^9}, {3.699939029369296*^9,
3.69993904181254*^9}, {3.699939834537401*^9, 3.699939845927816*^9}, {
3.699939888960884*^9, 3.699939960582406*^9}, {3.6999400425509977`*^9,
3.699940042703384*^9}, 3.699940155389453*^9, 3.699940191517207*^9,
3.699940223544446*^9, 3.699940281481804*^9, {3.699940319410574*^9,
3.6999403200641203`*^9}, {3.699940376375204*^9, 3.699940378211637*^9}, {
3.700342448432473*^9, 3.7003424856821003`*^9}, {3.7003425189641943`*^9,
3.700342582622477*^9}, {3.700342716065605*^9, 3.700342826784768*^9}, {
3.7003431997376623`*^9, 3.700343285218247*^9}, {3.700343320584908*^9,
3.7003433691661377`*^9}, {3.70034340956074*^9, 3.700343448547907*^9}, {
3.700343492274815*^9, 3.7003435531265697`*^9}, {3.700354523789888*^9,
3.700354676681443*^9}, {3.700354738768631*^9, 3.700354799090105*^9}, {
3.700354885400064*^9, 3.700354888183856*^9}, {3.7003550970785837`*^9,
3.7003550989659557`*^9}, {3.70035514725167*^9, 3.700355148578209*^9}, {
3.7003562065591793`*^9, 3.7003562071048203`*^9}, {3.700356244561697*^9,
3.700356320069002*^9}, {3.702730738657734*^9, 3.702730760023446*^9}, {
3.702730797715949*^9, 3.702730855278475*^9}, {3.702730898445737*^9,
3.702730917164303*^9}, {3.7027316297105494`*^9, 3.702731633762151*^9}, {
3.7028416767176037`*^9, 3.7028416813158703`*^9}, {3.703446464012766*^9,
3.7034464691996603`*^9}, {3.7034465186977863`*^9, 3.703446582941861*^9}, {
3.70344666388721*^9, 3.703446665035096*^9}, {3.70345106791057*^9,
3.703451083764427*^9}, {3.703470797442131*^9, 3.7034708197245293`*^9}, {
3.705594341150548*^9, 3.705594344758917*^9}, {3.705594443050112*^9,
3.705594449999565*^9}, {3.710422336681469*^9, 3.710422336696206*^9}, {
3.7104283740101852`*^9, 3.710428395793686*^9},
3.710429110929728*^9},ExpressionUUID->"349d4afd-85f1-403a-9ef4-\
65e4abc16de5"],
Cell[BoxData[
RowBox[{
RowBox[{
RowBox[{"PDpacletExpression", "[", "\n", "\t",
RowBox[{
RowBox[{"dest_String", "?", "DirectoryQ"}], ",", "\n", "\t",
RowBox[{"ops", ":",
RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", "\n",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"PDpacletInfo", "=",
RowBox[{"PDpacletInfoAssociation", "[", "dest", "]"}]}], "}"}], ",",
"\n", "\t",
RowBox[{"PDpacletExpression", "[", "\n", "\t\t",
RowBox[{
RowBox[{"Sequence", "@@",
RowBox[{"FilterRules", "[",
RowBox[{
RowBox[{"{", "ops", "}"}], ",", "\n", "\t\t\t",
RowBox[{"Except", "[",
RowBox[{
"\"\<Kernel\>\"", "|", "\"\<Documentation\>\"", "|",
"\"\<Extensions\>\"", "|", "\"\<FrontEnd\>\""}], "]"}]}], "]"}]}],
",", "\n", "\t\t",
RowBox[{"\"\<Name\>\"", "\[Rule]",
RowBox[{"FileBaseName", "@", "dest"}]}], ",", "\n", "\t\t",
RowBox[{"\"\<Extensions\>\"", "->", "\n", "\t\t",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<Extensions\>\"", "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Automatic", ":>", "\n", "\t\t\t\t",
RowBox[{"KeyValueMap", "[",
RowBox[{
RowBox[{
RowBox[{"Prepend", "[",
RowBox[{
RowBox[{"Normal", "@", "#2"}], ",", "#"}], "]"}], "&"}],
",", "\n", "\t\t\t\t\t",
RowBox[{"PDpacletExtensionData", "[",
RowBox[{
"PDpacletInfo", ",", "\n", "\t\t\t\t\t\t", "dest", ",", "\n",
"\t\t\t\t\t\t",
RowBox[{"FilterRules", "[",
RowBox[{
RowBox[{"{", "ops", "}"}], ",", "\n", "\t\t\t\t\t\t\t",
RowBox[{"Options", "@", "PDpacletExtensionData"}]}], "\n",
"\t\t\t\t\t\t\t", "]"}]}], "\n", "\t\t\t\t\t\t", "]"}]}],
"\n", "\t\t\t\t\t", "]"}]}], ",", "\n", "\t\t\t\t",
RowBox[{
RowBox[{"Except", "[", "_List", "]"}], ":>", "\n", "\t\t\t\t",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"baseData", "=", "\n", "\t\t\t\t\t\t",
RowBox[{"PDpacletExtensionData", "[",
RowBox[{
"PDpacletInfo", ",", "\n", "\t\t\t\t\t\t\t", "dest", ",",
"\n", "\t\t\t\t\t\t\t",
RowBox[{"FilterRules", "[",
RowBox[{
RowBox[{"{", "ops", "}"}], ",", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{"Options", "@", "PDpacletExtensionData"}]}], "\n",
"\t\t\t\t\t\t\t\t", "]"}]}], "\n", "\t\t\t\t\t\t\t",
"]"}]}], "}"}], ",", "\n", "\t\t\t\t\t",
RowBox[{"Map", "[", "\n", "\t\t\t\t\t\t",
RowBox[{
RowBox[{
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "[", "#", "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{
RowBox[{"Automatic", ":>", "\n", "\t\t\t\t\t\t\t\t",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"Lookup", "[",
RowBox[{"baseData", ",", "#"}], "]"}], ",",
RowBox[{"{", "\n", "\t\t\t\t\t\t\t\t\t\t",
RowBox[{
RowBox[{
"a_Association", ":>", "\n", "\t\t\t\t\t\t\t\t\t\t",
RowBox[{"Flatten", "@",
RowBox[{"{",
RowBox[{"#", ",",
RowBox[{"Normal", "@", "a"}]}], "}"}]}]}], ",", "\n",
"\t\t\t\t\t\t\t\t\t\t",
RowBox[{"_", "\[Rule]", "Nothing"}]}], "\n",
"\t\t\t\t\t\t\t\t\t\t", "}"}]}], "]"}]}], ",", "\n",
"\t\t\t\t\t\t\t\t",
RowBox[{
RowBox[{"r", ":",
RowBox[{"_Rule", "|",
RowBox[{"{", "___Rule", "}"}], "|", "_Association"}]}], ":>",
"\n", "\t\t\t\t\t\t\t\t",
RowBox[{"Flatten", "@",
RowBox[{"{", "\n", "\t\t\t\t\t\t\t\t\t",
RowBox[{"#", ",", "\n", "\t\t\t\t\t\t\t\t\t",
RowBox[{"Normal", "@", "r"}]}], "\n",
"\t\t\t\t\t\t\t\t\t", "}"}]}]}], ",", "\n",
"\t\t\t\t\t\t\t\t",
RowBox[{"_", "\[Rule]", "Nothing"}]}], "\n",
"\t\t\t\t\t\t\t\t", "}"}]}], "]"}], "&"}], ",", "\n",
"\t\t\t\t\t\t",
RowBox[{"Keys", "@",
RowBox[{"Options", "[", "PDpacletExtensionData", "]"}]}]}],
"\n", "\t\t\t\t\t\t", "]"}]}], "\n", "\t\t\t\t\t", "]"}]}]}],
"\n", "\t\t\t\t", "}"}]}], "]"}]}], ",", "\n", "\t\t",
RowBox[{"\"\<Version\>\"", "->", "\n", "\t\t",
RowBox[{"Replace", "[",
RowBox[{
RowBox[{"OptionValue", "@", "\"\<Version\>\""}], ",", "\n",
"\t\t\t",
RowBox[{"Automatic", ":>", "\n", "\t\t\t",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"pointVersions", "=", "\n", "\t\t\t\t\t",
RowBox[{"StringSplit", "[", "\n", "\t\t\t\t\t\t",
RowBox[{
RowBox[{"ToString", "[",
RowBox[{"Lookup", "[",
RowBox[{
"PDpacletInfo", ",", "\"\<Version\>\"", ",",
"\"\<1.0.-1\>\""}], "]"}], "]"}], ",", "\n",
"\t\t\t\t\t\t", "\"\<.\>\""}], "\n", "\t\t\t\t\t\t", "]"}]}],
"\n", "\t\t\t\t\t", "}"}], ",", "\n", "\t\t\t\t",
RowBox[{"StringJoin", "@",
RowBox[{"Riffle", "[", "\n", "\t\t\t\t\t",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Length", "@", "pointVersions"}], ">", "1"}], ",",
"\n", "\t\t\t\t\t\t",
RowBox[{"Append", "[",
RowBox[{
RowBox[{"Most", "@", "pointVersions"}], ",", "\n",
"\t\t\t\t\t\t\t",
RowBox[{"ToString", "[",
RowBox[{
RowBox[{"ToExpression", "[",
RowBox[{"Last", "@", "pointVersions"}], "]"}], "+", "1"}],
"]"}]}], "\n", "\t\t\t\t\t\t\t", "]"}], ",", "\n",
"\t\t\t\t\t\t",
RowBox[{"{",
RowBox[{"pointVersions", ",", "\"\<1\>\""}], "}"}]}],
"]"}], ",", "\n", "\t\t\t\t\t", "\"\<.\>\""}], "]"}]}]}],
"\n", "\t\t\t\t", "]"}]}]}], "\n", "\t\t\t", "]"}]}], ",", "\n",
"\t\t",
RowBox[{"Sequence", "@@",
RowBox[{"Normal", "@", "PDpacletInfo"}]}]}], "\n", "\t\t", "]"}]}],
"\n", "\t", "]"}]}], ";"}]], "CodeInput",
CellChangeTimes->{{3.69993521029556*^9, 3.69993525248245*^9}, {
3.699935289370064*^9, 3.699935381071134*^9}, {3.699935450310876*^9,
3.69993562813696*^9}, 3.6999361433766537`*^9, 3.699936323687511*^9, {
3.6999389750574093`*^9, 3.699938977865988*^9}, {3.699939029369296*^9,
3.69993904181254*^9}, {3.699939834537401*^9, 3.699939845927816*^9}, {
3.699939888960884*^9, 3.699939960582406*^9}, {3.6999400425509977`*^9,
3.699940042703384*^9}, 3.699940155389453*^9, 3.699940191517207*^9,
3.699940223544446*^9, 3.699940281481804*^9, {3.699940319410574*^9,
3.6999403200641203`*^9}, {3.699940376375204*^9, 3.699940378211637*^9}, {
3.700342448432473*^9, 3.7003424856821003`*^9}, {3.7003425189641943`*^9,
3.700342582622477*^9}, {3.700342716065605*^9, 3.700342826784768*^9}, {
3.7003431997376623`*^9, 3.700343285218247*^9}, {3.700343320584908*^9,
3.7003433691661377`*^9}, {3.70034340956074*^9, 3.700343448547907*^9}, {
3.700343492274815*^9, 3.7003435531265697`*^9}, {3.700354523789888*^9,
3.700354676681443*^9}, {3.700354738768631*^9, 3.700354799090105*^9}, {
3.700354885400064*^9, 3.700354888183856*^9}, {3.7003550970785837`*^9,
3.7003550989659557`*^9}, {3.70035514725167*^9, 3.700355148578209*^9}, {
3.7003562065591793`*^9, 3.7003562071048203`*^9}, {3.700356244561697*^9,
3.700356320069002*^9}, {3.702730738657734*^9, 3.702730760023446*^9}, {
3.702730797715949*^9, 3.702730855278475*^9}, {3.702730898445737*^9,
3.7027309675980988`*^9}, {3.702731186079154*^9, 3.702731221436178*^9}, {
3.702731635829357*^9, 3.702731656083393*^9}, {3.702840803864994*^9,
3.702840972476619*^9}, {3.702841542874977*^9, 3.702841626337743*^9}, {
3.7028417233659267`*^9, 3.702841766911294*^9}, {3.703446591785573*^9,
3.703446618023468*^9}, {3.703450784429833*^9, 3.7034508589522123`*^9},
3.703450892587578*^9, {3.7034509872200813`*^9, 3.7034510459148493`*^9}, {
3.703451088777977*^9, 3.70345117532248*^9}, {3.703451208189828*^9,
3.703451254552269*^9}, {3.703467858443678*^9, 3.703467879229782*^9},
3.7034686037111673`*^9, {3.703470145353877*^9, 3.703470408158183*^9}, {
3.703470501133217*^9, 3.7034705220476*^9}, {3.703766844133236*^9,
3.7037668546208687`*^9}, 3.705177422908684*^9, {3.705594324267028*^9,
3.705594337555359*^9}, {3.7055944511414347`*^9, 3.705594457333202*^9}, {
3.710422336710122*^9, 3.7104223367750883`*^9},
3.710429111019133*^9},ExpressionUUID->"8f3ca742-c9e0-4f10-aa7d-\
26ef8966a050"]
}, Closed]],