allow multi-line in par_notes; format doctests
All checks were successful
CI/CD Pipeline / test (push) Successful in 3m11s

This commit is contained in:
2024-10-17 18:21:46 +02:00
parent fe1b80eb9a
commit 46b65ec150
16 changed files with 206 additions and 195 deletions

View File

@ -305,7 +305,10 @@ impl Builder {
/// # Examples
///
/// ```
/// use risp::{Config, law::{Law, Heading}};
/// use risp::{
/// law::{Heading, Law},
/// Config,
/// };
/// use std::path::Path;
///
/// let (_, _, _, mut builder, _) = Config::load(Path::new("data/configs/abgb.toml")).unwrap();
@ -398,7 +401,10 @@ impl Builder {
///
/// # Examples
/// ```
/// use risp::{Config, law::{Law, Heading}};
/// use risp::{
/// law::{Heading, Law},
/// Config,
/// };
/// use std::path::Path;
///
/// let (_, _, _, mut builder, _) = Config::load(Path::new("data/configs/abgb.toml")).unwrap();
@ -457,7 +463,10 @@ impl Builder {
/// Assuming `law` is a mutable reference to an instance of a law struct:
///
/// ```
/// use risp::{Config, law::{Law, Heading, Content, HeadingContent, Section}};
/// use risp::{
/// law::{Content, Heading, HeadingContent, Law, Section},
/// Config,
/// };
/// use std::path::Path;
///
/// let (_, _, _, mut builder, _) = Config::load(Path::new("data/configs/abgb.toml")).unwrap();
@ -524,7 +533,10 @@ impl Builder {
pub fn add_next_para_note(&mut self, content: String) {
#[cfg(test)]
self.history.push(format!("New_para_note: {content}"));
self.history.push(format!(
"New_para_note: {}",
serde_json::to_string(&content).unwrap()
));
self.next_para_note = Some(content);
}
@ -632,8 +644,8 @@ pub(crate) type ClassifierApplicable = Arc<dyn Fn(&str, &str) -> bool>;
/// # Examples
///
/// ```
/// use std::{sync::Arc, rc::Rc, cell::RefCell};
/// use risp::law::Classifier;
/// use std::{cell::RefCell, rc::Rc, sync::Arc};
///
/// fn starts_with(classifier_name: &str, title: &str) -> bool {
/// title.starts_with(classifier_name)