Use shared IDML package constants in writer

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 06:32:26 -05:00
1 parent a1ce27bd50
commit 8bf4e29ad8
3 files changed
+4 -5

No files matched your search

-1
View File
@@ -31,7 +31,6 @@ pub(crate) use item::corner_names;
#[cfg(test)]
pub(crate) use item::path_to_uri;
const PKG_NS: &str = "http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging";
const NO_PARA_ID: &str = "ParagraphStyle/$ID/[No paragraph style]";
const TOC_STYLE_ID: &str = "TOCStyle/Table of Contents";
const TOC_STYLE_NAME: &str = "Table of Contents";
+3 -3
View File
@@ -1,5 +1,5 @@
use super::common::{anchor_self, bool_s, p, uid, with_props, xref_format_self};
use super::{CHAR_BUILTINS, DOM_VERSION, Document, El, Ex, HashSet, PARA_BUILTINS, PKG_NS, escape_id, names, num};
use super::{CHAR_BUILTINS, DOM_VERSION, Document, El, Ex, HashSet, PARA_BUILTINS, escape_id, names, num};
impl<'a> Ex<'a> {
// ---------- designmap ----------
@@ -8,7 +8,7 @@ impl<'a> Ex<'a> {
let d = self.d;
let story_list: Vec<String> = d.stories.keys().map(|k| uid(k.0)).collect();
let mut root = El::new("Document")
.attr("xmlns:idPkg", PKG_NS)
.attr("xmlns:idPkg", craft_idml::PACKAGING_NS)
.attr("DOMVersion", DOM_VERSION)
.attr("Self", "d")
.attr("StoryList", story_list.join(" "))
@@ -261,7 +261,7 @@ impl<'a> Ex<'a> {
}
}
pub(super) const CONTAINER: &str = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<container version=\"1.0\" xmlns=\"urn:oasis:names:tc:opendocument:xmlns:container\">\n\t<rootfiles>\n\t\t<rootfile full-path=\"designmap.xml\" media-type=\"text/xml\"/>\n\t</rootfiles>\n</container>\n";
pub(super) const CONTAINER: &str = craft_idml::CONTAINER_XML;
/// A cross-reference format as InDesign building blocks.
fn xref_format_el(i: usize, f: &designcraft_doc::XrefFormat) -> El {
+1 -1
View File
@@ -65,7 +65,7 @@ pub use import::{Imported, import_idml, import_idml_report, import_idml_report_w
/// The IDML package mimetype (content of the first, stored `mimetype` entry).
pub const MIMETYPE: &str = craft_idml::MIMETYPE;
/// The DOM version written to every part.
pub const DOM_VERSION: &str = "16.0";
pub const DOM_VERSION: &str = craft_idml::DOM_VERSION;
#[derive(Debug, thiserror::Error)]
pub enum IdmlError {