summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-05-11 11:36:25 +0200
committerLaurenz <laurmaedje@gmail.com>2023-05-11 11:36:25 +0200
commit8ac7be95e660da3e67ac499410450793eaa18429 (patch)
treed6dc3a54747ef9d9ca445e2d705d25ca945a67e8
parent998a3c44fd79eac92c375ec9e755288bc146a279 (diff)
Documentation fixes
-rw-r--r--library/src/meta/figure.rs14
-rw-r--r--library/src/meta/reference.rs7
-rw-r--r--library/src/text/shaping.rs4
-rw-r--r--src/model/styles.rs9
4 files changed, 16 insertions, 18 deletions
diff --git a/library/src/meta/figure.rs b/library/src/meta/figure.rs
index bfbfeb83..548233c4 100644
--- a/library/src/meta/figure.rs
+++ b/library/src/meta/figure.rs
@@ -331,11 +331,8 @@ impl FigureElem {
.cloned()
}
- /// Builds the supplement and numbering of the figure.
- /// If there is no numbering, returns [`None`].
- ///
- /// # Errors
- /// If a numbering is specified but the [`Self::data()`] is `None`.
+ /// Builds the supplement and numbering of the figure. Returns [`None`] if
+ /// there is no numbering.
pub fn show_supplement_and_numbering(
&self,
vt: &mut Vt,
@@ -364,11 +361,8 @@ impl FigureElem {
}
}
- /// Builds the caption for the figure.
- /// If there is a numbering, will also try to show the supplement and the numbering.
- ///
- /// # Errors
- /// If a numbering is specified but the [`Self::element`] is `None`.
+ /// Builds the caption for the figure. If there is a numbering, will also
+ /// try to show the supplement and the numbering.
pub fn show_caption(&self, vt: &mut Vt) -> SourceResult<Content> {
let Some(mut caption) = self.caption(StyleChain::default()) else {
return Ok(Content::empty());
diff --git a/library/src/meta/reference.rs b/library/src/meta/reference.rs
index ceb1a3b2..e4b6bbec 100644
--- a/library/src/meta/reference.rs
+++ b/library/src/meta/reference.rs
@@ -245,10 +245,9 @@ cast_to_value! {
}
}
-/// Marks an element as being able to be referenced.
-/// This is used to implement the `@ref` macro.
-/// It is expected to build the [`Content`] that gets linked
-/// by the [`RefElement`].
+/// Marks an element as being able to be referenced. This is used to implement
+/// the `@ref` element. It is expected to build the [`Content`] that gets linked
+/// by the [`RefElem`].
pub trait Refable {
/// Tries to build a reference content for this element.
///
diff --git a/library/src/text/shaping.rs b/library/src/text/shaping.rs
index e670d0d1..b0be8bf6 100644
--- a/library/src/text/shaping.rs
+++ b/library/src/text/shaping.rs
@@ -90,7 +90,7 @@ impl ShapedGlyph {
matches!(self.c.script(), Hiragana | Katakana | Han) || self.c == '\u{30FC}'
}
- /// See https://www.w3.org/TR/clreq/#punctuation_width_adjustment
+ /// See <https://www.w3.org/TR/clreq/#punctuation_width_adjustment>
pub fn is_cjk_left_aligned_punctuation(&self) -> bool {
// CJK quotation marks shares codepoints with latin quotation marks.
// But only the CJK ones have full width.
@@ -101,7 +101,7 @@ impl ShapedGlyph {
matches!(self.c, ',' | '。' | '、' | ':' | ';' | '》' | ')' | '』' | '」')
}
- /// See https://www.w3.org/TR/clreq/#punctuation_width_adjustment
+ /// See <https://www.w3.org/TR/clreq/#punctuation_width_adjustment>
pub fn is_cjk_right_aligned_punctuation(&self) -> bool {
// CJK quotation marks shares codepoints with latin quotation marks.
// But only the CJK ones have full width.
diff --git a/src/model/styles.rs b/src/model/styles.rs
index 54784307..334a01b8 100644
--- a/src/model/styles.rs
+++ b/src/model/styles.rs
@@ -405,8 +405,10 @@ cast_from_value! {
location: Location => Self::Location(location),
}
-/// A selector that can be used with `query`. Hopefully, this is made obsolete
-/// by a more powerful query mechanism in the future.
+/// A selector that can be used with `query`.
+///
+/// Hopefully, this is made obsolete by a more powerful query mechanism in the
+/// future.
#[derive(Clone, PartialEq, Hash)]
pub struct LocatableSelector(pub Selector);
@@ -462,6 +464,9 @@ impl Cast for LocatableSelector {
}
/// A selector that can be used with show rules.
+///
+/// Hopefully, this is made obsolete by a more powerful showing mechanism in the
+/// future.
#[derive(Clone, PartialEq, Hash)]
pub struct ShowableSelector(pub Selector);