Add shared IDML cross-reference source writer

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 09:44:59 -05:00
1 parent 1ad5f35bf0
commit 3e53d35f2c
2 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ pub use spread::{
TextWrapPreference, spreads,
};
pub use story::{
Ace, AnchoredObjectSetting, AnchoredObjectValues, CONTAINERS, Cell, CellOptions, Container, ContainerKind, ContentPart,
Ace, AnchoredObjectSetting, AnchoredObjectValues, CONTAINERS, Cell, CellOptions, Container, ContainerKind, ContentPart, CrossReferenceSource,
IndexCrossReferenceValues, IndexDocument, IndexReference, IndexTopicPath, IndexValues, PageReference, Range, SavedCrossReference,
SavedCrossReferencePart, Story, StoryAnchor, StoryPreference, Table, TableChild, TableColumn, TableLayout, TableRow, TextNode, TrackedChangeKind,
stories,
+14
View File
@@ -337,6 +337,20 @@ pub struct SavedCrossReference {
pub character_range: Option<Range>,
}
/// The IDML cross-reference source wrapper around its saved character range.
pub struct CrossReferenceSource;
impl CrossReferenceSource {
pub fn to_el(self_id: &str, applied_format: &str, name: &str, character_range: El) -> El {
El::new("CrossReferenceSource")
.with_attr("Self", self_id)
.with_attr("AppliedFormat", applied_format)
.with_attr("Name", name)
.with_attr("Hidden", "false")
.with_child(character_range)
}
}
#[derive(Clone, Debug, PartialEq)]
pub enum SavedCrossReferencePart {
Text(String),