public static void StartArtItem(this MamlWriter writer, ArtItem artItem, int indentLevel) { //writer.StartMarkup(); //writer.WriteStartElement("nobr", String.Empty); //writer.WriteStartElement("artLink"); //writer.WriteAttributeString("target", artItem.Id); //writer.WriteEndElement(); //writer.WriteRaw(NonBlockingSpaceEntityName); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); if (indentLevel > 0) { writer.WriteIndent(indentLevel); } // Write the inline-image... writer.WriteMediaLinkInline(artItem.Id); // Write a white space... //writer.WriteStartElement("phrase"); //phrase //writer.WriteRaw(NonBlockingSpaceEntityName); //writer.WriteEndElement(); //phrase }
public static void WriteArtItemWithTopicLink(this MamlWriter writer, ArtItem artItem, Topic topic, int indentLevel) { //writer.StartHtmlArtItem(artItem); //writer.WriteHtmlTopicLink(topic); //writer.EndHtmlArtItem(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); if (indentLevel > 0) { writer.WriteIndent(indentLevel); } // Write the inline-image... writer.WriteMediaLinkInline(artItem.Id); // Write a white space... //writer.WriteStartElement("phrase"); //phrase //writer.WriteRaw(NonBlockingSpaceEntityName); //writer.WriteEndElement(); //phrase // Write the line... writer.WriteLink(topic.Id, topic.LinkTitle); writer.WriteEndElement(); //notLocalizable }
public static void WriteHtmlTopicLink(this MamlWriter writer, Topic topic) { // Don't use the HTML prefix (/html/) because that would break website builds. // // The topic that uses the HTML based topic links are generated; the topics // it points to are generated as well. That means source and target must be // in the same folder anywyas. var url = String.Format(CultureInfo.InvariantCulture, "{0}.htm", topic.Id); writer.WriteStartElement("a", Namespaces.Maml); writer.WriteAttributeString("href", url); writer.WriteString(topic.LinkTitle); writer.WriteEndElement(); }
public static void WriteSimpleTypeStrucure(this MamlWriter writer, Context context, SimpleTypeStructureNode root) { if (root == null || root.Children.Count == 0) { return; } if (root.Children.Count == 1) { var node = root.Children[0]; var isSingleRow = SimpleTypeStructureNode.GetIsSingleRow(node); if (isSingleRow) { writer.StartParagraph(); writer.WriteSingle(context.TopicManager, node, 0); writer.EndParagraph(); return; } } writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); writer.WriteRowEntry("Item"); //writer.WriteRowEntry("Facet Value"); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); writer.WriteString("Facet Value"); writer.WriteEndElement(); //notLocalizable writer.EndParagraph(); writer.EndTableRowEntry(); writer.WriteRowEntry("Description"); writer.EndTableRow(); writer.EndTableHeader(); writer.WriteNodes(context, root.Children, 0); writer.EndTable(); }
public static void WriteArtItemWithText(this MamlWriter writer, ArtItem artItem, string text) { //writer.StartHtmlArtItem(artItem); //writer.WriteString(text); //writer.EndHtmlArtItem(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); // Write the inline-image... writer.WriteMediaLinkInline(artItem.Id); // Write a white space... //writer.WriteStartElement("phrase"); //phrase //writer.WriteRaw(NonBlockingSpaceEntityName); //writer.WriteEndElement(); //phrase // Write the line... writer.WriteString(text); writer.WriteEndElement(); //notLocalizable }
public static void StartHtmlArtItem(this MamlWriter writer, ArtItem artItem) { writer.StartMarkup(); // Emitting a <nobr> tag breaks the Open XML output. I'm pretty // sure that I've added this originally in order to avoid weird // breaks between the icon and whatever comes after (usually a // link or text). However, after visual inspection, I can't find // any cases where this can actually occur. // // If we need to add this back, we should probably either special // case the output type and suppress <nobr> for Open XML or find a // MAML way of doing it (which doesn't exist today). // // writer.WriteStartElement("nobr", String.Empty); writer.WriteStartElement("artLink"); writer.WriteAttributeString("target", artItem.Id); writer.WriteEndElement(); writer.WriteRaw(NonBlockingSpaceEntityName); }
private static void WriteJumpTableSection(this MamlWriter writer, Context context, ICollection <ListItem> listItems, string title, string address) { if (listItems.Count == 0) { return; } writer.StartSection(title, address); writer.StartTable(); writer.StartTableHeader(); writer.StartTableRow(); //writer.WriteRowEntry(String.Empty); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteToken("iconColumn"); writer.EndParagraph(); writer.EndTableRowEntry(); if (title.EndsWith("s", StringComparison.Ordinal)) { if (title.IndexOf(' ') < 0) // if it is a single word... { writer.WriteRowEntry(title.Remove(title.Length - 1)); } else { // Write non-breaking title text... writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteStartElement("notLocalizable"); //notLocalizable writer.WriteAttributeString("address", writer.GetNextNobrAddress()); writer.WriteString(title.Remove(title.Length - 1)); writer.WriteEndElement(); //notLocalizable writer.EndParagraph(); writer.EndTableRowEntry(); } } else { writer.WriteRowEntry("Element"); } writer.WriteRowEntry("Description"); writer.EndTableRow(); writer.EndTableHeader(); foreach (var listItem in listItems) { writer.StartTableRow(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteArtItemInline(listItem.ArtItem); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteTopicLink(listItem.Topic); writer.EndParagraph(); writer.EndTableRowEntry(); writer.StartTableRowEntry(); writer.StartParagraph(); writer.WriteRaw(listItem.SummaryMarkup); writer.EndParagraph(); writer.EndTableRowEntry(); writer.EndTableRow(); } writer.EndTable(); writer.StartParagraph(); if (context.MoveToTopLink) { // Create a link to the introduction, it is the top... writer.WriteLink("#introduction", "Top"); } writer.EndParagraph(); writer.EndSection(); }