Skip to content
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

Docs: Add @PageColor to the customization guide #691

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Sources/SwiftDocC/Semantics/Metadata/Metadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Markdown
/// - ``TechnologyRoot``
/// - ``DisplayName``
/// - ``PageImage``
/// - ``PageColor``
/// - ``CallToAction``
/// - ``Availability``
/// - ``PageKind``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ of a green hue.

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

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

### Customizing the appearance of specific pages

Aside from the customizations available via `theme-settings.json`, Swift DocC
provides several <doc:Metadata> directives that allow you to customize just
one specific Article page.

Most notably:
- ``PageImage`` allows you to set a header image of a page.
- ``PageColor`` allows you to set an accent color of a page.

[1]: https://github.com/apple/swift-docc/blob/main/Sources/SwiftDocC/SwiftDocC.docc/Resources/ThemeSettings.spec.json
[2]: https://drafts.csswg.org/css-variables/
[3]: https://mportiz08.github.io/swift-docc/documentation/docc
Expand Down