Example #1
0
        private void GenerateIndex(string path)
        {
            Log.Info("Generating index");

            var oldTestamentBooks = _english.Books.Take(39).Select(b => new BookView(b.Id.ToString(), b.Name, Book.ChaptersPerBook[b.Id]));
            var newTestamentBooks = _english.Books.Skip(39).Select(b => new BookView(b.Id.ToString(), b.Name, Book.ChaptersPerBook[b.Id]));

            BookListView model    = new BookListView(oldTestamentBooks.ToList(), newTestamentBooks.ToList());
            string       template = File.ReadAllText(_indexTemplate);
            string       result   = Razor.Parse(template, model);

            File.WriteAllText(path + Path.DirectorySeparatorChar + "index.html", result);
        }
        private void GenerateIndex(string path)
        {
            Log.Info("Generating index");

            var oldTestamentBooks = _english.Books.Take(39).Select(b => new BookView(b.Id.ToString(), b.Name, Book.ChaptersPerBook[b.Id]));
            var newTestamentBooks = _english.Books.Skip(39).Select(b => new BookView(b.Id.ToString(), b.Name, Book.ChaptersPerBook[b.Id]));

            BookListView model = new BookListView(oldTestamentBooks.ToList(), newTestamentBooks.ToList());
            string template = File.ReadAllText(_indexTemplate);
            string result = Razor.Parse(template, model);

            File.WriteAllText(path + Path.DirectorySeparatorChar + "index.html", result);
        }