From 5fdb21df228c78061cce9ee910fa87da0fd99d46 Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Sat, 14 Nov 2015 20:13:45 +0100 Subject: redesign --- src/document_tree/extra_attributes.rs | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/document_tree/extra_attributes.rs (limited to 'src/document_tree/extra_attributes.rs') diff --git a/src/document_tree/extra_attributes.rs b/src/document_tree/extra_attributes.rs new file mode 100644 index 0000000..2141469 --- /dev/null +++ b/src/document_tree/extra_attributes.rs @@ -0,0 +1,56 @@ +use url::Url; + +use super::attribute_types::{FixedSpace,ID,NameToken,AlignHV,AlignH,Measure,EnumeratedListType}; + +pub trait ExtraAttributes { + fn extra(&self) -> &A; +} + +#[derive(Default,Debug)] pub struct Address { pub space: FixedSpace } +#[derive(Default,Debug)] pub struct LiteralBlock { pub space: FixedSpace } +#[derive(Default,Debug)] pub struct DoctestBlock { pub space: FixedSpace } +#[derive(Default,Debug)] pub struct SubstitutionDefinition { pub ltrim: Option, pub rtrim: Option } +#[derive(Default,Debug)] pub struct Comment { pub space: FixedSpace } +#[derive(Default,Debug)] pub struct Target { pub refuri: Option, pub refid: Option, pub refname: Vec, pub anonymous: Option } +#[derive(Default,Debug)] pub struct Raw { pub space: FixedSpace, pub format: Vec } +#[derive(Debug)] +pub struct Image { + pub align: Option, + pub uri: Url, + pub alt: Option, + pub height: Option, + pub width: Option, + pub scale: Option, +} + +//bools usually are XML yesorno. “auto” however either exists and is set to something random like “1” or doesn’t exist + +#[derive(Default,Debug)] pub struct BulletList { pub bullet: Option } +#[derive(Default,Debug)] pub struct EnumeratedList { pub enumtype: Option, pub prefix: Option, pub suffix: Option } + +#[derive(Default,Debug)] pub struct Footnote { pub backrefs: Vec, pub auto: Option } +#[derive(Default,Debug)] pub struct Citation { pub backrefs: Vec } +#[derive(Default,Debug)] pub struct SystemMessage { pub backrefs: Vec, pub level: Option, pub line: Option, pub type_: Option } +#[derive(Default,Debug)] pub struct Figure { pub align: Option, pub width: Option } +#[derive(Default,Debug)] pub struct Table; //TODO + +#[derive(Default,Debug)] pub struct OptionArgument { pub delimiter: Option } + +#[derive(Default,Debug)] pub struct Reference { pub name: Option, pub refuri: Option, pub refid: Option, pub refname: Vec } +#[derive(Default,Debug)] pub struct FootnoteReference { pub refid: Option, pub refname: Vec, pub auto: Option } +#[derive(Default,Debug)] pub struct CitationReference { pub refid: Option, pub refname: Vec } +#[derive(Default,Debug)] pub struct SubstitutionReference { pub refname: Vec } +#[derive(Default,Debug)] pub struct Problematic { pub refid: Option } + +//also have non-inline versions. Inline image is no figure child, inline target has content +#[derive(Default,Debug)] pub struct TargetInline { pub refuri: Option, pub refid: Option, pub refname: Vec, pub anonymous: Option } +#[derive(Default,Debug)] pub struct RawInline { pub space: FixedSpace, pub format: Vec } +#[derive(Debug)] +pub struct ImageInline { + pub align: Option, + pub uri: Url, + pub alt: Option, + pub height: Option, + pub width: Option, + pub scale: Option, +} -- cgit v1.2.3