コード例 #1
0
        static void CreateMainMarkdown()
        {
            var template = File.ReadAllText(Data.TemplateDir + "/github.md");

            var table = new MarkdownTable("Article / Interview", "Date", "Publisher", "Sources / Mirrors");

            foreach (var a in articles)
            {
                table.Row(Markdown.Link(a.title, a.primarySource), a.date, a.publisher ?? "", Markdown.LinksString(a.sources));
            }
            template = template.Replace("{ARTICLES_TABLE}", table.ToString());

            table = new MarkdownTable("Event", "Date", "Sources");
            foreach (var e in events)
            {
                table.Row(e.linkOrTitle, e.date, e.sourceLinks);
            }
            template = template.Replace("{EVENTS_TABLE}", table.ToString());

            table = new MarkdownTable("Video", "Date");
            foreach (var v in videos)
            {
                table.Row(Markdown.Link(v.title, v.primarySource), v.dateMarkdownLinks);
            }

            template = template.Replace("{VIDEO_TABLE}", table.ToString());

            table = new MarkdownTable("Audio", "Date");
            foreach (var a in audio)
            {
                table.Row(Markdown.Link(a.title, a.primarySource), a.dateMarkdownLinks);
            }
            template = template.Replace("{AUDIO_TABLE}", table.ToString());

            table = new MarkdownTable("Game", "Year of game release");
            foreach (var s in source)
            {
                table.Row(Markdown.Link(s.game, s.url), s.year);
            }
            template = template.Replace("{SOURCE_TABLE}", table.ToString());

            File.WriteAllText(Data.BaseDir + "/README.md", template);
        }