-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsource.opml
1784 lines (1782 loc) · 120 KB
/
source.opml
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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- OPML generated by OPML Editor v10.1b19 on Mon, 09 Dec 2024 14:23:01 GMT -->
<!--
Hi this is Dave Winer. I write all my project code in an outliner, which
generates all the files that make up this GitHub project. You'll see a
source.opml file like this in each of my projects. It contains the outline
source that the repo files were generated from. This is the most logical place
to store them. You can read the code in any outliner that supports OPML, which
includes https://drummer.land. You can use the Open URL command in
Drummer's File menu to open the "raw" version of this file straight from the
GitHub repo.
-->
<opml version="2.0">
<head>
<title>nodeEditor: opmlPackage</title>
<dateCreated>Mon, 28 Jun 2021 20:23:08 GMT</dateCreated>
<dateModified>Mon, 09 Dec 2024 14:23:00 GMT</dateModified>
<ownerName>Dave Winer</ownerName>
<ownerId>http://davewiner.com/</ownerId>
<expansionState>1, 2, 3, 5, 20, 21, 32, 51, 52, 53, 55, 57, 62, 63, 70, 72, 73, 77, 91, 100, 101, 102, 115, 118, 125, 126, 134, 136, 142, 148, 150, 156, 169, 170, 171, 189, 190, 191, 206, 211, 217, 219, 226</expansionState>
<vertScrollState>1</vertScrollState>
<windowTop>84</windowTop>
<windowLeft>703</windowLeft>
<windowBottom>1080</windowBottom>
<windowRight>1778</windowRight>
</head>
<body>
<outline text="/scripting.com/code/opmlpackage/">
<outline text="worknotes.md" created="Mon, 28 Jun 2021 19:25:17 GMT">
<outline text="#### 12/9/24; 9:21:04 AM by DW" created="Mon, 09 Dec 2024 14:21:04 GMT">
<outline text="Under some circumstances, sourcestruct in the parse routine will be undefined, so we check for it instead of crashing." created="Mon, 09 Dec 2024 14:21:05 GMT"/>
</outline>
<outline text="#### 9/7/24; 9:59:57 AM by DW" created="Sat, 07 Sep 2024 13:59:56 GMT">
<outline text="<a href="https://github.com/scripting/opmlPackage/blob/main/client/opml.js#L294">visitAll</a> in both client and server versions had a serious bug. " created="Sat, 07 Sep 2024 13:59:57 GMT"/>
<outline text="if a function returns false it's supposed to stop visiting, but it doesn't. " created="Sat, 07 Sep 2024 14:00:24 GMT"/>
<outline text="perhaps i've never encountered a situation where the logic depended on this. " created="Sat, 07 Sep 2024 14:00:41 GMT"/>
<outline text="i have to fix it, i don't see any way around it. " created="Sat, 07 Sep 2024 14:00:55 GMT"/>
</outline>
<outline text="#### 5/25/24; 3:47:32 PM by DW" created="Sat, 25 May 2024 19:47:32 GMT">
<outline text="Fixed another problem in getOutlineHtml. We were calling filledString and really needed to call utils.filledString." created="Sat, 25 May 2024 19:47:32 GMT"/>
</outline>
<outline text="#### 5/24/24; 8:12:30 AM by DW" created="Fri, 24 May 2024 12:12:29 GMT">
<outline text="Fixed a problem <a href="https://github.com/scripting/opmlPackage/issues/12">reported</a> on GitHub where we were declaring htmltext and indentlevel incorrectly. " created="Fri, 24 May 2024 12:12:30 GMT">
<outline text="* `var htmltext = ""; indentlevel = 0;`" created="Fri, 24 May 2024 12:13:42 GMT"/>
</outline>
<outline text="Replaced the first semicolon with a comma. " created="Thu, 10 Jun 2021 18:52:52 GMT"/>
<outline text="The problem appeared in two places, in the Node package and in the code to be included with a client app." created="Fri, 24 May 2024 12:14:39 GMT"/>
</outline>
<outline text="#### 8/20/23; 10:31:38 AM by DW" created="Sun, 20 Aug 2023 14:31:35 GMT">
<outline text="Changed the generator message on OPML files we generate to include the address of the NPM package." created="Sun, 20 Aug 2023 14:31:39 GMT"/>
<outline text="Changed the private notes file to this file, worknotes.md. The format changed, so some of the earlier notes might not be as pretty as they were. This is becoming standard practice in all my projects." created="Sun, 20 Aug 2023 14:32:12 GMT"/>
</outline>
<outline text="#### 1/8/22; 10:57:35 AM by DW" created="Sat, 08 Jan 2022 15:57:34 GMT">
<outline text="I undid the changes made on the 7th. " created="Sat, 08 Jan 2022 15:57:36 GMT"/>
<outline text="I had decided earlier to not try to handle head-level atts in the first attempt at interop. There are too many variables, and I don't understand enough of the issues. It's the proverbial can of worms." created="Sat, 08 Jan 2022 15:57:45 GMT"/>
</outline>
<outline text="#### 1/7/22; 1:43:05 PM by DW" created="Fri, 07 Jan 2022 18:43:04 GMT">
<outline text="Support for head-level atts when reading a markdown file." created="Fri, 07 Jan 2022 18:43:05 GMT"/>
</outline>
<outline text="#### 1/4/22; 5:40:31 PM by DW" created="Tue, 04 Jan 2022 22:40:31 GMT">
<outline text="Added example code for markdown/outline functions." created="Tue, 04 Jan 2022 22:40:32 GMT"/>
<outline text="Added expandInclude in Node package. " created="Tue, 04 Jan 2022 22:40:42 GMT"/>
</outline>
<outline text="#### 1/3/22; 5:52:48 PM by DW" created="Mon, 03 Jan 2022 22:52:48 GMT">
<outline text="Added commoncode.js because some code can run equally well on server and client. " created="Mon, 03 Jan 2022 22:52:49 GMT"/>
</outline>
<outline text="#### 9/24/21; 2:18:33 PM by DW" created="Fri, 24 Sep 2021 18:18:33 GMT">
<outline text="New entry-point in client code, opml.read. " created="Fri, 24 Sep 2021 18:18:34 GMT"/>
<outline text="Started an Updates section in the readme. " created="Fri, 24 Sep 2021 18:21:21 GMT"/>
</outline>
<outline text="#### 7/1/21; 11:45:06 AM by DW" created="Thu, 01 Jul 2021 15:45:05 GMT">
<outline text="opml.parse has to take a callback because xml2js.parse does." created="Thu, 01 Jul 2021 15:45:06 GMT"/>
</outline>
<outline text="#### 6/28/21; 3:25:22 PM by DW" created="Mon, 28 Jun 2021 19:25:21 GMT">
<outline text="this is where the toolkit for supporting instant outlines and other stuff will go" created="Mon, 28 Jun 2021 19:25:23 GMT"/>
<outline text="may incorporate features from other packages" created="Mon, 28 Jun 2021 19:25:45 GMT"/>
<outline text="the idea is to make it easy for Node devs to support OPML in an interoperable way" created="Mon, 28 Jun 2021 19:25:52 GMT"/>
</outline>
</outline>
<outline text="package.json">
<outline text="{">
<outline text=""name": "opml","/>
<outline text=""description": "Node and browser-based JavaScript code that reads and writes OPML"," created="Fri, 02 Jul 2021 14:57:59 GMT"/>
<outline text=""author": "Dave Winer <[email protected]>","/>
<outline text=""version": "0.5.7","/>
<outline text=""license": "MIT","/>
<outline text=""repository": {">
<outline text=""type": "git","/>
<outline text=""url": "https://github.com/scripting/opmlpackage.git""/>
<outline text="},"/>
</outline>
<outline text=""files": [">
<outline text=""opmlpackage.js""/>
<outline text="],"/>
</outline>
<outline text=""main": "opmlpackage.js","/>
<outline text=""dependencies" : {">
<outline text=""request": "*","/>
<outline text=""xml2js": "*"," created="Wed, 30 Jun 2021 13:10:12 GMT"/>
<outline text=""daveutils": "*","/>
<outline text=""opmltojs": "*"" created="Mon, 08 Mar 2021 15:15:44 GMT"/>
<outline text="} "/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="opmlpackage.js" created="Mon, 08 Mar 2021 15:16:10 GMT">
<outline text="const myVersion = "0.5.7", myProductName = "opmlPackage"; " created="Mon, 03 Feb 2014 03:21:03 GMT" pgfnum="36831"/>
<outline text="const generatorForHead = "opml v" + myVersion + " (npmjs.com/package/opml)";" created="Sun, 20 Aug 2023 14:28:22 GMT"/>
<outline text="" created="Wed, 30 Jun 2021 12:10:35 GMT"/>
<outline text="exports.parse = parse; "/>
<outline text="exports.stringify = stringify; "/>
<outline text="exports.htmlify = getOutlineHtml; "/>
<outline text="exports.markdownToOutline = markdownToOutline; //1/3/22 by DW"/>
<outline text="exports.outlineToMarkdown = outlineToMarkdown; //1/3/22 by DW"/>
<outline text="exports.expandInclude = expandInclude; //1/4/22 by DW" created="Tue, 04 Jan 2022 22:34:39 GMT"/>
<outline text="exports.visitAll = visitAll; //3/18/22 by DW" created="Tue, 04 Jan 2022 22:34:39 GMT"/>
<outline text="exports.expandIncludes = expandIncludes; //5/11/22 by DW" created="Wed, 11 May 2022 15:10:37 GMT"/>
<outline text="exports.readOutline = readOutline; //10/25/22 by DW" created="Tue, 25 Oct 2022 16:29:22 GMT"/>
<outline text="" created="Wed, 30 Jun 2021 12:12:23 GMT"/>
<outline text="const utils = require ("daveutils");" created="Sat, 20 Feb 2021 22:03:12 GMT"/>
<outline text="const opmltojs = require ("opmltojs");" created="Sat, 20 Feb 2021 22:03:12 GMT"/>
<outline text="const xml2js = require ("xml2js");"/>
<outline text="const request = require ("request");"/>
<outline text="" created="Wed, 30 Jun 2021 12:10:35 GMT"/>
<outline text="function parse (opmltext, callback) { //returns a JavaScript object with all the info in the opmltext" created="Wed, 30 Jun 2021 12:10:36 GMT">
<outline text="Changes" isComment="true">
<outline text="12/9/24; 9:21:04 AM by DW" created="Mon, 09 Dec 2024 14:21:04 GMT">
<outline text="Under some circumstances, sourcestruct in the convert routine will be undefined, so we check for it instead of crashing." created="Mon, 09 Dec 2024 14:21:05 GMT"/>
</outline>
<outline text="12/27/21; 10:06:12 AM by DW" created="Mon, 27 Dec 2021 15:06:12 GMT">
<outline text="Under some circumstances, xml2js.parseString will return a result of null. It shows up in Daytona's log. So we check for it, and if it comes up, return an error. " created="Mon, 27 Dec 2021 15:06:13 GMT"/>
</outline>
<outline text="1/18/21; 10:21:27 AM by DW">
<outline text="I created an OPML format that added a "subs" attribute to each headline that had subs. This was an error, but was still valid OPML, but it caused this code to fail, because subs was the wrong type. It is always a mistake, if it's possible that your OPML will be converted to a JS object. So I protected against it here, and don't copy an attribute called subs if it's present. It's possible that this fix could cause problems too, btw. The code is in Old School, look for saveDayInOpml. "/>
</outline>
<outline text="4/18/20; 5:43:20 PM by DW">
<outline text="Changed the callback to return the standard format, with an err first, and theOutline second. "/>
<outline text="I didn't want to break all the apps that use this as it was configured, but in the future, use this entry point not the one without the error."/>
</outline>
</outline>
<outline text="function isScalar (obj) {">
<outline text="if (typeof (obj) == "object") {">
<outline text="return (false);"/>
<outline text="}"/>
</outline>
<outline text="return (true);"/>
<outline text="}"/>
</outline>
<outline text="function addGenerator (theOpml) { //follow the example of RSS 2.0">
<outline text="try {">
<outline text="theOpml.head.generator = generatorForHead; //8/20/23 by DW"/>
<outline text="theOpml.head.generator = myProductName + " v" + myVersion;" isComment="true"/>
<outline text="}"/>
</outline>
<outline text="catch (err) {">
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function convert (sourcestruct, deststruct) {">
<outline text="if (sourcestruct !== undefined) { //12/9/24 by DW" created="Mon, 09 Dec 2024 14:20:30 GMT">
<outline text="var atts = sourcestruct ["$"];"/>
<outline text="if (atts !== undefined) {">
<outline text="for (var x in atts) {">
<outline text="if (x != "subs") { //1/18/21 by DW">
<outline text="deststruct [x] = atts [x];"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="delete sourcestruct ["$"];"/>
<outline text="}"/>
</outline>
<outline text="for (var x in sourcestruct) {">
<outline text="var obj = sourcestruct [x];"/>
<outline text="if (isScalar (obj)) {">
<outline text="deststruct [x] = obj;"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="if (x == "outline") {">
<outline text="if (deststruct.subs === undefined) {">
<outline text="deststruct.subs = new Array ();"/>
<outline text="}"/>
</outline>
<outline text="if (Array.isArray (obj)) {">
<outline text="for (var i = 0; i < obj.length; i++) {">
<outline text="var newobj = new Object ();"/>
<outline text="convert (obj [i], newobj);"/>
<outline text="deststruct.subs.push (newobj);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="var newobj = new Object ();"/>
<outline text="convert (obj, newobj);"/>
<outline text="deststruct.subs.push (newobj);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="deststruct [x] = new Object ();"/>
<outline text="convert (obj, deststruct [x]);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}" created="Mon, 09 Dec 2024 14:20:40 GMT"/>
</outline>
<outline text="}"/>
</outline>
<outline text="var options = {">
<outline text="explicitArray: false"/>
<outline text="};"/>
</outline>
<outline text="xml2js.parseString (opmltext, options, function (err, jstruct) {">
<outline text="if (err) { ">
<outline text="callback (err);"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="if (jstruct == null) { //12/27/21 by DW" created="Mon, 27 Dec 2021 15:06:51 GMT">
<outline text="let err = {message: "Internal error: xml2js.parseString returned null."};" created="Mon, 27 Dec 2021 15:07:32 GMT"/>
<outline text="callback (err);" created="Mon, 27 Dec 2021 15:07:32 GMT"/>
<outline text="}" created="Mon, 27 Dec 2021 15:07:04 GMT"/>
</outline>
<outline text="else {" created="Mon, 27 Dec 2021 15:07:06 GMT">
<outline text="var theOutline = {">
<outline text="opml: new Object ()"/>
<outline text="}"/>
</outline>
<outline text="convert (jstruct.opml, theOutline.opml);"/>
<outline text="addGenerator (theOutline.opml); //8/6/17 by DW"/>
<outline text="if (isScalar (theOutline.opml.head)) { //8/6/17 by DW">
<outline text="theOutline.opml.head = new Object ();"/>
<outline text="}"/>
</outline>
<outline text="if (isScalar (theOutline.opml.body)) { //8/6/17 by DW">
<outline text="theOutline.opml.body = new Object ();"/>
<outline text="}"/>
</outline>
<outline text="callback (undefined, theOutline);"/>
<outline text="}" created="Mon, 27 Dec 2021 15:07:08 GMT"/>
</outline>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="xml2js.parseString (opmltext, options, function (err, jstruct) {" isComment="true">
<outline text="if (err) { //4/18/20 by DW">
<outline text="callback (err);"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="var theOutline = {">
<outline text="opml: new Object ()"/>
<outline text="}"/>
</outline>
<outline text="convert (jstruct.opml, theOutline.opml);"/>
<outline text="addGenerator (theOutline.opml); //8/6/17 by DW"/>
<outline text="if (isScalar (theOutline.opml.head)) { //8/6/17 by DW">
<outline text="theOutline.opml.head = new Object ();"/>
<outline text="}"/>
</outline>
<outline text="if (isScalar (theOutline.opml.body)) { //8/6/17 by DW">
<outline text="theOutline.opml.body = new Object ();"/>
<outline text="}"/>
</outline>
<outline text="callback (undefined, theOutline);"/>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}" created="Wed, 30 Jun 2021 12:12:55 GMT"/>
</outline>
<outline text="function stringify (theOutline) { //returns the opmltext for the outline" created="Fri, 02 Jul 2021 15:17:20 GMT">
<outline text="var opmltext = opmltojs.opmlify (theOutline);" created="Thu, 17 Jun 2021 22:19:39 GMT"/>
<outline text="return (opmltext);" created="Fri, 02 Jul 2021 15:19:13 GMT"/>
<outline text="}" created="Fri, 02 Jul 2021 15:17:33 GMT"/>
</outline>
<outline text="function getOutlineHtml (theOutline) {" created="Thu, 10 Jun 2021 16:51:40 GMT">
<outline text="var htmltext = "", indentlevel = 0; //5/24/24 by DW" created="Thu, 10 Jun 2021 18:52:52 GMT"/>
<outline text="function add (s) {" created="Thu, 10 Jun 2021 18:53:04 GMT">
<outline text="htmltext += utils.filledString ("\t", indentlevel) + s + "\n"; //5/25/24 by DW" created="Thu, 10 Jun 2021 18:57:55 GMT"/>
<outline text="}" created="Thu, 10 Jun 2021 18:57:50 GMT"/>
</outline>
<outline text="function addSubsHtml (node) {" created="Thu, 10 Jun 2021 18:52:07 GMT">
<outline text="add ("<ul>"); indentlevel++;" created="Thu, 10 Jun 2021 18:54:17 GMT"/>
<outline text="node.subs.forEach (function (sub) {" created="Thu, 10 Jun 2021 18:54:17 GMT">
<outline text="add ("<li>" + sub.text + "</li>");" created="Thu, 10 Jun 2021 18:54:46 GMT"/>
<outline text="if (sub.subs !== undefined) {" created="Thu, 10 Jun 2021 18:55:12 GMT">
<outline text="addSubsHtml (sub);" created="Thu, 10 Jun 2021 18:55:37 GMT"/>
<outline text="}" created="Thu, 10 Jun 2021 18:55:21 GMT"/>
</outline>
<outline text="});" created="Thu, 10 Jun 2021 18:54:26 GMT"/>
</outline>
<outline text="add ("</ul>"); indentlevel--;" created="Thu, 10 Jun 2021 18:54:17 GMT"/>
<outline text="}" created="Thu, 10 Jun 2021 18:52:23 GMT"/>
</outline>
<outline text="addSubsHtml (theOutline.opml.body);"/>
<outline text="return (htmltext);" created="Thu, 10 Jun 2021 16:58:17 GMT"/>
<outline text="}" created="Thu, 10 Jun 2021 16:51:51 GMT"/>
</outline>
<outline text="function visitAll (theOutline, callback) {" created="Sat, 03 Jul 2021 19:33:13 GMT">
<outline text="function visitSubs (theNode) {" created="Sat, 03 Jul 2021 19:33:25 GMT">
<outline text="if (theNode.subs !== undefined) {" created="Sat, 03 Jul 2021 19:34:31 GMT">
<outline text="for (var i = 0; i < theNode.subs.length; i++) {" created="Sat, 03 Jul 2021 19:34:44 GMT">
<outline text="var theSub = theNode.subs [i];" created="Sat, 03 Jul 2021 19:36:34 GMT"/>
<outline text="if (!callback (theSub)) {" created="Sat, 03 Jul 2021 19:35:39 GMT">
<outline text="return (false);" created="Sat, 03 Jul 2021 19:35:50 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 19:35:53 GMT"/>
</outline>
<outline text="if (!visitSubs (theSub)) { //9/7/24 by DW -- see worknotes comment" created="Sat, 07 Sep 2024 14:01:41 GMT">
<outline text="return (false);" created="Sat, 03 Jul 2021 19:35:50 GMT"/>
<outline text="}" created="Sat, 07 Sep 2024 14:01:54 GMT"/>
</outline>
<outline text="}" created="Sat, 03 Jul 2021 19:35:15 GMT"/>
</outline>
<outline text="}" created="Sat, 03 Jul 2021 19:34:39 GMT"/>
</outline>
<outline text="return (true);" created="Sat, 03 Jul 2021 19:35:50 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 19:34:19 GMT"/>
</outline>
<outline text="visitSubs (theOutline.opml.body);" created="Sat, 03 Jul 2021 19:33:26 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 19:33:20 GMT"/>
</outline>
<outline text="" created="Tue, 04 Jan 2022 17:22:11 GMT"/>
<outline text="function markdownToOutline (mdtext, options) { //1/3/22 by DW" created="Mon, 03 Jan 2022 22:48:19 GMT">
<outline text="Changes" isComment="true" created="Mon, 03 Jan 2022 22:50:33 GMT">
<outline text="1/12/22; 5:17:25 PM by DW" created="Wed, 12 Jan 2022 22:17:24 GMT">
<outline text="New optional param, options. " created="Wed, 12 Jan 2022 22:17:25 GMT"/>
<outline text="options.flAddUnderscores, defaults true. " created="Wed, 12 Jan 2022 22:17:36 GMT"/>
</outline>
<outline text="1/8/22; 10:54:14 AM by DW" created="Sat, 08 Jan 2022 15:54:14 GMT">
<outline text="Any atts that show up at the beginning of a file are ignored. Previously they would cause the process to crash." created="Sat, 08 Jan 2022 15:54:14 GMT"/>
</outline>
<outline text="1/3/22; 5:50:36 PM by DW" created="Mon, 03 Jan 2022 22:50:34 GMT">
<outline text="Turn a markdown file as created by LogSeq or a compatible product " created="Mon, 03 Jan 2022 22:50:36 GMT"/>
<outline text="into an outline structure compatible with the one that is created from " created="Mon, 03 Jan 2022 23:02:44 GMT"/>
<outline text="parsing OPML text." created="Mon, 03 Jan 2022 23:02:49 GMT"/>
</outline>
</outline>
<outline text="var theOutline = {" created="Thu, 30 Dec 2021 16:10:59 GMT">
<outline text="opml: {" created="Thu, 30 Dec 2021 16:11:11 GMT">
<outline text="head: {" created="Thu, 30 Dec 2021 16:11:15 GMT">
<outline text="}," created="Thu, 30 Dec 2021 16:11:19 GMT"/>
</outline>
<outline text="body: {" created="Thu, 30 Dec 2021 16:11:20 GMT">
<outline text="subs: new Array ()" created="Thu, 30 Dec 2021 16:11:25 GMT"/>
<outline text="}" created="Thu, 30 Dec 2021 16:11:34 GMT"/>
</outline>
<outline text="}" created="Thu, 30 Dec 2021 16:11:14 GMT"/>
</outline>
<outline text="};" created="Thu, 30 Dec 2021 16:11:06 GMT"/>
</outline>
<outline text="" created="Wed, 12 Jan 2022 22:18:09 GMT"/>
<outline text="if (options === undefined) { //1/12/22 by DW" created="Wed, 12 Jan 2022 22:18:09 GMT">
<outline text="options = new Object ();" created="Wed, 12 Jan 2022 22:18:19 GMT"/>
<outline text="}" created="Wed, 12 Jan 2022 22:18:24 GMT"/>
</outline>
<outline text="if (options.flAddUnderscores === undefined) {" created="Wed, 12 Jan 2022 22:18:09 GMT">
<outline text="options.flAddUnderscores = true;" created="Wed, 12 Jan 2022 22:18:44 GMT"/>
<outline text="}" created="Wed, 12 Jan 2022 22:18:47 GMT"/>
</outline>
<outline text="" created="Wed, 12 Jan 2022 22:18:10 GMT"/>
<outline text="mdtext = mdtext.toString ();" created="Tue, 04 Jan 2022 17:56:36 GMT"/>
<outline text="var lines = mdtext.split ("\n"), lastlevel = 0, stack = new Array ();;" created="Tue, 16 Nov 2021 16:37:39 GMT"/>
<outline text="var lastnode = undefined, currentsubs = theOutline.opml.body.subs;;" created="Fri, 07 Jan 2022 18:37:43 GMT"/>
<outline text="lines.forEach (function (theLine) {" created="Thu, 30 Dec 2021 15:58:06 GMT">
<outline text="var thislevel = 0, flInsert = true;" created="Thu, 30 Dec 2021 16:06:17 GMT"/>
<outline text="while (theLine.length > 0) {" created="Thu, 30 Dec 2021 15:58:29 GMT">
<outline text="if (theLine [0] != "\t") {" created="Thu, 30 Dec 2021 16:08:12 GMT">
<outline text="break;" created="Thu, 30 Dec 2021 16:08:26 GMT"/>
<outline text="}" created="Thu, 30 Dec 2021 16:08:28 GMT"/>
</outline>
<outline text="thislevel++;" created="Thu, 30 Dec 2021 16:05:15 GMT"/>
<outline text="theLine = utils.stringDelete (theLine, 1, 1);" created="Thu, 30 Dec 2021 16:05:24 GMT"/>
<outline text="}" created="Thu, 30 Dec 2021 16:04:27 GMT"/>
</outline>
<outline text="if (utils.beginsWith (theLine, "- ")) {" created="Thu, 30 Dec 2021 16:09:06 GMT">
<outline text="theLine = utils.stringDelete (theLine, 1, 2);" created="Thu, 30 Dec 2021 16:09:51 GMT"/>
<outline text="}" created="Thu, 30 Dec 2021 16:09:23 GMT"/>
</outline>
<outline text="else { //is the line an attribute?" created="Fri, 31 Dec 2021 16:44:17 GMT">
<outline text="if (utils.stringContains (theLine, ":: ")) {" created="Fri, 31 Dec 2021 16:44:29 GMT">
<outline text="let parts = theLine.split (":: ");" created="Fri, 31 Dec 2021 16:45:34 GMT"/>
<outline text="if (lastnode !== undefined) { //1/8/22 by DW" created="Fri, 07 Jan 2022 18:40:55 GMT">
<outline text="var name = (options.flAddUnderscores) ? "_" + parts [0] : parts [0]; //1/12/22 by DW" created="Wed, 12 Jan 2022 22:18:59 GMT"/>
<outline text="lastnode [name] = parts [1];" created="Fri, 31 Dec 2021 16:47:34 GMT"/>
<outline text="}" created="Fri, 07 Jan 2022 18:41:06 GMT"/>
</outline>
<outline text="flInsert = false;" created="Fri, 31 Dec 2021 17:33:29 GMT"/>
<outline text="}" created="Fri, 31 Dec 2021 16:45:27 GMT"/>
</outline>
<outline text="}" created="Fri, 31 Dec 2021 16:44:20 GMT"/>
</outline>
<outline text="if (thislevel > lastlevel) {" created="Thu, 30 Dec 2021 16:12:26 GMT">
<outline text="stack.push (currentsubs);" created="Thu, 30 Dec 2021 16:14:31 GMT"/>
<outline text="lastnode.subs = new Array ();" created="Thu, 30 Dec 2021 16:18:53 GMT"/>
<outline text="currentsubs = lastnode.subs;" created="Thu, 30 Dec 2021 16:19:22 GMT"/>
<outline text="}" created="Thu, 30 Dec 2021 16:12:36 GMT"/>
</outline>
<outline text="else {" created="Thu, 30 Dec 2021 16:12:37 GMT">
<outline text="if (thislevel < lastlevel) {" created="Thu, 30 Dec 2021 16:12:39 GMT">
<outline text="var ctpops = lastlevel - thislevel;" created="Thu, 30 Dec 2021 16:21:00 GMT"/>
<outline text="for (var i = 1; i <= ctpops; i++) {" created="Thu, 30 Dec 2021 16:21:20 GMT">
<outline text="currentsubs = stack.pop ();" created="Thu, 30 Dec 2021 16:21:41 GMT"/>
<outline text="}" created="Thu, 30 Dec 2021 16:21:36 GMT"/>
</outline>
<outline text="}" created="Thu, 30 Dec 2021 16:12:51 GMT"/>
</outline>
<outline text="}" created="Thu, 30 Dec 2021 16:12:52 GMT"/>
</outline>
<outline text="" created="Fri, 31 Dec 2021 17:32:08 GMT"/>
<outline text="if (flInsert) {" created="Fri, 31 Dec 2021 17:36:21 GMT">
<outline text="var newnode = {" created="Thu, 30 Dec 2021 16:16:31 GMT">
<outline text="text: theLine" created="Fri, 31 Dec 2021 17:34:19 GMT"/>
<outline text="}" created="Fri, 31 Dec 2021 17:34:27 GMT"/>
</outline>
<outline text="currentsubs.push (newnode);" created="Thu, 30 Dec 2021 16:16:31 GMT"/>
<outline text="lastnode = newnode;" created="Thu, 30 Dec 2021 16:18:09 GMT"/>
<outline text="lastlevel = thislevel;" created="Thu, 30 Dec 2021 16:12:26 GMT"/>
<outline text="}" created="Fri, 31 Dec 2021 17:36:23 GMT"/>
</outline>
<outline text="});" created="Thu, 30 Dec 2021 15:58:14 GMT"/>
</outline>
<outline text="return (theOutline);" created="Mon, 03 Jan 2022 22:50:27 GMT"/>
<outline text="}" created="Mon, 03 Jan 2022 22:49:00 GMT"/>
</outline>
<outline text="function outlineToMarkdown (theOutline) { //1/3/22 by DW" created="Thu, 30 Dec 2021 19:58:44 GMT">
<outline text="Changes" isComment="true" created="Mon, 03 Jan 2022 23:02:56 GMT">
<outline text="1/3/22; 6:03:00 PM by DW" created="Mon, 03 Jan 2022 23:02:58 GMT">
<outline text="Generate markdown text from the indicated outline structure " created="Mon, 03 Jan 2022 23:03:00 GMT"/>
<outline text="that can be read by LogSeq and compatible apps. " created="Mon, 03 Jan 2022 23:03:40 GMT"/>
</outline>
</outline>
<outline text="var mdtext = "", indentlevel = 0;"/>
<outline text="function add (s) {">
<outline text="mdtext += utils.filledString ("\t", indentlevel) + s + "\n";" created="Mon, 27 Dec 2021 17:31:10 GMT"/>
<outline text="}" created="Mon, 27 Dec 2021 17:31:43 GMT"/>
</outline>
<outline text="function addAtts (atts) {" created="Sat, 13 Nov 2021 15:56:13 GMT">
<outline text="for (var x in atts) {" created="Sat, 13 Nov 2021 15:56:25 GMT">
<outline text="if ((x != "subs") && (x != "text")) {" created="Sat, 13 Nov 2021 15:56:34 GMT">
<outline text="if (utils.beginsWith (x, "_")) {" created="Fri, 31 Dec 2021 17:20:16 GMT">
<outline text="add (utils.stringDelete (x, 1, 1) + ":: " + atts [x]);" created="Sat, 13 Nov 2021 15:56:47 GMT"/>
<outline text="}" created="Fri, 31 Dec 2021 17:20:28 GMT"/>
</outline>
<outline text="}" created="Sat, 13 Nov 2021 15:56:44 GMT"/>
</outline>
<outline text="}" created="Sat, 13 Nov 2021 15:56:33 GMT"/>
</outline>
<outline text="}" created="Sat, 13 Nov 2021 15:56:22 GMT"/>
</outline>
<outline text="function dolevel (theNode) {">
<outline text="theNode.subs.forEach (function (sub) {" created="Mon, 27 Dec 2021 17:36:00 GMT">
<outline text="add ("- " + sub.text);"/>
<outline text="addAtts (sub);" created="Fri, 31 Dec 2021 16:29:32 GMT"/>
<outline text="if (sub.subs !== undefined) {" created="Fri, 31 Dec 2021 15:43:08 GMT">
<outline text="indentlevel++;"/>
<outline text="dolevel (sub);"/>
<outline text="indentlevel--;"/>
<outline text="}" created="Fri, 31 Dec 2021 15:43:15 GMT"/>
</outline>
<outline text="});" created="Mon, 27 Dec 2021 17:36:29 GMT"/>
</outline>
<outline text="}" created="Mon, 27 Dec 2021 17:34:14 GMT"/>
</outline>
<outline text="addAtts (theOutline.opml.head);" isComment="true" created="Fri, 31 Dec 2021 16:29:32 GMT"/>
<outline text="dolevel (theOutline.opml.body)"/>
<outline text="return (mdtext);" created="Fri, 31 Dec 2021 15:39:22 GMT"/>
<outline text="}" created="Thu, 30 Dec 2021 19:58:56 GMT"/>
</outline>
<outline text="" created="Tue, 04 Jan 2022 22:33:43 GMT"/>
<outline text="function httpRequest (url, callback) {">
<outline text="request (url, function (err, response, data) {">
<outline text="if (err) {" created="Sun, 08 Aug 2021 15:33:13 GMT">
<outline text="callback (err);" created="Sun, 08 Aug 2021 15:33:17 GMT"/>
<outline text="}" created="Sun, 08 Aug 2021 15:33:20 GMT"/>
</outline>
<outline text="else {" created="Sun, 08 Aug 2021 15:33:21 GMT">
<outline text="var code = response.statusCode;" created="Tue, 04 Jan 2022 22:39:15 GMT"/>
<outline text="if ((code < 200) || (code > 299)) {" created="Sun, 08 Aug 2021 15:33:23 GMT">
<outline text="const message = "The request returned a status code of " + response.statusCode + ".";" created="Sun, 08 Aug 2021 15:34:06 GMT"/>
<outline text="callback ({message});" created="Sun, 08 Aug 2021 15:34:43 GMT"/>
<outline text="}" created="Sun, 08 Aug 2021 15:33:28 GMT"/>
</outline>
<outline text="else {" created="Sun, 08 Aug 2021 15:33:29 GMT">
<outline text="callback (undefined, data) "/>
<outline text="}" created="Sun, 08 Aug 2021 15:33:31 GMT"/>
</outline>
<outline text="}" created="Sun, 08 Aug 2021 15:33:33 GMT"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function expandInclude (theNode, callback) {//1/4/22 by DW" created="Mon, 03 Jan 2022 16:42:22 GMT">
<outline text="Changes" isComment="true" created="Wed, 11 May 2022 12:52:03 GMT">
<outline text="5/11/22; 8:52:08 AM by DW" created="Wed, 11 May 2022 12:52:07 GMT">
<outline text="If the node is an include, return the body of the OPML file it points to. " created="Wed, 11 May 2022 12:52:08 GMT"/>
<outline text="If it's not an include, return the node itself." created="Wed, 11 May 2022 12:53:00 GMT"/>
<outline text="It's used in the app that converts docserver outlines to markdown for uploading to github." created="Wed, 11 May 2022 12:54:47 GMT">
<outline text="https://github.com/scripting/docServer/blob/main/markdownapp/docservertomarkdown.js#L124"/>
</outline>
</outline>
</outline>
<outline text="if ((theNode.type == "include") && (theNode.url !== undefined)) {" created="Mon, 03 Jan 2022 16:43:16 GMT">
<outline text="httpRequest (theNode.url, function (err, opmltext) {" created="Thu, 17 Jun 2021 19:56:51 GMT">
<outline text="if (err) {" created="Sun, 08 Aug 2021 15:12:18 GMT">
<outline text="callback (err);" created="Sun, 08 Aug 2021 15:14:05 GMT"/>
<outline text="}" created="Sun, 08 Aug 2021 15:14:10 GMT"/>
</outline>
<outline text="else {" created="Sun, 08 Aug 2021 15:12:29 GMT">
<outline text="parse (opmltext, function (err, theOutline) {">
<outline text="if (err) {">
<outline text="callback (err);" created="Sun, 08 Aug 2021 15:14:05 GMT"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="callback (undefined, theOutline.opml.body);" created="Mon, 03 Jan 2022 16:44:53 GMT"/>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}" created="Sun, 08 Aug 2021 15:12:31 GMT"/>
</outline>
<outline text="})" created="Thu, 17 Jun 2021 19:58:33 GMT"/>
</outline>
<outline text="}" created="Mon, 03 Jan 2022 16:43:45 GMT"/>
</outline>
<outline text="else {" created="Mon, 03 Jan 2022 16:44:01 GMT">
<outline text="callback (undefined, theNode);" created="Mon, 03 Jan 2022 16:44:04 GMT"/>
<outline text="}" created="Mon, 03 Jan 2022 16:44:12 GMT"/>
</outline>
<outline text="}" created="Mon, 03 Jan 2022 16:42:34 GMT"/>
</outline>
<outline text="function expandIncludes (theOutline, callback) { //5/11/22 by DW" created="Wed, 11 May 2022 14:19:47 GMT">
<outline text="function expandBody (theBody, callback) {" created="Wed, 11 May 2022 14:20:02 GMT">
<outline text="var theNewBody = new Object (), lastNewNode = theNewBody, stack = new Array (), currentOutline;"/>
<outline text="function getNameAtt (theNode) {">
<outline text="var nameatt = theNode.name;"/>
<outline text="if (nameatt === undefined) {">
<outline text="nameatt = utils.innerCaseName (theNode.text);"/>
<outline text="}"/>
</outline>
<outline text="return (nameatt);"/>
<outline text="}"/>
</outline>
<outline text="function inlevelcallback () {">
<outline text="stack [stack.length] = currentOutline;"/>
<outline text="currentOutline = lastNewNode;"/>
<outline text="if (currentOutline.subs === undefined) {">
<outline text="currentOutline.subs = new Array ();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function nodecallback (theNode, path) {">
<outline text="var newNode = new Object ();"/>
<outline text="utils.copyScalars (theNode, newNode);"/>
<outline text="currentOutline.subs [currentOutline.subs.length] = newNode;"/>
<outline text="lastNewNode = newNode;"/>
<outline text="}"/>
</outline>
<outline text="function outlevelcallback () {">
<outline text="currentOutline = stack [stack.length - 1];"/>
<outline text="stack.length--; //pop the stack"/>
<outline text="}"/>
</outline>
<outline text="function bodyVisiter (theOutline, visitcompletecallback) {">
<outline text="function readInclude (theIncludeNode, callback) {">
<outline text="console.log ("readInclude: url == " + theIncludeNode.url);"/>
<outline text="expandInclude (theIncludeNode, function (err, theBody) {" created="Wed, 11 May 2022 14:40:22 GMT">
<outline text="if (err) {" created="Tue, 10 May 2022 21:45:56 GMT">
<outline text="callback (undefined);" created="Tue, 10 May 2022 21:46:09 GMT"/>
<outline text="}" created="Tue, 10 May 2022 21:45:59 GMT"/>
</outline>
<outline text="else {" created="Tue, 10 May 2022 21:45:59 GMT">
<outline text="expandBody (theBody, function (expandedBody) {">
<outline text="callback (expandedBody); "/>
<outline text="});"/>
</outline>
<outline text="}" created="Tue, 10 May 2022 21:46:01 GMT"/>
</outline>
<outline text="});" created="Wed, 11 May 2022 14:41:59 GMT"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function doLevel (head, path, levelcompletecallback) {">
<outline text="function doOneSub (head, ixsub) {">
<outline text="if ((head.subs !== undefined) && (ixsub < head.subs.length)) {">
<outline text="var sub = head.subs [ixsub], subpath = path + getNameAtt (sub);"/>
<outline text="if (!utils.getBoolean (sub.iscomment)) { ">
<outline text="if (sub.type == "include") {">
<outline text="nodecallback (sub, subpath);"/>
<outline text="readInclude (sub, function (theIncludedOutline) {">
<outline text="if (theIncludedOutline !== undefined) {">
<outline text="doLevel (theIncludedOutline, subpath + "/", function () { ">
<outline text="outlevelcallback ();"/>
<outline text="doOneSub (head, ixsub +1);"/>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else { //6/25/15 by DW -- don't let errors derail us">
<outline text="doOneSub (head, ixsub +1);"/>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="nodecallback (sub, subpath);"/>
<outline text="if (sub.subs !== undefined) {">
<outline text="doLevel (sub, subpath + "/", function () { ">
<outline text="outlevelcallback ();"/>
<outline text="doOneSub (head, ixsub +1);"/>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="doOneSub (head, ixsub +1);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="doOneSub (head, ixsub +1);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="levelcompletecallback ();"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="inlevelcallback ();"/>
<outline text="if (head.type == "include") {">
<outline text="readInclude (head, function (theIncludedOutline) {">
<outline text="if (theIncludedOutline !== undefined) {">
<outline text="doOneSub (theIncludedOutline, 0);"/>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="doOneSub (head, 0);"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text=""/>
<outline text="doLevel (theBody, "", function () {">
<outline text="outlevelcallback ();"/>
<outline text="visitcompletecallback ();"/>
<outline text="});"/>
</outline>
<outline text="}"/>
</outline>
<outline text=""/>
<outline text="bodyVisiter (theOutline, function () {">
<outline text="callback (theNewBody);"/>
<outline text="});"/>
</outline>
<outline text="}" created="Wed, 11 May 2022 14:20:15 GMT"/>
</outline>
<outline text="expandBody (theOutline.opml.body, function (theNewBody) {" created="Wed, 11 May 2022 14:20:02 GMT">
<outline text="var theNewOutline = {" created="Wed, 11 May 2022 14:26:29 GMT">
<outline text="opml: {" created="Wed, 11 May 2022 14:26:38 GMT">
<outline text="head: {" created="Wed, 11 May 2022 14:26:54 GMT">
<outline text="}," created="Wed, 11 May 2022 14:37:03 GMT"/>
</outline>
<outline text="body: theNewBody" created="Wed, 11 May 2022 14:26:46 GMT"/>
<outline text="}" created="Wed, 11 May 2022 14:26:42 GMT"/>
</outline>
<outline text="}" created="Wed, 11 May 2022 14:26:36 GMT"/>
</outline>
<outline text="utils.copyScalars (theOutline.opml.head, theNewOutline.opml.head);"/>
<outline text="callback (theNewOutline);" created="Wed, 11 May 2022 14:25:44 GMT"/>
<outline text="});" created="Wed, 11 May 2022 14:24:26 GMT"/>
</outline>
<outline text="}" created="Wed, 11 May 2022 14:20:00 GMT"/>
</outline>
<outline text="" created="Tue, 25 Oct 2022 16:30:15 GMT"/>
<outline text="function readOutline (urlOpmlFile, callback) { //10/25/22; 12:30:31 PM by DW -- copied from Daytona" created="Wed, 24 Nov 2021 16:02:41 GMT">
<outline text="httpRequest (urlOpmlFile, function (err, opmltext) {" created="Thu, 17 Jun 2021 19:56:51 GMT">
<outline text="if (err) {" created="Sun, 08 Aug 2021 15:12:18 GMT">
<outline text="callback (err);" created="Sun, 08 Aug 2021 15:14:05 GMT"/>
<outline text="}" created="Sun, 08 Aug 2021 15:14:10 GMT"/>
</outline>
<outline text="else {" created="Sun, 08 Aug 2021 15:12:29 GMT">
<outline text="parse (opmltext, function (err, theOutline) {">
<outline text="if (err) {">
<outline text="callback (err);"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="callback (undefined, theOutline);" created="Mon, 09 Aug 2021 16:19:53 GMT"/>
<outline text="}"/>
</outline>
<outline text="});"/>
</outline>
<outline text="}" created="Sun, 08 Aug 2021 15:12:31 GMT"/>
</outline>
<outline text="})" created="Thu, 17 Jun 2021 19:58:33 GMT"/>
</outline>
<outline text="}" created="Wed, 24 Nov 2021 16:02:54 GMT"/>
</outline>
</outline>
<outline text="" created="Fri, 02 Jul 2021 21:15:05 GMT"/>
<outline text="examples/markdown/package.json" created="Tue, 04 Jan 2022 16:40:44 GMT">
<outline text="{">
<outline text=""name": "test","/>
<outline text=""description": "Test reading and writing markdown/outline files."," created="Fri, 02 Jul 2021 14:57:59 GMT"/>
<outline text=""author": "Dave Winer <[email protected]>","/>
<outline text=""version": "0.4.0","/>
<outline text=""license": "MIT","/>
<outline text=""main": "test.js","/>
<outline text=""dependencies" : {">
<outline text=""daveutils": "*","/>
<outline text=""opml": "*"" created="Mon, 08 Mar 2021 15:15:44 GMT"/>
<outline text="} "/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="examples/markdown/test.js" created="Tue, 04 Jan 2022 16:41:09 GMT">
<outline text="1/4/22; 12:08:54 PM by DW" isComment="true" created="Sat, 03 Jul 2021 19:27:01 GMT"/>
<outline text="" created="Tue, 04 Jan 2022 17:25:23 GMT"/>
<outline text="const fs = require ("fs");"/>
<outline text="const opml = require ("opml");" created="Sat, 20 Feb 2021 22:03:12 GMT"/>
<outline text="" created="Tue, 04 Jan 2022 17:18:51 GMT"/>
<outline text="fs.readFile ("states.md", function (err, mdtext) {" created="Wed, 30 Jun 2021 13:12:23 GMT">
<outline text="if (err) {" created="Sat, 03 Jul 2021 14:56:50 GMT">
<outline text="console.log (err.message);" created="Sat, 03 Jul 2021 14:56:52 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 14:57:02 GMT"/>
</outline>
<outline text="else {" created="Sat, 03 Jul 2021 14:57:03 GMT">
<outline text="var theOutline = opml.markdownToOutline (mdtext.toString ());" created="Tue, 04 Jan 2022 17:33:56 GMT"/>
<outline text="fs.writeFile ("newStates.opml", opml.stringify (theOutline), function (err) {" created="Tue, 04 Jan 2022 17:49:41 GMT">
<outline text="if (err) {" created="Tue, 04 Jan 2022 17:34:24 GMT">
<outline text="console.log ("There was an error writing states.md: " + err.message);" created="Tue, 04 Jan 2022 17:34:27 GMT"/>
<outline text="}" created="Tue, 04 Jan 2022 17:34:47 GMT"/>
</outline>
<outline text="});" created="Tue, 04 Jan 2022 17:34:22 GMT"/>
</outline>
<outline text="fs.writeFile ("newStates.md", opml.outlineToMarkdown (theOutline), function (err) {" created="Tue, 04 Jan 2022 17:49:41 GMT">
<outline text="if (err) {" created="Tue, 04 Jan 2022 17:34:24 GMT">
<outline text="console.log ("There was an error writing states.md: " + err.message);" created="Tue, 04 Jan 2022 17:34:27 GMT"/>
<outline text="}" created="Tue, 04 Jan 2022 17:34:47 GMT"/>
</outline>
<outline text="});" created="Tue, 04 Jan 2022 17:34:22 GMT"/>
</outline>
<outline text="console.log ("\nLook for newStates.md and newStates.opml in the same directory as test.js.\n");" created="Tue, 04 Jan 2022 17:29:44 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 14:57:05 GMT"/>
</outline>
<outline text="});" created="Wed, 30 Jun 2021 13:12:39 GMT"/>
</outline>
</outline>
<outline text="examples/markdown/readme.md" created="Tue, 04 Jan 2022 18:07:35 GMT">
<outline text="# Markdown/outline demo app" created="Tue, 04 Jan 2022 18:17:35 GMT">
<outline text="This app illustrates the reading and writing of outlines from an extended version of Markdown that some outliners use to exchange user structures. " created="Tue, 04 Jan 2022 18:17:47 GMT"/>
</outline>
<outline text="### The name of the format" created="Tue, 04 Jan 2022 18:18:53 GMT">
<outline text="This format doesn't appear to have a name, so we're using the name <i>markdown/outline</i> in the docs and code. " created="Tue, 04 Jan 2022 18:19:03 GMT"/>
</outline>
<outline text="### What test.js does" created="Tue, 04 Jan 2022 18:19:14 GMT">
<outline text="There's an example file, states.md, in the folder with the app. It was produced in LogSeq, an outliner that uses this format. " created="Tue, 04 Jan 2022 18:19:22 GMT"/>
<outline text="The app reads the file, then converts it to a JavaScript oijbect called theOutline, by calling opml.markdownToOutline, a routine provided by the OPML package. " created="Tue, 04 Jan 2022 18:19:54 GMT"/>
<outline text="Then it writes the structure to two files: newStates.md and newStates.opml, by calling two routines provided by the OPML package. There are no differences in the data stored in these files, the two formats are exactly equivalent. " created="Tue, 04 Jan 2022 18:06:47 GMT"/>
</outline>
<outline text="### Where to discuss" created="Tue, 04 Jan 2022 18:09:51 GMT">
<outline text="A <a href="https://github.com/scripting/drummerRFC/issues/4#issuecomment-1004429268">thread</a> on the DrummerRFC site where this work is being discussed." created="Tue, 04 Jan 2022 18:09:54 GMT"/>
</outline>
</outline>
<outline text="" created="Tue, 04 Jan 2022 17:25:15 GMT"/>
<outline text="examples/parsing/package.json" created="Wed, 30 Jun 2021 13:10:36 GMT">
<outline text="{">
<outline text=""name": "test","/>
<outline text=""description": "Test opml.parse and opml.stringify."," created="Fri, 02 Jul 2021 14:57:59 GMT"/>
<outline text=""author": "Dave Winer <[email protected]>","/>
<outline text=""version": "0.4.2","/>
<outline text=""license": "MIT","/>
<outline text=""main": "test.js","/>
<outline text=""dependencies" : {">
<outline text=""daveutils": "*","/>
<outline text=""opml": "*"" created="Mon, 08 Mar 2021 15:15:44 GMT"/>
<outline text="} "/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="examples/parsing/test.js" created="Wed, 30 Jun 2021 13:10:36 GMT">
<outline text="7/3/21; 3:27:01 PM by DW" isComment="true" created="Sat, 03 Jul 2021 19:27:01 GMT">
<outline text="Read and write an OPML file from a file." created="Sat, 03 Jul 2021 19:27:51 GMT"/>
<outline text="Also display:" created="Sat, 03 Jul 2021 15:29:57 GMT">
<outline text="The outline's title from the head section and " created="Sat, 03 Jul 2021 15:34:45 GMT"/>
<outline text="The text of the third child of the second top level subhead of the United States." created="Sat, 03 Jul 2021 15:34:54 GMT"/>
<outline text="Illustrates how you get data from the compiled structure." created="Sat, 03 Jul 2021 15:31:45 GMT"/>
<outline text="Once you've compiled the OPML, you process it as a JavaScript object." created="Sat, 03 Jul 2021 15:35:25 GMT"/>
<outline text="When you're done, you can serialize it with opml.stringify. " created="Sat, 03 Jul 2021 15:35:47 GMT"/>
<outline text="By design, works like JSON, so every JS programmer should find this familiar. " created="Sat, 03 Jul 2021 15:36:02 GMT"/>
</outline>
<outline text="Visit every node in the outline, and convert the text to upper case." created="Sat, 03 Jul 2021 19:31:33 GMT">
<outline text="Display OPML text of the uppercased outline in the console." created="Sat, 03 Jul 2021 19:47:39 GMT"/>
</outline>
</outline>
<outline text="" created="Sat, 03 Jul 2021 15:23:53 GMT"/>
<outline text="const fs = require ("fs");"/>
<outline text="const opml = require ("opml");" created="Sat, 20 Feb 2021 22:03:12 GMT"/>
<outline text="" created="Wed, 30 Jun 2021 13:12:19 GMT"/>
<outline text="fs.readFile ("states.opml", function (err, opmltext) {" created="Wed, 30 Jun 2021 13:12:23 GMT">
<outline text="if (err) {" created="Sat, 03 Jul 2021 14:56:50 GMT">
<outline text="console.log (err.message);" created="Sat, 03 Jul 2021 14:56:52 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 14:57:02 GMT"/>
</outline>
<outline text="else {" created="Sat, 03 Jul 2021 14:57:03 GMT">
<outline text="opml.parse (opmltext, function (err, theOutline) { //convert OPML text into a JavaScript structure" created="Wed, 30 Jun 2021 13:16:34 GMT">
<outline text="console.log ("\nThe outline's title is \"" + theOutline.opml.head.title + ".\""); //see comment at top" created="Sat, 03 Jul 2021 15:30:30 GMT"/>
<outline text="console.log ("The third state in the Great Plains is: \"" + theOutline.opml.body.subs [0].subs [1].subs [2].text + ".\"");" created="Sat, 03 Jul 2021 15:30:30 GMT"/>
<outline text="fs.writeFile ("states.json", JSON.stringify (theOutline, undefined, 4), function (err) {" created="Sat, 03 Jul 2021 15:24:06 GMT">
<outline text="if (err) {" created="Sat, 03 Jul 2021 15:24:43 GMT">
<outline text="console.log (err.message);" created="Sat, 03 Jul 2021 15:24:45 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 15:24:49 GMT"/>
</outline>
<outline text="else {" created="Sat, 03 Jul 2021 15:40:08 GMT">
<outline text="console.log ("states.json was saved.");" created="Sat, 03 Jul 2021 15:40:15 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 15:40:30 GMT"/>
</outline>
<outline text="});" created="Sat, 03 Jul 2021 15:24:38 GMT"/>
</outline>
<outline text="fs.writeFile ("statescopy.opml", opml.stringify (theOutline), function (err) {" created="Sat, 03 Jul 2021 15:24:06 GMT">
<outline text="if (err) {" created="Sat, 03 Jul 2021 15:24:43 GMT">
<outline text="console.log (err.message);" created="Sat, 03 Jul 2021 15:24:45 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 15:24:49 GMT"/>
</outline>
<outline text="else {" created="Sat, 03 Jul 2021 15:40:08 GMT">
<outline text="console.log ("statescopy.opml was saved.");" created="Sat, 03 Jul 2021 15:40:15 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 15:40:30 GMT"/>
</outline>
<outline text="});" created="Sat, 03 Jul 2021 15:24:38 GMT"/>
</outline>
<outline text="opml.visitAll (theOutline, function (node) {" created="Sat, 03 Jul 2021 19:31:57 GMT">
<outline text="node.text = node.text.toUpperCase ();" created="Sat, 03 Jul 2021 19:32:24 GMT"/>
<outline text="return (true); //keep visiting" created="Sat, 03 Jul 2021 19:32:47 GMT"/>
<outline text="});" created="Sat, 03 Jul 2021 19:32:16 GMT"/>
</outline>
<outline text="console.log (opml.stringify (theOutline)); //view the uppercased outline in the JS console" created="Sat, 03 Jul 2021 19:38:29 GMT"/>
<outline text="});" created="Wed, 30 Jun 2021 13:16:57 GMT"/>
</outline>
<outline text="}" created="Sat, 03 Jul 2021 14:57:05 GMT"/>
</outline>
<outline text="});" created="Wed, 30 Jun 2021 13:12:39 GMT"/>
</outline>
</outline>
<outline text="" created="Wed, 11 May 2022 20:58:54 GMT"/>
<outline text="examples/includes/package.json" created="Wed, 11 May 2022 20:58:54 GMT">
<outline text="{">
<outline text=""name": "test","/>
<outline text=""description": "Test opml.expandIncludes."," created="Fri, 02 Jul 2021 14:57:59 GMT"/>
<outline text=""author": "Dave Winer <[email protected]>","/>
<outline text=""version": "0.4.0","/>
<outline text=""license": "MIT","/>
<outline text=""main": "test.js","/>
<outline text=""dependencies" : {">
<outline text=""opml": "*"" created="Mon, 08 Mar 2021 15:15:44 GMT"/>
<outline text="} "/>
</outline>
<outline text="}"/>
</outline>
</outline>
<outline text="examples/includes/test.js" created="Wed, 30 Jun 2021 13:10:36 GMT">
<outline text="5/11/22; 4:59:24 PM by DW" isComment="true" created="Sat, 03 Jul 2021 19:27:01 GMT">
<outline text="Read an OPML file that has includes." created="Sat, 03 Jul 2021 19:27:51 GMT"/>
<outline text="Pass it through opml.expandIncludes." created="Wed, 11 May 2022 20:59:42 GMT"/>
<outline text="Display the resulting outline, with the includes expanded. " created="Wed, 11 May 2022 21:00:00 GMT"/>
</outline>
<outline text="" created="Sat, 03 Jul 2021 15:23:53 GMT"/>
<outline text="const fs = require ("fs");"/>
<outline text="const opml = require ("opml");" created="Sat, 20 Feb 2021 22:03:12 GMT"/>
<outline text="" created="Wed, 30 Jun 2021 13:12:19 GMT"/>
<outline text="fs.readFile ("includes.opml", function (err, opmltext) {" created="Wed, 30 Jun 2021 13:12:23 GMT">
<outline text="if (err) {" created="Sat, 03 Jul 2021 14:56:50 GMT">
<outline text="console.log (err.message);" created="Sat, 03 Jul 2021 14:56:52 GMT"/>
<outline text="}" created="Sat, 03 Jul 2021 14:57:02 GMT"/>
</outline>
<outline text="else {" created="Sat, 03 Jul 2021 14:57:03 GMT">
<outline text="opml.parse (opmltext, function (err, theOutline) { //convert OPML text into a JavaScript structure" created="Wed, 30 Jun 2021 13:16:34 GMT">
<outline text="opml.expandIncludes (theOutline, function (theNewOutline) {" created="Wed, 11 May 2022 21:00:45 GMT">
<outline text="console.log (JSON.stringify (theNewOutline, undefined, 4));" created="Wed, 11 May 2022 21:01:15 GMT"/>
<outline text="});" created="Wed, 11 May 2022 21:01:00 GMT"/>
</outline>
<outline text="});" created="Wed, 30 Jun 2021 13:16:57 GMT"/>
</outline>
<outline text="}" created="Sat, 03 Jul 2021 14:57:05 GMT"/>
</outline>
<outline text="});" created="Wed, 30 Jun 2021 13:12:39 GMT"/>
</outline>
</outline>
<outline text="examples/includes/includes.opml">
<outline text="Colors" created="Wed, 11 May 2022 21:02:19 GMT" name="colors" type="include" url="http://scripting.com/publicfolder/misc/inclusionDemo/colors.opml"/>
<outline text="Kids names" created="Wed, 11 May 2022 21:03:38 GMT" name="kidsNames" type="include" url="http://scripting.com/publicfolder/misc/inclusionDemo/names.opml"/>
<outline text="Veggies" created="Wed, 11 May 2022 21:03:42 GMT" type="include" url="http://scripting.com/publicfolder/misc/inclusionDemo/veggies.opml"/>
</outline>
<outline text="" created="Fri, 02 Jul 2021 15:25:02 GMT"/>
<outline text="client/opml.js" created="Fri, 02 Jul 2021 15:25:02 GMT">
<outline text="const opml = {" created="Sat, 03 Jul 2021 19:19:58 GMT">
<outline text="parse: opmlParse," created="Sat, 03 Jul 2021 19:20:11 GMT"/>
<outline text="stringify: opmlStringify," created="Sat, 03 Jul 2021 19:20:14 GMT"/>
<outline text="htmlify: getOutlineHtml," created="Sat, 03 Jul 2021 19:20:56 GMT"/>
<outline text="read: readOutline, //9/24/21 by DW" created="Fri, 24 Sep 2021 17:50:49 GMT"/>
<outline text="visitAll: visitAll," created="Sat, 03 Jul 2021 19:33:05 GMT"/>
<outline text="markdownToOutline, //1/3/22 by DW" created="Mon, 03 Jan 2022 22:57:24 GMT"/>
<outline text="outlineToMarkdown //1/3/22 by DW" created="Mon, 03 Jan 2022 22:57:28 GMT"/>
<outline text="};" created="Sat, 03 Jul 2021 19:20:04 GMT"/>
</outline>
<outline text="" created="Sat, 03 Jul 2021 19:19:58 GMT"/>
<outline text="function filledString (ch, ct) { //6/4/14 by DW">
<outline text="var s = "";"/>
<outline text="for (var i = 0; i < ct; i++) {">
<outline text="s += ch;"/>
<outline text="}"/>
</outline>
<outline text="return (s);"/>
<outline text="}"/>
</outline>
<outline text="function encodeXml (s) { //7/15/14 by DW">
<outline text="Changes" isComment="true">
<outline text="12/14/15; 4:28:14 PM by DW">
<outline text="Check for undefined, return empty string."/>
</outline>
</outline>
<outline text="if (s === undefined) {">
<outline text="return ("");"/>
<outline text="}"/>
</outline>
<outline text="else {">
<outline text="var charMap = {" collapse="true">
<outline text="'<': '&lt;',"/>
<outline text="'>': '&gt;',"/>
<outline text="'&': '&amp;',"/>
<outline text="'"': '&'+'quot;'"/>
<outline text="};"/>
</outline>
<outline text="s = s.toString();" created="Sat, 13 Apr 2013 20:25:04 GMT" pgfnum="1662"/>
<outline text="s = s.replace(/\u00A0/g, " ");" created="Fri, 12 Apr 2013 21:27:40 GMT" pgfnum="1632"/>
<outline text="var escaped = s.replace(/[<>&"]/g, function(ch) {" collapse="true">
<outline text="return charMap [ch];"/>
<outline text="});"/>
</outline>
<outline text="return escaped;" created="Thu, 07 Feb 2013 04:53:23 GMT" pgfnum="129"/>
<outline text="}"/>
</outline>
<outline text="}"/>
</outline>
<outline text="function xmlCompile (xmltext) { //3/27/17 by DW">
<outline text="return ($($.parseXML (xmltext)));"/>
<outline text="}"/>
</outline>
<outline text="function xmlGatherAttributes (adrx, theTable) {" created="Tue, 05 Nov 2013 16:59:40 GMT" pgfnum="30862">
<outline text="if (adrx.attributes != undefined) {" created="Tue, 05 Nov 2013 15:02:55 GMT" pgfnum="30828">
<outline text="for (var i = 0; i < adrx.attributes.length; i++) {">
<outline text="var att = adrx.attributes [i];"/>
<outline text="if (att.specified) {">
<outline text="theTable [att.name] = att.value;" created="Tue, 05 Nov 2013 14:45:42 GMT" pgfnum="30820"/>
<outline text="}" created="Tue, 05 Nov 2013 14:47:36 GMT" pgfnum="30822"/>
</outline>
<outline text="}"/>
</outline>
<outline text="}" created="Tue, 05 Nov 2013 15:03:05 GMT" pgfnum="30829"/>
</outline>
<outline text="}" created="Tue, 05 Nov 2013 16:59:47 GMT" pgfnum="30864"/>
</outline>
<outline text="function xmlGetAttribute (adrx, name) {" created="Thu, 31 Oct 2013 17:06:52 GMT" pgfnum="30697">
<outline text="return ($(adrx).attr (name));" created="Thu, 31 Oct 2013 17:07:16 GMT" pgfnum="30699"/>
<outline text="}" created="Thu, 31 Oct 2013 17:07:04 GMT" pgfnum="30698"/>
</outline>
<outline text="function xmlGetAddress (adrx, name) {" created="Wed, 30 Oct 2013 17:20:32 GMT" pgfnum="30666">
<outline text="return (adrx.find (name));" created="Wed, 30 Oct 2013 17:53:45 GMT" pgfnum="30676"/>
<outline text="}" created="Wed, 30 Oct 2013 17:52:35 GMT" pgfnum="30675"/>
</outline>
<outline text="function xmlGetSubValues (adrx) { //10/12/16 by DW">
<outline text="Changes" isComment="true">
<outline text="10/12/16; 11:25:15 AM by DW">