예제 #1
0
        static void Main(string[] args)
        {
            var markdown = new Markdown();

            markdown.AddLine(new Heading(HeadingLevel.One, "Tekir ",
                                         new Image("Tekir", "https://github.com/selcukgural/Tekir/blob/main/src/image/64px.png")))
            .AddLine(new HorizontalRule())
            .AddLine(new FreeText(
                         "Tekir is a **Markdown** creator for .Net apps. Allows you to create Markdown file over class objects. Also Tekir supports almost all Markdown tags. Actually if you want try a manually simple Markdown file Tekir a little bit want more effect but **it may be more useful if you want to create a dynamic Markdown file according to certain conditions via a program.**"))
            .AddLine(new Paragraph())
            .AddLine(new FreeText(
                         "You can save the markdown file to your disk like that. You can also extend the **Save** method using the `IEntry` interface."))
            .AddLine(new Paragraph())
            .AddLine(
                new FreeText("For more information please check **Tekir_Sample** project's `Program.cs` file."))
            .AddLine(new Paragraph())
            .AddLine(new FreeText("**Note:** This README.md file created by Tekir."))
            .AddLine(new Paragraph())
            .AddLine(new Heading(HeadingLevel.One, "Samples"))
            .AddLine(new HorizontalRule(new Paragraph()))
            .AddLine(new SyntaxHighlighting())
            .AddLine(new FreeText("The Get method will return the **Markdown string**. You can always call"))
            .AddLine(new SyntaxHighlighting("Get();", "csharp", new Paragraph()))
            .AddLine(new Heading(HeadingLevel.Two, "Table"));

            #region Markdown Table

            var table = new Table();
            table.Columns.Add(new Column("Test", Alignment.Left));
            table.Columns.Add(new Column("Test 2", Alignment.Center));
            table.Columns.Add(new Column("Test 3", Alignment.Right));
            table.Columns.Add(new Column("Test 4"));

            table.Rows.Add(new[] { "Column 1", "Column 2", "Column 3", "Column 4" });
            table.Rows.Add(new[] { "Column 1", "Column 2", "Column 3", "Column 4" });
            table.Rows.Add(new[] { "Column 1", "Column 2", "Column 3", "Column 4" });

            #endregion

            markdown.AddLine(new Code("Input"))
            .AddLine(new Paragraph())
            .AddLine(new SyntaxHighlighting(@"
                var table = new Table();
                table.Columns.Add(new Column(""Test"", Alignment.Left));
                table.Columns.Add(new Column(""Test 2"", Alignment.Center));
                table.Columns.Add(new Column(""Test 3"", Alignment.Right));
                table.Columns.Add(new Column(""Test 4""));

                table.Rows.Add(new[] { ""Column 1"", ""Column 2"", ""Column 3"", ""Column 4"" });
                table.Rows.Add(new[] { ""Column 1"", ""Column 2"", ""Column 3"", ""Column 4"" });
                table.Rows.Add(new[] { ""Column 1"", ""Column 2"", ""Column 3"", ""Column 4"" });", "csharp"))
            .AddLine(new Paragraph())
            .AddLine(new Code("Output"))
            .AddLine(table)
            .AddLine(new Paragraph())
            .AddLine(new Heading(HeadingLevel.Two, "List Element", new Paragraph()))
            .AddLine(new ListElement(new[] { "List element 1", "List element 2", "List element 3" }))
            .AddLine(new Paragraph())
            .AddLine(new Heading(HeadingLevel.Two, "Ordered List", new Paragraph()))
            .AddLine(new OrderedList(new[] { "Ordered item 1", "Ordered item 2", "Ordered item 3" }))
            .AddLine(new Paragraph())
            .AddLine(new Heading(HeadingLevel.Two, "UnOrderedList", new Paragraph()))
            .AddLine(new UnOrderedList(new List <UnOrderedItem>
            {
                new("Item 1", new[] { "Sub item 1", "Sub item 2" }),
                new("Item 2", new[] { "Sub item 1", "Sub item 2" }),
                new("Item 3", new[] { "Sub item 1", "Sub item 2", "Sub item 3" }),
            }));