summaryrefslogtreecommitdiff
path: root/src/model/content.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-06-08 19:31:07 +0200
committerGitHub <noreply@github.com>2022-06-08 19:31:07 +0200
commitcd5a14bc240b21f8f538ff7fc1d116d23611d6c5 (patch)
treef4b8a7e8a941f8653d5061d2f7acc0bfd8d92b13 /src/model/content.rs
parentb905048d4bb497252028df6d21b525fefb6b64c3 (diff)
parent72d3f3fffabe6872eb7839585bea925b89aac6a4 (diff)
Merge pull request #75 from typst/semantics
Frame Role and PDF outline
Diffstat (limited to 'src/model/content.rs')
-rw-r--r--src/model/content.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/model/content.rs b/src/model/content.rs
index 21bf8369..3e27c02f 100644
--- a/src/model/content.rs
+++ b/src/model/content.rs
@@ -204,6 +204,11 @@ impl Content {
Self::Styled(Arc::new((self, styles)))
}
+ /// Assign a role to this content by adding a style map.
+ pub fn role(self, role: Role) -> Self {
+ self.styled_with_entry(StyleEntry::Role(role))
+ }
+
/// Reenable the show rule identified by the selector.
pub fn unguard(&self, sel: Selector) -> Self {
self.clone().styled_with_entry(StyleEntry::Unguard(sel))