Skip to content

Commit 5f5c65c

Browse files
committed
EOL windows fix
1 parent 38006f8 commit 5f5c65c

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

Kernel/FileFormat.wl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ BeginPackage["CoffeeLiqueur`Notebook`FileFormat`"];
33
readNotebook;
44
writeNotebook;
55

6+
endOfLine = If[$OperatingSystem === "Windows", "\r", EndOfLine];
7+
68
Begin["`Private`"];
79

810
takeKeys[nb_, keys_] := Association@Map[(# -> nb[#])&, keys]
@@ -307,7 +309,7 @@ readNotebook[stream_, timeout_:10] := Module[
307309
ReadString[
308310
file
309311
,
310-
___ ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%Notebook%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine
312+
___ ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%Notebook%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine
311313
,
312314
TimeConstraint -> timeout
313315
]
@@ -321,7 +323,7 @@ readNotebook[stream_, timeout_:10] := Module[
321323
ReadString[
322324
file
323325
,
324-
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine
326+
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine
325327
,
326328
TimeConstraint -> timeout
327329
]
@@ -339,7 +341,7 @@ readNotebook[stream_, timeout_:10] := Module[
339341
ReadString[
340342
file
341343
,
342-
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ "Cells" ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine ~~ "\n"..
344+
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ "Cells" ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine ~~ "\n"..
343345
,
344346
TimeConstraint -> timeout
345347
]
@@ -353,7 +355,7 @@ readNotebook[stream_, timeout_:10] := Module[
353355
ReadString[
354356
file
355357
,
356-
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine ~~ "\n"
358+
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine ~~ "\n"
357359
,
358360
TimeConstraint -> timeout
359361
]
@@ -376,7 +378,7 @@ readNotebook[stream_, timeout_:10] := Module[
376378
ReadString[
377379
file
378380
,
379-
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine ~~ "\n"
381+
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine ~~ "\n"
380382
,
381383
TimeConstraint -> timeout
382384
]
@@ -406,7 +408,7 @@ readNotebook[stream_, timeout_:10] := Module[
406408
ReadString[
407409
file
408410
,
409-
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ field ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine ~~ "\n"..
411+
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ field ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine ~~ "\n"..
410412
,
411413
TimeConstraint -> timeout
412414
]
@@ -420,7 +422,7 @@ readNotebook[stream_, timeout_:10] := Module[
420422
ReadString[
421423
file
422424
,
423-
(StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine ~~ "\n") | (StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%EndOf" ~~ field ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine ~~ "\n")
425+
(StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine ~~ "\n") | (StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%EndOf" ~~ field ~~ "%" ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine ~~ "\n")
424426
,
425427
TimeConstraint -> timeout
426428
]
@@ -446,7 +448,7 @@ readNotebook[stream_, timeout_:10] := Module[
446448
ReadString[
447449
file
448450
,
449-
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ EndOfLine ~~ "\n"
451+
StartOfLine ~~ "%" ~~ Repeated["-", {17, 100}] ~~ Repeated["-", {17, 100}] ~~ "%" ~~ endOfLine ~~ "\n"
450452
,
451453
TimeConstraint -> timeout
452454
]

Scripts/start.wls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ IframeApp["HTTPUHandler"->http, "Middleware"->middleware, "AppEvent"->AppExtensi
390390
App["HTTPUHandler"->http, "Middleware"->middleware, "AppEvent"->AppExtensions`AppEvents, "ExtensionTemplates"->AppExtensions`Templates, "ExtensionSidebarIcons"->AppExtensions`SidebarIcons, "Env"->$Env];
391391

392392
Needs["CoffeeLiqueur`Notebook`KernelAutolaunch`"->"kaf`", FileNameJoin[{Directory[], "Frontend", "Autolaunch.wl"}] ];
393-
kaf`autostart[LocalKernel`LocalKernel[ "Name"->RandomWord[] ], Hold[AppExtensions`KernelList], kernelUtils`initializeKernel[<|"env" -> $Env|>], kernelUtils`deinitializeKernel];
393+
kaf`autostart[LocalKernel`LocalKernel[ "Name"->Internal`NoWR`RandomWord[] ], Hold[AppExtensions`KernelList], kernelUtils`initializeKernel[<|"env" -> $Env|>], kernelUtils`deinitializeKernel];
394394

395395
SetTimeout[
396396
StringTemplate["Open http://``:`` in your browser"][$Env["host"], $Env["http"]] // Print;

0 commit comments

Comments
 (0)