Skip to content

Commit 2a8652d

Browse files
committed
refactor card UI things, add links to protocol conformers pages to main pages
1 parent 3e1b2ca commit 2a8652d

File tree

67 files changed

+1302
-948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1302
-948
lines changed

Assets/css/Div.More.css.map

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

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.

Assets/css/Section.Introduction.css.map

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

Sources/HTML/Encoding/HTML.ContentEncoder (ext).swift

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,52 @@
11
extension HTML.ContentEncoder
22
{
3+
/// Optionally encodes an ``HTML.OutputStreamable`` value to the stream through **multiple
4+
/// levels** of HTML tags, with optional attributes added to the **outermost** wrapper tag.
5+
///
6+
/// If the value is nil, `attributes` will not be evaluated and nothing will be encoded.
7+
/// The getter always returns nil.
38
@inlinable public
4-
subscript<Renderable>(_ tag:HTML.ContainerElement,
5-
attributes:(inout HTML.AttributeEncoder) -> () = { _ in }) -> Renderable?
9+
subscript<Renderable>(
10+
_ exterior:HTML.ContainerElement,
11+
_ interior:HTML.ContainerElement...,
12+
exterior attributes:(inout HTML.AttributeEncoder) -> () = { _ in }) -> Renderable?
613
where Renderable:HTML.OutputStreamable
714
{
8-
get
15+
get { nil }
16+
set (value)
917
{
10-
nil
18+
if let value:Renderable
19+
{
20+
self[exterior, { $0 += value ; attributes(&$0) }]
21+
{
22+
for interior:HTML.ContainerElement in interior
23+
{
24+
$0.open(interior)
25+
}
26+
27+
$0 += value
28+
29+
for interior:HTML.ContainerElement in interior.reversed()
30+
{
31+
$0.close(interior)
32+
}
33+
}
34+
}
1135
}
12-
set(value)
36+
}
37+
38+
/// Optionally encodes an ``HTML.OutputStreamable`` value to the stream through a **single**
39+
/// HTML tag, with optional attributes added to the wrapping tag.
40+
///
41+
/// If the value is nil, `attributes` will not be evaluated and nothing will be encoded.
42+
/// The getter always returns nil.
43+
@inlinable public
44+
subscript<Renderable>(tag:HTML.ContainerElement,
45+
attributes:(inout HTML.AttributeEncoder) -> () = { _ in }) -> Renderable?
46+
where Renderable:HTML.OutputStreamable
47+
{
48+
get { nil }
49+
set (value)
1350
{
1451
if let value:Renderable
1552
{
@@ -25,11 +62,8 @@ extension HTML.ContentEncoder
2562
attributes:(inout SVG.AttributeEncoder) -> () = { _ in }) -> Renderable?
2663
where Renderable:SVG.OutputStreamable
2764
{
28-
get
29-
{
30-
nil
31-
}
32-
set(value)
65+
get { nil }
66+
set (value)
3367
{
3468
if let value:Renderable
3569
{
@@ -45,11 +79,8 @@ extension HTML.ContentEncoder
4579
attributes:(inout HTML.AttributeEncoder) -> () = { _ in }) -> Renderable?
4680
where Renderable:HTML.OutputStreamable
4781
{
48-
get
49-
{
50-
nil
51-
}
52-
set(value)
82+
get { nil }
83+
set (value)
5384
{
5485
if let value:Renderable
5586
{

Sources/HTML/Encoding/SVG.ContentEncoder (ext).swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ extension SVG.ContentEncoder
55
attributes:(inout SVG.AttributeEncoder) -> () = { _ in }) -> Renderable?
66
where Renderable:SVG.OutputStreamable
77
{
8-
get
9-
{
10-
nil
11-
}
12-
set(value)
8+
get { nil }
9+
set (value)
1310
{
1411
if let value:Renderable
1512
{

0 commit comments

Comments
 (0)