Example #1
0
        private static void AddTitle(TemplateMetadata info, TagContent block)
        {
            if (!string.IsNullOrWhiteSpace(info.Description.RetirementMessage))
            {
                block.Add(T.g("p", "class", "titleNote")[info.Description.RetirementMessage]);
            }

            block.Add(T.g("h3", "class", "header", "id", info.FullName)[info.Name]);
            if (!info.IsCorrectHierarchy)
            {
                AddSubtypeWarning(block);
            }
        }
Example #2
0
 private static void AddTemplate(TemplateMetadata info, TagContent block)
 {
     if (string.IsNullOrWhiteSpace(info.Template))
     {
         block.Add(T.g("i")["This message has no template, and will be given a default message"]);
     }
     else if (info.Description.IsObsolete)
     {
         block.Add(T.g("code", "class", "obsoleteTemplate")[info.Template]);
     }
     else
     {
         block.Add(T.g("code", "class", "template")[info.Template]);
     }
 }
Example #3
0
        private static TagContent BuildDetailsExpander(TemplateMetadata info)
        {
            var expando = T.g("div", "class", "expando", "id", "expand_" + info.FullName);

            if (!string.IsNullOrWhiteSpace(info.Description.Description))
            {
                expando.Add(T.g("h4")["Description"]);
                expando.Add(T.g("p", "class", "informative")[info.Description.Description]);
            }

            if (!string.IsNullOrWhiteSpace(info.Description.Causes))
            {
                expando.Add(T.g("h4")["Causes"]);
                expando.Add(T.g("p", "class", "informative")[info.Description.Causes]);
            }

            if (!string.IsNullOrWhiteSpace(info.Description.Actions))
            {
                expando.Add(T.g("h4")["Actions"]);
                expando.Add(T.g("p", "class", "informative")[info.Description.Actions]);
            }

            if (info.Properties.Count > 0)
            {
                expando.Add(T.g("h4")["Properties"]);
                var defs = T.g("dl");
                foreach (var prop in info.Properties)
                {
                    defs.Add(T.g("dt")[prop.Key]);
                    defs.Add(T.g("dd")[prop.Value]);
                }

                expando.Add(defs);
            }

            return(expando);
        }