diff options
author | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-02-17 08:22:05 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-02-17 08:22:05 +0000 |
commit | 4b9edb354297353cbbe38575553ca1351f68d380 (patch) | |
tree | ac806e288bcef6288bc0f03d2216c635dfaead90 /src/style.rs | |
parent | 337c6dd6cd4075f8352e8729d1decc9c0002a845 (diff) | |
parent | 034140273c9c2c310c8231991819a9a5107ba27a (diff) | |
download | subplot-4b9edb354297353cbbe38575553ca1351f68d380.tar.gz |
Merge branch 'examples2' into 'main'
refactor: make Style have methods for querying, setting fields
See merge request larswirzenius/subplot!138
Diffstat (limited to 'src/style.rs')
-rw-r--r-- | src/style.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/style.rs b/src/style.rs index de8adab..95f1109 100644 --- a/src/style.rs +++ b/src/style.rs @@ -4,10 +4,24 @@ /// syntax tree is modified during typesetting. #[derive(Clone, Debug, Default)] pub struct Style { + links_as_notes: bool, +} + +impl Style { /// Should hyperlinks in the document be rendered as footnotes or endnotes? /// /// A link is like the HTML `<a>` element. The choice of footnote /// versus endnote is made by the typesetting backend. HTML uses /// endnotes, PDF uses footnotes. - pub links_as_notes: bool, + pub fn links_as_notes(&self) -> bool { + self.links_as_notes + } + + /// Make links be typeset as notes. + /// + /// Default is that they are typeset as links. This can't be + /// unset. + pub fn typeset_links_as_notes(&mut self) { + self.links_as_notes = true + } } |