コード例 #1
0
        public CommandSectionTag(string applicationName, CommandReport report)
            : base("section")
        {
            AddClass("command-section");
            var h4 = Add("h4");

            h4.Add("span")
                .Text(applicationName + " " + report.Name)
                .AddClass("section-header")
                .Id(report.Name);

            h4.Add("i").AddClass("command-description").Text(report.Description);
        }
コード例 #2
0
ファイル: FlagsTag.cs プロジェクト: jamesmanning/Storyteller
        public FlagsTag(CommandReport report)
        {
            AddClass("table");
            AddHeaderRow(tr => tr.Header("Flags").Attr("colspan", 2));

            report.Flags.Each(x =>
            {
                AddBodyRow(tr =>
                {
                    tr.Cell(x.UsageDescription).AddClass("command-flag-usage");
                    tr.Cell(x.Description).AddClass("command-flag-description");
                });
            });
        }
コード例 #3
0
        public ArgumentsTag(CommandReport report)
        {
            AddClass("table");
            AddHeaderRow(tr => tr.Header("Arguments").Attr("colspan", 2));

            report.Arguments.Each(x =>
            {
                AddBodyRow(tr =>
                {
                    tr.Cell(x.Name).AddClass("command-arg-name");
                    tr.Cell(x.Description).AddClass("command-arg-description");
                });
            });
        }
コード例 #4
0
        public UsageTableTag(CommandReport report)
        {
            AddClass("table");
            AddClass("usages-table");
            AddHeaderRow(tr => tr.Header("Usages").Attr("colspan", 2));

            report.Usages.Each(x =>
            {
                AddBodyRow(tr =>
                {
                    tr.Cell(x.Description);
                    tr.Cell(x.Usage).AddClass("command-usage");
                });
            });
        }
コード例 #5
0
        public static IEnumerable<HtmlTag> CommandBodyTags(string applicationName, CommandReport report)
        {
            if (report.Usages.Count() == 1)
            {
                yield return new SingleUsageTag(report.Usages.Single());
            }
            else
            {
                yield return new UsageTableTag(report);
            }

            if (report.Arguments.Any())
            {
                yield return new ArgumentsTag(report);
            }

            if (report.Flags.Any())
            {
                yield return new FlagsTag(report);
            }
        }