Skip to content

Commit 51c1dd9

Browse files
committed
Reworked @pageColor documentation
1 parent ed06df9 commit 51c1dd9

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

Sources/docc/DocCDocumentation.docc/customizing-the-appearance-of-your-documentation-pages.md

+10-18
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,6 @@ naming convention where "fill" colors are used for backgrounds and "figure"
8282
colors are used for foreground colors, like text. Note that colors defined in
8383
`theme-settings.json` will be used across all pages of your documentation bundle.
8484

85-
**Changing a color on for a specific article page**
86-
87-
You can also use a ``PageColor`` metadata directive to set the fill color for an
88-
intro section of a specific article:
89-
90-
```
91-
# What's New in SlothCreator
92-
93-
@Metadata {
94-
@PageColor(blue)
95-
}
96-
97-
...
98-
```
99-
100-
`@PageColor` only supports a subset of predefined color values: `blue`,
101-
`gray`, `green`, `orange`, `purple`, `red`, `yellow`.
102-
10385
> Tip:
10486
> For a more complete example of a fully customized documentation website, you
10587
> can check out [this fork][3] of the DocC documentation that is using this
@@ -258,6 +240,16 @@ be added as necessary for other features.
258240
}
259241
```
260242

243+
### Customizing the appearance of specific pages
244+
245+
Aside from the customizations available via `theme-settings.json`, Swift DocC
246+
provides several <doc:Metadata> directives that allow you to customize just
247+
one specific Article page.
248+
249+
Most notably:
250+
- ``PageImage`` allows you to set a header image of a page.
251+
- ``PageColor`` allows you to set an accent color of a page.
252+
261253
[1]: https://github.com/apple/swift-docc/blob/main/Sources/SwiftDocC/SwiftDocC.docc/Resources/ThemeSettings.spec.json
262254
[2]: https://drafts.csswg.org/css-variables/
263255
[3]: https://mportiz08.github.io/swift-docc/documentation/docc

0 commit comments

Comments
 (0)