enable 'horizontal stack' of elements
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m55s
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m55s
This commit is contained in:
@ -458,28 +458,18 @@ impl std::fmt::Debug for Classifier {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub enum Content {
|
||||
Text(String), //This is my direct law text
|
||||
Item(Vec<Content>), //(1) This is general law. (2) This is more specific law
|
||||
List(Vec<Content>),
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Content {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Text(arg0) => f.debug_tuple("Text").field(arg0).finish(),
|
||||
Self::Item(arg0) => f.debug_tuple("Item").field(arg0).finish(),
|
||||
Self::List(arg0) => f.debug_tuple("List").field(arg0).finish(),
|
||||
}
|
||||
}
|
||||
List(Vec<Content>), //(1) This is general law. (2) This is more specific law
|
||||
Multi(Vec<Content>),
|
||||
}
|
||||
|
||||
impl Display for Content {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Text(a) => f.write_str(&format!("{a}\n")),
|
||||
Self::Item(a) | Self::List(a) => {
|
||||
Self::List(a) | Self::Multi(a) => {
|
||||
let mut ret = String::new();
|
||||
for aa in a {
|
||||
ret.push_str(&format!("{aa}"));
|
||||
@ -489,3 +479,13 @@ impl Display for Content {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Content::Item([
|
||||
// ContentPart::Multiple([
|
||||
// ContentPart::Text("(1) Behörden im Sinne...sind:")
|
||||
// ContentPart::List([
|
||||
// ContentPart::Text("1.")
|
||||
// ContentPart::Text("2.")
|
||||
// ])
|
||||
// ])
|
||||
// ])
|
||||
|
@ -66,7 +66,7 @@ impl Absatz {
|
||||
if content.len() == 1 {
|
||||
(par_id, content[0].clone())
|
||||
} else {
|
||||
(par_id, Content::List(content))
|
||||
(par_id, Content::Multi(content))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ impl Abschnitt {
|
||||
} else {
|
||||
let mut contents = Vec::new();
|
||||
contents.extend(absatze.iter().cloned());
|
||||
builder.new_par(par_id, Content::Item(contents));
|
||||
builder.new_par(par_id, Content::List(contents));
|
||||
}
|
||||
|
||||
ret.handle_metadata(&mut c, builder);
|
||||
|
Reference in New Issue
Block a user