Skip to content

Commit ff057d2

Browse files
authored
Docs: Add @PageColor to the customization guide (#691)
1 parent 353fc45 commit ff057d2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Sources/SwiftDocC/Semantics/Metadata/Metadata.swift

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Markdown
2323
/// - ``TechnologyRoot``
2424
/// - ``DisplayName``
2525
/// - ``PageImage``
26+
/// - ``PageColor``
2627
/// - ``CallToAction``
2728
/// - ``Availability``
2829
/// - ``PageKind``

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ of a green hue.
7979

8080
As a general rule, the default color properties provided by DocC assumes a
8181
naming convention where "fill" colors are used for backgrounds and "figure"
82-
colors are used for foreground colors, like text.
82+
colors are used for foreground colors, like text. Note that colors defined in
83+
`theme-settings.json` will be used across all pages of your documentation bundle.
8384

8485
> Tip:
8586
> For a more complete example of a fully customized documentation website, you
@@ -239,6 +240,16 @@ be added as necessary for other features.
239240
}
240241
```
241242

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+
242253
[1]: https://github.com/apple/swift-docc/blob/main/Sources/SwiftDocC/SwiftDocC.docc/Resources/ThemeSettings.spec.json
243254
[2]: https://drafts.csswg.org/css-variables/
244255
[3]: https://mportiz08.github.io/swift-docc/documentation/docc

0 commit comments

Comments
 (0)