Skip to content

Commit 5473f87

Browse files
authored
Merge pull request #240 from epage/docs
docs: Document more of the API
2 parents 8a794fa + 981ef5b commit 5473f87

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/renderer/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ impl Renderer {
225225
}
226226

227227
impl Renderer {
228+
/// Render a diagnostic, a series of [`Group`]s
228229
pub fn render(&self, groups: &[Group<'_>]) -> String {
229230
if self.short_message {
230231
self.render_short_message(groups).unwrap()

src/snippet.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ pub(crate) struct Id<'a> {
1818
}
1919

2020
/// An [`Element`] container
21+
///
22+
/// A [diagnostic][crate::Renderer::render] is made of several `Group`s.
23+
/// `Group`s are used to [annotate][AnnotationKind::Primary] [`Snippet`]s
24+
/// with different [semantic reasons][Title].
2125
#[derive(Clone, Debug)]
2226
pub struct Group<'a> {
2327
pub(crate) primary_level: Level<'a>,

0 commit comments

Comments
 (0)