private static void RunOptions(CommandLineOptions opts)
        {
            RecueilExchange recueils = _bibleOnlineImporter.ReadFile(opts.InputFile);

            _mySwordCommentariesExport.Save(recueils.Commentaires, opts.Output);
            _myBibleCommentariesExport.Save(recueils.Commentaires, opts.Output);
            _osisCommentariesExport.Save(recueils.Commentaires, opts.Output);

            using StreamWriter file = new StreamWriter(@"output.html");

            foreach (var commentaire in recueils.Commentaires)
            {
                file.WriteLine(_commentaireHtmlFormater.ToString(commentaire));
            }

            Console.WriteLine(FiggleFonts.Swan.Render("Success !"), Color.Green);
        }
Beispiel #2
0
        private Commentary CommentaireToMySwordCommentary(Commentaire commentaire)
        {
            List <Reference> references = _referenceConverter.ConvertReference(commentaire.Reference);
            int bookIndex = _referenceConverter.BookNumberFromAbbreviation(references.First().Book);

            if (bookIndex >= 0)
            {
                return(new Commentary
                {
                    Book = bookIndex,
                    Chapter = references.First().Chapter,
                    FromVerse = references.First().FromVerse.GetValueOrDefault(),
                    ToVerse = references.First().ToVerse.GetValueOrDefault(references.First().FromVerse.GetValueOrDefault()),
                    Content = _commentaryFormater.ToString(commentaire)
                });
            }
            else
            {
                _logger.LogError($"book {references.First().Book} not found in BookList");
            }
            return(null);
        }