-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix links to dependencies #524
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"fruities": { | ||
"uri": "package://localhost:0/[email protected]", | ||
"checksums": { | ||
"sha256": "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2" | ||
"sha256": "8ff80e5ac882650e817f261c8af024bf0db9b07888c9d18c20017457e04ffe06" | ||
} | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
"sha256": "$computedChecksum" | ||
}, | ||
"sourceCode": "https://example.com/fruit", | ||
"documentation": "https://example.com/fruit-docs", | ||
"license": "UNLICENSED", | ||
"authors": [ | ||
"[email protected]", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
"sha256": "$computedChecksum" | ||
}, | ||
"sourceCode": "https://example.com/fruit", | ||
"documentation": "https://example.com/fruit-docs", | ||
"license": "UNLICENSED", | ||
"authors": [ | ||
"[email protected]", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ examples { | |
import("package://localhost:0/[email protected]#/catalog/Ostritch.pkl") | ||
} | ||
["importing while specifying checksum"] { | ||
import("package://localhost:0/[email protected]::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Swallow.pkl") | ||
import("package://localhost:0/[email protected]::sha256:c90e62ac513c93bd5850e21d669dbc70afd267ab7b6c7aff77ab4e0111c5b723#/catalog/Swallow.pkl") | ||
} | ||
["reads"] { | ||
read("package://localhost:0/[email protected]#/Bird.pkl") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,6 @@ examples { | |
import("package://localhost:0/[email protected]#/allFruit.pkl").fruitFiles | ||
} | ||
["glob import while specifying checksum"] { | ||
import*("package://localhost:0/[email protected]::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/*.pkl") | ||
import*("package://localhost:0/[email protected]::sha256:c90e62ac513c93bd5850e21d669dbc70afd267ab7b6c7aff77ab4e0111c5b723#/catalog/*.pkl") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"type": "remote", | ||
"uri": "projectpackage://localhost:0/[email protected]", | ||
"checksums": { | ||
"sha256": "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2" | ||
"sha256": "8ff80e5ac882650e817f261c8af024bf0db9b07888c9d18c20017457e04ffe06" | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,13 +118,13 @@ examples { | |
} | ||
["glob import while specifying checksum"] { | ||
new { | ||
["package://localhost:0/[email protected]::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Ostritch.pkl"] { | ||
["package://localhost:0/[email protected]::sha256:c90e62ac513c93bd5850e21d669dbc70afd267ab7b6c7aff77ab4e0111c5b723#/catalog/Ostritch.pkl"] { | ||
name = "Ostritch" | ||
favoriteFruit { | ||
name = "Orange" | ||
} | ||
} | ||
["package://localhost:0/[email protected]::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Swallow.pkl"] { | ||
["package://localhost:0/[email protected]::sha256:c90e62ac513c93bd5850e21d669dbc70afd267ab7b6c7aff77ab4e0111c5b723#/catalog/Swallow.pkl"] { | ||
name = "Swallow" | ||
favoriteFruit { | ||
name = "Apple" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -525,15 +525,30 @@ internal abstract class PageGenerator<out S>( | |
var first = true | ||
for (dep in dependencies) { | ||
if (first) first = false else +", " | ||
a { | ||
href = | ||
dep.documentation?.toString() | ||
?: pageScope.relativeSiteUrl | ||
.resolve("${dep.name}/${dep.version}/index.html") | ||
.toString() | ||
+dep.name | ||
+":" | ||
+dep.version | ||
val text = "${dep.name}:${dep.version}" | ||
if (dep.documentation != null) { | ||
a { | ||
href = dep.documentation.toString() | ||
+text | ||
} | ||
} else { | ||
val localSitePackage = | ||
pageScope.siteScope?.packageScopes?.values?.find { | ||
it.docPackageInfo.name == dep.name | ||
} | ||
if (localSitePackage != null) { | ||
a { | ||
href = | ||
pageScope.relativeSiteUrl | ||
.resolve( | ||
"${localSitePackage.docPackageInfo.name.pathEncoded}/current/index.html" | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will only show a local link if the package is known to Pkldoc, and it will link to "current" rather than the depended upon version. If the package is not known, and we don't know what its documentation URL is, this will just display plain text. Note: I considered making this link directly to the version, e.g. However, we don't know if that version exists in the doc site. The page generator doesn't know about all the versions of each package, and we don't build this index until after the static HTML has been built. |
||
.toString() | ||
+text | ||
} | ||
} else { | ||
+text | ||
} | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0"},"sourceCode":"https://example.com/birds","sourceCodeUrlScheme":"https://example.com/birds/v0.5.0/blob%{path}#L%{line}-L%{endLine}","dependencies":[{"ref":{"pkg":"fruit","pkgUri":"package://localhost:0/[email protected]","version":"1.0.5"}},{"ref":{"pkg":"pkl","pkgUri":null,"version":"0.24.0"}}],"modules":[{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"catalog"},"moduleClass":{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"catalog","type":"ModuleClass"},"superclasses":[{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Module"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Typed"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Object"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Any"}]}},{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"allFruit"},"moduleClass":{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"allFruit","type":"ModuleClass"},"superclasses":[{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Module"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Typed"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Object"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Any"}]}},{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"Bird"},"moduleClass":{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"Bird","type":"ModuleClass"},"superclasses":[{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Module"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Typed"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Object"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Any"}],"usedTypes":[{"pkg":"fruit","pkgUri":"package://localhost:0/[email protected]","version":"1.0.5","module":"Fruit","type":"ModuleClass"}]}}]} | ||
{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0"},"sourceCode":"https://example.com/birds","sourceCodeUrlScheme":"https://example.com/birds/v0.5.0/blob%{path}#L%{line}-L%{endLine}","dependencies":[{"ref":{"pkg":"localhost:0/fruit","pkgUri":"package://localhost:0/[email protected]","version":"1.0.5"}},{"ref":{"pkg":"pkl","pkgUri":null,"version":"0.24.0"}}],"modules":[{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"catalog"},"moduleClass":{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"catalog","type":"ModuleClass"},"superclasses":[{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Module"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Typed"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Object"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Any"}]}},{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"allFruit"},"moduleClass":{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"allFruit","type":"ModuleClass"},"superclasses":[{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Module"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Typed"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Object"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Any"}]}},{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"Bird"},"moduleClass":{"ref":{"pkg":"localhost:0/birds","pkgUri":"package://localhost:0/[email protected]","version":"0.5.0","module":"Bird","type":"ModuleClass"},"superclasses":[{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Module"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Typed"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Object"},{"pkg":"pkl","pkgUri":null,"version":"0.24.0","module":"base","type":"Any"}]}}]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has a bit of a smell to it. Is the definition of
name
not adrift this way?