diff options
Diffstat (limited to 'src/document_tree')
| -rw-r--r-- | src/document_tree/attribute_types.rs | 4 | ||||
| -rw-r--r-- | src/document_tree/elements.rs | 20 | ||||
| -rw-r--r-- | src/document_tree/extra_attributes.rs | 14 | 
3 files changed, 19 insertions, 19 deletions
| diff --git a/src/document_tree/attribute_types.rs b/src/document_tree/attribute_types.rs index b6819c7..30f3767 100644 --- a/src/document_tree/attribute_types.rs +++ b/src/document_tree/attribute_types.rs @@ -4,7 +4,7 @@ use failure::{Error,bail,format_err};  use serde_derive::Serialize;  use regex::Regex; -use crate::target; +use crate::url::Url;  #[derive(Debug,PartialEq,Eq,Hash,Serialize,Clone)]  pub enum EnumeratedListType { @@ -134,7 +134,7 @@ macro_rules! impl_cannot_be_empty {  		impl_cannot_be_empty!($($ts),*);  	};  } -impl_cannot_be_empty!(target::Target); +impl_cannot_be_empty!(Url);  impl_cannot_be_empty!(TableGroupCols);  impl<T> CanBeEmpty for Option<T> { diff --git a/src/document_tree/elements.rs b/src/document_tree/elements.rs index cefe044..f717f6a 100644 --- a/src/document_tree/elements.rs +++ b/src/document_tree/elements.rs @@ -1,6 +1,6 @@ +use std::path::PathBuf;  use serde_derive::Serialize; -use crate::target;  use super::attribute_types::{CanBeEmpty,ID,NameToken};  use super::extra_attributes::{self,ExtraAttributes};  use super::element_categories::*; @@ -20,8 +20,8 @@ pub trait Element {  	/// An element may have at most one of the names or dupnames attributes, but not both.  	fn   names    (&    self) -> &    Vec<NameToken>;  	fn   names_mut(&mut self) -> &mut Vec<NameToken>; -	fn  source    (&    self) -> &    Option<target::Target>; -	fn  source_mut(&mut self) -> &mut Option<target::Target>; +	fn  source    (&    self) -> &    Option<PathBuf>; +	fn  source_mut(&mut self) -> &mut Option<PathBuf>;  	fn classes    (&    self) -> &    Vec<String>;  	fn classes_mut(&mut self) -> &mut Vec<String>;  } @@ -33,7 +33,7 @@ pub struct CommonAttributes {  	#[serde(skip_serializing_if = "CanBeEmpty::is_empty")]  	names: Vec<NameToken>,  	#[serde(skip_serializing_if = "CanBeEmpty::is_empty")] -	source: Option<target::Target>, +	source: Option<PathBuf>,  	#[serde(skip_serializing_if = "CanBeEmpty::is_empty")]  	classes: Vec<String>,  	//TODO: dupnames @@ -45,12 +45,12 @@ pub struct CommonAttributes {  macro_rules! impl_element { ($name:ident) => (  	impl Element for $name { -		fn     ids    (&    self) -> &    Vec<ID>        { &    self.common.ids     } -		fn     ids_mut(&mut self) -> &mut Vec<ID>        { &mut self.common.ids     } -		fn   names    (&    self) -> &    Vec<NameToken> { &    self.common.names   } -		fn   names_mut(&mut self) -> &mut Vec<NameToken> { &mut self.common.names   } -		fn  source    (&    self) -> &    Option<target::Target> { &    self.common.source  } -		fn  source_mut(&mut self) -> &mut Option<target::Target> { &mut self.common.source  } +		fn     ids    (&    self) -> &    Vec<ID>         { &    self.common.ids     } +		fn     ids_mut(&mut self) -> &mut Vec<ID>         { &mut self.common.ids     } +		fn   names    (&    self) -> &    Vec<NameToken>  { &    self.common.names   } +		fn   names_mut(&mut self) -> &mut Vec<NameToken>  { &mut self.common.names   } +		fn  source    (&    self) -> &    Option<PathBuf> { &    self.common.source  } +		fn  source_mut(&mut self) -> &mut Option<PathBuf> { &mut self.common.source  }  		fn classes    (&    self) -> &    Vec<String> { &    self.common.classes }  		fn classes_mut(&mut self) -> &mut Vec<String> { &mut self.common.classes }  	} diff --git a/src/document_tree/extra_attributes.rs b/src/document_tree/extra_attributes.rs index e72b288..55896ab 100644 --- a/src/document_tree/extra_attributes.rs +++ b/src/document_tree/extra_attributes.rs @@ -1,6 +1,6 @@  use serde_derive::Serialize; -use crate::target; +use crate::url::Url;  use super::attribute_types::{CanBeEmpty,FixedSpace,ID,NameToken,AlignHV,AlignH,AlignV,TableAlignH,TableBorder,TableGroupCols,Measure,EnumeratedListType};  pub trait ExtraAttributes<A> { @@ -33,7 +33,7 @@ impl_extra!(SubstitutionDefinition { ltrim: bool, rtrim: bool });  impl_extra!(Comment { space: FixedSpace });  impl_extra!(Target {  	/// External reference to a URI/URL -	refuri: Option<target::Target>, +	refuri: Option<Url>,  	/// References to ids attributes in other elements  	refid: Option<ID>,  	/// Internal reference to the names attribute of another element. May resolve to either an internal or external reference. @@ -42,13 +42,13 @@ impl_extra!(Target {  });  impl_extra!(Raw { space: FixedSpace, format: Vec<NameToken> });  impl_extra!(#[derive(Debug,PartialEq,Serialize,Clone)] Image { -	uri: target::Target, +	uri: Url,  	align: Option<AlignHV>,  	alt: Option<String>,  	height: Option<Measure>,  	width: Option<Measure>,  	scale: Option<u8>, -	target: Option<target::Target>,  // Not part of the DTD but a valid argument +	target: Option<Url>,  // Not part of the DTD but a valid argument  });  //bools usually are XML yesorno. “auto” however either exists and is set to something random like “1” or doesn’t exist @@ -75,7 +75,7 @@ impl_extra!(OptionArgument { delimiter: Option<String> });  impl_extra!(Reference {  	name: Option<NameToken>,  //TODO: is CDATA in the DTD, so maybe no nametoken?  	/// External reference to a URI/URL -	refuri: Option<target::Target>, +	refuri: Option<Url>,  	/// References to ids attributes in other elements  	refid: Option<ID>,  	/// Internal reference to the names attribute of another element @@ -89,7 +89,7 @@ impl_extra!(Problematic { refid: Option<ID> });  //also have non-inline versions. Inline image is no figure child, inline target has content  impl_extra!(TargetInline {  	/// External reference to a URI/URL -	refuri: Option<target::Target>, +	refuri: Option<Url>,  	/// References to ids attributes in other elements  	refid: Option<ID>,  	/// Internal reference to the names attribute of another element. May resolve to either an internal or external reference. @@ -100,7 +100,7 @@ impl_extra!(RawInline { space: FixedSpace, format: Vec<NameToken> });  pub type ImageInline = Image;  impl Image { -	pub fn new(uri: target::Target) -> Image { Image { +	pub fn new(uri: Url) -> Image { Image {  		uri,  		align: None,  		alt: None, | 
