Exemple #1
0
        public void Write(List <HistoryItem> history)
        {
            using var fs = TargetFile.CreateText();

            using var bodyWriter = new StringWriter();
            foreach (var x in history.GroupBy(x => x.Category))
            {
                var category = x.Key;
                WriteCategory(bodyWriter, category, x.AsEnumerable(), isOpen: category == Category.Misc);
            }

            var style = @"
                .item { display: grid; grid-template: ""title"" auto
""desc"" auto
""prs"" auto
""commits"" auto / auto
;
                    border: 1px solid darkgrey;
                    border-radius: 4px;
                    margin: 1em 0 0.4em 0;
                    padding: 0.4em;
                }
                .item-title { grid-area: title; margin: 0; line-height: 1.8em; }
                .item-desc { grid-area: desc; margin-bottom: 0.4em; line-height: 1.8em; }
                .item-prs { grid-area: prs; }
                .item-commits { grid-area: commits; }
                .item-commits > details { display: inline-block; }
                .item-prs, .item-commits { margin-bottom: 4px; font-size: 0.8em; line-height: 1.8em; }
                .item-prs > .pr-link,
                .item-commits > details > summary > * { background-color: lightgrey; border-radius: 4px; margin-right: 2px; padding: 2px 4px; }
            ";
            var html  = @$ "
            <!DOCTYPE html><html>
            <head>
                <meta charset=" "utf-8" ">
                <style>{style}</style>
Exemple #2
0
 public void Write(List <Commit> history)
 {
     using var fs = TargetFile.CreateText();
     fs.Write(CreateTable(history));
 }