Implement a function to get the additional properties on a headline.
This commit is contained in:
parent
fb412bc2cd
commit
b385270d7b
@ -542,6 +542,10 @@ fn new_compare_heading<'b, 's>(
|
|||||||
let mut child_status = Vec::new();
|
let mut child_status = Vec::new();
|
||||||
let mut message = None;
|
let mut message = None;
|
||||||
|
|
||||||
|
let additional_property_names = rust
|
||||||
|
.get_additional_properties()
|
||||||
|
.map(|node_property| EmacsField::Required(node_property.property_name));
|
||||||
|
|
||||||
// TODO: This needs to support additional properties from the property drawer
|
// TODO: This needs to support additional properties from the property drawer
|
||||||
|
|
||||||
compare_children(
|
compare_children(
|
||||||
|
@ -2,6 +2,7 @@ use std::path::PathBuf;
|
|||||||
|
|
||||||
use super::Element;
|
use super::Element;
|
||||||
use super::GetStandardProperties;
|
use super::GetStandardProperties;
|
||||||
|
use super::NodeProperty;
|
||||||
use super::Object;
|
use super::Object;
|
||||||
use super::StandardProperties;
|
use super::StandardProperties;
|
||||||
use super::Timestamp;
|
use super::Timestamp;
|
||||||
@ -90,4 +91,23 @@ impl<'s> Heading<'s> {
|
|||||||
.collect();
|
.collect();
|
||||||
title_source
|
title_source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_additional_properties(&self) -> impl Iterator<Item = &NodeProperty<'s>> {
|
||||||
|
let foo = self
|
||||||
|
.children
|
||||||
|
.iter()
|
||||||
|
.take(1)
|
||||||
|
.filter_map(|c| match c {
|
||||||
|
DocumentElement::Section(section) => Some(section),
|
||||||
|
_ => None,
|
||||||
|
})
|
||||||
|
.flat_map(|section| section.children.iter())
|
||||||
|
.take(1)
|
||||||
|
.filter_map(|element| match element {
|
||||||
|
Element::PropertyDrawer(property_drawer) => Some(property_drawer),
|
||||||
|
_ => None,
|
||||||
|
})
|
||||||
|
.flat_map(|property_drawer| property_drawer.children.iter());
|
||||||
|
foo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user