public void GenerateDocumentation(IDocumentationGenerator generator) { generator.P(Random ? "Random attribute" : "Provide the attribute name (or part of it) when calling this"); generator.PropertyValuePair("Amount", $"{AmountLow}" + (AmountLow == AmountHigh ? $"" : $" to {AmountHigh}")); if (GoldCost != 0) { generator.P($"Costs {GoldCost}{Naming.Gold}"); } }
public static IDocumentationGenerator PropertyValuePair(this IDocumentationGenerator generator, string property, Action content) { return(generator.Div("value", () => { generator.P($"<strong class=\"value\">{property}</strong>:"); content(); })); }
public static void AutoDocument(IDocumentationGenerator generator, object obj) { if (obj is bool b) { generator.P(b ? "Enabled" : "Disabled"); } else if (obj.GetType().IsPrimitive || obj.GetType().IsEnum || obj is string) { generator.P(obj.ToString()); } else if (obj is IEnumerable col) { AutoDocumentCollection(generator, col); } else { AutoDocumentObject(generator, obj); } }
public static IDocumentationGenerator PropertyValuePair(this IDocumentationGenerator generator, string property, string value) { return(generator.Div("value", () => generator.P($"<strong class=\"value\">{property}</strong>: {value}"))); }
public static IDocumentationGenerator Value(this IDocumentationGenerator generator, string value) { return(generator.P("value", value)); }
public void GenerateDocumentation(IDocumentationGenerator generator) => generator.P(Description);