public static UfFormatDescriber VoteLinks() { UfFormatDescriber uFormat = new UfFormatDescriber { Name = "votelinks", Description = "Vote Links", Type = UfFormatDescriber.FormatTypes.Elemental }; UfElementDescriber uFElement = new UfElementDescriber { Attribute = "rel", Type = UfElementDescriber.PropertyTypes.UrlTextAttribute }; uFormat.BaseElement = uFElement; uFElement.AllowedTags.Add("a", "link"); uFElement.AddAttributeValues( new Dictionary<string, string> { {"vote-for", "vote-abstain vote-against"}, {"vote-against", "vote-abstain vote-for"}, {"vote-abstain", "vote-for vote-against"} } ); return uFormat; }
public static UfFormatDescriber Bookmark() { UfFormatDescriber uFormat = new UfFormatDescriber(); uFormat.Name = "bookmark"; uFormat.Description = "Bookmark"; uFormat.Type = UfFormatDescriber.FormatTypes.Elemental; UfElementDescriber uFElement = new UfElementDescriber(); uFElement.Name = "bookmark"; uFElement.AllowedTags.Add("a"); uFElement.AllowedTags.Add("link"); uFElement.Attribute = "rel"; uFElement.Type = UfElementDescriber.PropertyTypes.UrlText; uFormat.BaseElement = uFElement; uFElement.AttributeValues.Add(new UfAttributeValueDescriber("bookmark")); return uFormat; }
public static UfFormatDescriber Tag() { UfFormatDescriber uFormat = new UfFormatDescriber { Name = "tag", Description = "Tag", Type = UfFormatDescriber.FormatTypes.Elemental }; UfElementDescriber uFElement = new UfElementDescriber { Name = "tag", Multiples = true, Attribute = "rel", Type = UfElementDescriber.PropertyTypes.UrlTextTag }; uFormat.BaseElement = uFElement; uFElement.AllowedTags.Add("a", "link"); uFElement.AddAttributeValue("tag"); return uFormat; }
/// <summary> /// Gets the format describer for the NoFollow microformat /// </summary> /// <returns>The UfFormatDescriber for NoFollow relation</returns> public static UfFormatDescriber NoFollow() { UfFormatDescriber uFormat = new UfFormatDescriber { Name = "nofollow", Description = "Stops search engines following links", Type = UfFormatDescriber.FormatTypes.Elemental }; UfElementDescriber uFElement = new UfElementDescriber { Name = "nofollow", Attribute = "rel", Type = UfElementDescriber.PropertyTypes.UrlText }; uFormat.BaseElement = uFElement; uFElement.AllowedTags.Add("a", "link"); uFElement.AddAttributeValue("nofollow"); return uFormat; }
/// <summary> /// Gets the format describer for the Principles microformat /// </summary> /// <returns>The UfFormatDescriber for the Principles relation</returns> public static UfFormatDescriber Principles() { UfFormatDescriber uFormat = new UfFormatDescriber { Name = "principles", Description = "Principles", Type = UfFormatDescriber.FormatTypes.Elemental }; UfElementDescriber uFElement = new UfElementDescriber { Name = "principles", Attribute = "rel", Type = UfElementDescriber.PropertyTypes.UrlText }; uFormat.BaseElement = uFElement; uFElement.AllowedTags.Add("a", "link"); uFElement.AddAttributeValue("principles"); return uFormat; }
//----------------------------------------------------------------------- public static UfFormatDescriber NextPrevious() { UfFormatDescriber uFormat = new UfFormatDescriber(); uFormat.Name = "nextprevious"; uFormat.Description = "The rel next previous design pattern"; uFormat.Type = UfFormatDescriber.FormatTypes.Compound; UfElementDescriber uFElement = new UfElementDescriber(); uFElement.Name = "nextprevious"; uFElement.AllowedTags.Add("a"); uFElement.AllowedTags.Add("link"); uFElement.Attribute = "rel"; uFElement.Type = UfElementDescriber.PropertyTypes.UrlTextAttribute; uFormat.BaseElement = uFElement; uFElement.AttributeValues.Add(new UfAttributeValueDescriber("next", "")); uFElement.AttributeValues.Add(new UfAttributeValueDescriber("prev", "")); return uFormat; }
public static UfFormatDescriber Me() { UfFormatDescriber uFormat = new UfFormatDescriber(); uFormat.Name = "me"; uFormat.Description = "The finds rel=me without rest of xfn"; uFormat.Type = UfFormatDescriber.FormatTypes.Elemental; UfElementDescriber uFElement = new UfElementDescriber(); uFElement.Name = "me"; uFElement.AllowedTags.Add("a"); uFElement.AllowedTags.Add("link"); uFElement.Attribute = "rel"; uFElement.Type = UfElementDescriber.PropertyTypes.UrlText; uFormat.BaseElement = uFElement; uFElement.AttributeValues.Add(new UfAttributeValueDescriber("me", "")); return uFormat; }
/// <summary> /// Gets the format describer for the ItemLicense microformat /// </summary> /// <returns>The UfFormatDescriber for the Item License relation</returns> public static UfFormatDescriber ItemLicense() { UfFormatDescriber uFormat = new UfFormatDescriber { Name = "item-license", Description = "item-license used in hNews hEntry item", Type = UfFormatDescriber.FormatTypes.Elemental }; UfElementDescriber uFElement = new UfElementDescriber { Name = "item-license", Attribute = "rel", Type = UfElementDescriber.PropertyTypes.UrlText }; uFormat.BaseElement = uFElement; uFElement.AllowedTags.Add("a", "link"); uFElement.AddAttributeValue("item-license"); return uFormat; }
public static UfFormatDescriber XFolk() { UfFormatDescriber uFormat = new UfFormatDescriber { Name = "xFolk", Description = "xFolk", Type = UfFormatDescriber.FormatTypes.Compound, BaseElement = new UfElementDescriber("xfolkentry", false, true, UfElementDescriber.PropertyTypes.None) }; uFormat.BaseElement.Elements.Add(new UfElementDescriber("taggedlink", true, false, UfElementDescriber.PropertyTypes.UrlText)); uFormat.BaseElement.Elements.Add(new UfElementDescriber("description", false, true, UfElementDescriber.PropertyTypes.Text)); UfElementDescriber uFElement = new UfElementDescriber { Name = "tag", Attribute = "rel", Type = UfElementDescriber.PropertyTypes.UrlTextTag }; uFElement.AllowedTags.Add("a", "link"); uFElement.AttributeValues.Add(new UfAttributeValueDescriber("tag")); uFormat.BaseElement.Elements.Add(uFElement); return uFormat; }
///<summary>Gets the Format Describer for the XHTML Friends Network microformat</summary> ///<returns>The UfFormatDescriber for Xfn</returns> public static UfFormatDescriber Xfn() { UfFormatDescriber uFormat = new UfFormatDescriber { Name = "xfn", Description = "XHTML Friends Network, describes realtionships", Type = UfFormatDescriber.FormatTypes.Elemental }; UfElementDescriber uFElement = new UfElementDescriber { Name = "xfn", Attribute = "rel", Type = UfElementDescriber.PropertyTypes.UrlTextAttribute }; uFormat.BaseElement = uFElement; uFElement.AllowedTags.Add("a", "link"); uFElement.AddAttributeValues( new Dictionary<string, string> { {"met", ""}, {"co-worker", ""}, {"colleague", ""}, {"muse", "" }, {"crush", "" }, {"date", "" }, {"sweetheart", "" }, {"co-resident", "neighbor" }, {"neighbor", "co-resident" }, {"child", "parent sibling spouse kin"}, {"parent", "child sibling spouse kin"}, {"sibling", "child parent spouse kin"}, {"spouse", "child parent sibling kin" }, {"kin", "child parent sibling spouse"}, {"contact", "acquaintance friend"}, {"acquaintance", "contact friend"}, {"friend", "contact friend"}, {"me", "contact acquaintance friend met co-worker colleague co-resident neighbor " + "child parent sibling spouse kin muse crush date sweetheart"} } ); return uFormat; }