コード例 #1
0
        static void Main(string[] args)
        {
            Document document = new Document(new DocumentPart[] {
                new Hyperlink()
                {
                    Text = "Hyper", Url = "someUrl.new"
                },
                new BoldText()
                {
                    Text = "Bold"
                },
                new PlainText()
                {
                    Text = "Plain"
                }
            });

            var htmlConverter  = new ToHtmlConverter();
            var plainConverter = new ToPlainTextConverter();
            var latexConverter = new ToLaTeXConverter();

            System.Console.WriteLine($"Document to HTML:\n{document.ToHtml()}");
            System.Console.WriteLine($"Document to plain text:\n{document.ToPlainText()}");
            System.Console.WriteLine($"Document to LaTeX:\n{document.ToLaTeX()}");

            System.Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            List <DocumentPart> parts = new List <DocumentPart>
            {
                new PlainText {
                    Text = "Some plain text"
                },
                new Hyperlink {
                    Text = "google.com", Url = "https://www.google.by/"
                },
                new BoldText {
                    Text = "Some bold text"
                }
            };

            var      htmlConverter      = new ToHtmlConverter();
            var      plainTextConverter = new ToPlainTextConverter();
            var      laTeXConverter     = new ToLaTeXConverter();
            Document document           = new Document(parts);

            Console.WriteLine(htmlConverter.Convert(document));

            Console.WriteLine(plainTextConverter.Convert(document));

            Console.WriteLine(laTeXConverter.Convert(document));
        }
コード例 #3
0
        static void Main(string[] args)
        {
            List <DocumentPart> parts = new List <DocumentPart>();

            parts.Add(new BoldText()
            {
                Text = "Bold string"
            });
            parts.Add(new PlainText()
            {
                Text = "Plain string"
            });
            parts.Add(new Hyperlink()
            {
                Text = "Hypertext", Url = $"http://github.com"
            });
            Document document = new Document(parts);

            ITextConverter converter = new ToHtmlConverter();

            System.Console.WriteLine(document.Convert(converter));

            converter = new ToLaTeXConverter();
            System.Console.WriteLine(document.Convert(converter));

            converter = new ToPlainTextConverter();
            System.Console.WriteLine(document.Convert(converter));

            System.Console.ReadLine();
        }