Encode filepaths to be safe on Windows

This changes the file paths to use characters that are safe for Windows.

Channges the output of the following:
* Package cache directory
* Generated pkl-doc files
* Kotlin generated code

Unsafe characters are encoded as (<hex>).
For example, the colon character `:` is encoded as `(3a)`.

Additionally, this changes the cache directory prefix (package-1 to
package-2).

Follows the design of https://github.com/apple/pkl-evolution/pull/3
This commit is contained in:
Dan Chao
2024-04-26 07:34:31 -07:00
committed by Daniel Chao
parent 110dc89e86
commit a5c13e325a
36 changed files with 185 additions and 106 deletions

View File

@@ -114,7 +114,7 @@ age: Int
<div class="member-modifiers">package </div>
</div>
<div class="member-main">
<div class="member-signature"><a class="name-decl" href="./localhost:0/birds/current/index.html">localhost:0/birds</a></div>
<div class="member-signature"><a class="name-decl" href="./localhost(3a)0/birds/current/index.html">localhost:0/birds</a></div>
</div>
</div>
</li>
@@ -125,7 +125,7 @@ age: Int
<div class="member-modifiers">package </div>
</div>
<div class="member-main">
<div class="member-signature"><a class="name-decl" href="./localhost:0/fruit/current/index.html">localhost:0/fruit</a></div>
<div class="member-signature"><a class="name-decl" href="./localhost(3a)0/fruit/current/index.html">localhost:0/fruit</a></div>
</div>
</div>
</li>

View File

@@ -4,7 +4,7 @@
<title>Bird (localhost:0/birds:0.5.0) • Docsite Title</title>
<script src="../../../../scripts/pkldoc.js" defer="defer"></script>
<script src="../../../../scripts/scroll-into-view.min.js" defer="defer"></script>
<script src="../../../../data/localhost:0/birds/0.5.0/Bird/index.js" defer="defer"></script>
<script src="../../../../data/localhost(3a)0/birds/0.5.0/Bird/index.js" defer="defer"></script>
<link href="../../../../styles/pkldoc.css" media="screen" type="text/css" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="../../../../images/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="../../../../images/apple-touch-icon.png">

View File

@@ -4,7 +4,7 @@
<title>allFruit (localhost:0/birds:0.5.0) • Docsite Title</title>
<script src="../../../../scripts/pkldoc.js" defer="defer"></script>
<script src="../../../../scripts/scroll-into-view.min.js" defer="defer"></script>
<script src="../../../../data/localhost:0/birds/0.5.0/allFruit/index.js" defer="defer"></script>
<script src="../../../../data/localhost(3a)0/birds/0.5.0/allFruit/index.js" defer="defer"></script>
<link href="../../../../styles/pkldoc.css" media="screen" type="text/css" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="../../../../images/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="../../../../images/apple-touch-icon.png">

View File

@@ -4,7 +4,7 @@
<title>catalog (localhost:0/birds:0.5.0) • Docsite Title</title>
<script src="../../../../scripts/pkldoc.js" defer="defer"></script>
<script src="../../../../scripts/scroll-into-view.min.js" defer="defer"></script>
<script src="../../../../data/localhost:0/birds/0.5.0/catalog/index.js" defer="defer"></script>
<script src="../../../../data/localhost(3a)0/birds/0.5.0/catalog/index.js" defer="defer"></script>
<link href="../../../../styles/pkldoc.css" media="screen" type="text/css" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="../../../../images/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="../../../../images/apple-touch-icon.png">

View File

@@ -4,7 +4,7 @@
<title>localhost:0/birds (0.5.0) • Docsite Title</title>
<script src="../../../scripts/pkldoc.js" defer="defer"></script>
<script src="../../../scripts/scroll-into-view.min.js" defer="defer"></script>
<script src="../../../data/localhost:0/birds/0.5.0/index.js" defer="defer"></script>
<script src="../../../data/localhost(3a)0/birds/0.5.0/index.js" defer="defer"></script>
<link href="../../../styles/pkldoc.css" media="screen" type="text/css" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="../../../images/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="../../../images/apple-touch-icon.png">

View File

@@ -4,7 +4,7 @@
<title>Fruit (localhost:0/fruit:1.1.0) • Docsite Title</title>
<script src="../../../../scripts/pkldoc.js" defer="defer"></script>
<script src="../../../../scripts/scroll-into-view.min.js" defer="defer"></script>
<script src="../../../../data/localhost:0/fruit/1.1.0/Fruit/index.js" defer="defer"></script>
<script src="../../../../data/localhost(3a)0/fruit/1.1.0/Fruit/index.js" defer="defer"></script>
<link href="../../../../styles/pkldoc.css" media="screen" type="text/css" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="../../../../images/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="../../../../images/apple-touch-icon.png">

View File

@@ -4,7 +4,7 @@
<title>localhost:0/fruit (1.1.0) • Docsite Title</title>
<script src="../../../scripts/pkldoc.js" defer="defer"></script>
<script src="../../../scripts/scroll-into-view.min.js" defer="defer"></script>
<script src="../../../data/localhost:0/fruit/1.1.0/index.js" defer="defer"></script>
<script src="../../../data/localhost(3a)0/fruit/1.1.0/index.js" defer="defer"></script>
<link href="../../../styles/pkldoc.css" media="screen" type="text/css" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="../../../images/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="../../../images/apple-touch-icon.png">