Skip to content

Commit b5a4dff

Browse files
committed
add content to product pages, and generate sidebars for them
1 parent de0f7cf commit b5a4dff

19 files changed

+306
-91
lines changed

Assets/css/Main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/css/Main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/SwiftinitPages/Contexts/IdentifiablePageContext.Cache.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ extension IdentifiablePageContext.Cache where ID:VersionedPageIdentifier
4848
}
4949
extension IdentifiablePageContext.Cache where ID:VersionedPageIdentifier
5050
{
51-
subscript(article scalar:Unidoc.Scalar) -> (master:Unidoc.Vertex.Article, url:String?)?
51+
subscript(culture scalar:Unidoc.Scalar) -> (vertex:Unidoc.Vertex.Culture, url:String?)?
5252
{
5353
mutating get
5454
{
55-
if case .article(let master)? = self.vertices[scalar]
55+
if case .culture(let vertex)? = self.vertices[scalar]
5656
{
57-
(master, self.load(scalar) { Swiftinit.Docs[$0, master.shoot] })
57+
(vertex, self.load(scalar) { Swiftinit.Docs[$0, vertex.shoot] })
5858
}
5959
else
6060
{
@@ -63,13 +63,13 @@ extension IdentifiablePageContext.Cache where ID:VersionedPageIdentifier
6363
}
6464
}
6565

66-
subscript(culture scalar:Unidoc.Scalar) -> (master:Unidoc.Vertex.Culture, url:String?)?
66+
subscript(article scalar:Unidoc.Scalar) -> (vertex:Unidoc.Vertex.Article, url:String?)?
6767
{
6868
mutating get
6969
{
70-
if case .culture(let master)? = self.vertices[scalar]
70+
if case .article(let vertex)? = self.vertices[scalar]
7171
{
72-
(master, self.load(scalar) { Swiftinit.Docs[$0, master.shoot] })
72+
(vertex, self.load(scalar) { Swiftinit.Docs[$0, vertex.shoot] })
7373
}
7474
else
7575
{
@@ -78,13 +78,13 @@ extension IdentifiablePageContext.Cache where ID:VersionedPageIdentifier
7878
}
7979
}
8080

81-
subscript(decl scalar:Unidoc.Scalar) -> (master:Unidoc.Vertex.Decl, url:String?)?
81+
subscript(decl scalar:Unidoc.Scalar) -> (vertex:Unidoc.Vertex.Decl, url:String?)?
8282
{
8383
mutating get
8484
{
85-
if case .decl(let master)? = self.vertices[scalar]
85+
if case .decl(let vertex)? = self.vertices[scalar]
8686
{
87-
(master, self.load(scalar) { Swiftinit.Docs[$0, master.shoot] })
87+
(vertex, self.load(scalar) { Swiftinit.Docs[$0, vertex.shoot] })
8888
}
8989
else
9090
{

Sources/SwiftinitPages/Contexts/IdentifiablePageContext.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,19 @@ extension IdentifiablePageContext:Swiftinit.VersionedPageContext
185185
where ID:VersionedPageIdentifier
186186
{
187187
@usableFromInline internal
188-
func link(article:Unidoc.Scalar) -> HTML.Link<MarkdownBytecode.SafeView>?
188+
func link(module:Unidoc.Scalar) -> HTML.Link<Symbol.Module>?
189189
{
190-
self.cache[article: article].map
190+
self.cache[culture: module].map
191191
{
192-
.init(display: $0.headline.safe, target: $1)
192+
.init(display: $0.module.id, target: $1)
193193
}
194194
}
195195
@usableFromInline internal
196-
func link(module:Unidoc.Scalar) -> HTML.Link<Symbol.Module>?
196+
func link(article:Unidoc.Scalar) -> HTML.Link<MarkdownBytecode.SafeView>?
197197
{
198-
self.cache[culture: module].map
198+
self.cache[article: article].map
199199
{
200-
.init(display: $0.module.id, target: $1)
200+
.init(display: $0.headline.safe, target: $1)
201201
}
202202
}
203203

Sources/SwiftinitPages/Sections/AutomaticHeading.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import HTML
22

3-
enum AutomaticHeading
3+
enum AutomaticHeading:Equatable, Comparable
44
{
55
case packageTags
66

77
case packageRepository
88
case packageDependencies
99
case platformRequirements
1010
case snapshotInformation
11-
case allProducts
1211
case allModules
12+
case allProducts
13+
case allProductConstituents
1314

1415
case miscellaneous
15-
case otherProducts
1616
case otherModules
1717
case otherMembers
18+
case otherProducts
1819

1920
case seeAlso
2021

@@ -42,13 +43,14 @@ extension AutomaticHeading:Identifiable
4243
case .packageDependencies: "ss:package-dependencies"
4344
case .platformRequirements: "ss:platform-requirements"
4445
case .snapshotInformation: "ss:snapshot-information"
45-
case .allProducts: "ss:all-products"
4646
case .allModules: "ss:all-modules"
47+
case .allProducts: "ss:all-products"
48+
case .allProductConstituents: "ss:all-product-constituents"
4749

4850
case .miscellaneous: "ss:misc"
49-
case .otherProducts: "ss:other-products"
50-
case .otherModules: "ss:other-modules"
5151
case .otherMembers: "ss:other-members"
52+
case .otherModules: "ss:other-modules"
53+
case .otherProducts: "ss:other-products"
5254

5355
case .seeAlso: "ss:see-also"
5456

@@ -77,13 +79,14 @@ extension AutomaticHeading:CustomStringConvertible
7779
case .packageDependencies: "Package Dependencies"
7880
case .platformRequirements: "Platform Requirements"
7981
case .snapshotInformation: "Snapshot Information"
80-
case .allProducts: "Products"
8182
case .allModules: "Modules"
83+
case .allProducts: "Products"
84+
case .allProductConstituents: "Product Constituents"
8285

8386
case .miscellaneous: "Miscellaneous"
84-
case .otherProducts: "Other Products"
85-
case .otherModules: "Other Modules"
8687
case .otherMembers: "Other Members in Extension"
88+
case .otherModules: "Other Modules"
89+
case .otherProducts: "Other Products"
8790

8891
case .seeAlso: "See Also"
8992

0 commit comments

Comments
 (0)