Julmar.GenMarkdown 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Julmar.GenMarkdown --version 1.0.2                
NuGet\Install-Package Julmar.GenMarkdown -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Julmar.GenMarkdown" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Julmar.GenMarkdown --version 1.0.2                
#r "nuget: Julmar.GenMarkdown, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Julmar.GenMarkdown as a Cake Addin
#addin nuget:?package=Julmar.GenMarkdown&version=1.0.2

// Install Julmar.GenMarkdown as a Cake Tool
#tool nuget:?package=Julmar.GenMarkdown&version=1.0.2                

GenMarkdown

.NET Core library to make it easy to generate Markdown with an object graph.

Build and Publish GenMarkdown on NuGet

Example code

// Markdown documents are composed of blocks which contain inline objects.
// You can add through Add methods, or directly as part of creation.
MarkdownDocument doc = new()
{
    new Header(1, "Example title"),
    
    new Paragraph
    {
        "This is some text with ",
        Text.Bold("some inline bold text"),
        " and ",
        Text.Italic("some inline italics"),
        ". There's an explicit converter from strings to create plain text."
    },
    
    new Paragraph("Can also have a single paragraph as part of the constructor."),

    new Paragraph
    {
        new Text("Or use the explicit Text objects to add plain text or "),
        new BoldText("BoldText"),
        new Text(" or "),
        new ItalicText("ItalicText"),
        new Text(" objects.")
    },

    new Paragraph
    {
        "Can inline code with the Text.Code helper - for example: ",
        Text.Code("Program"), " object.",
        "Or use the explicit ",
        new InlineCode("InlineCode"), " object."
    },

    new Header(2)
    {
        "Headers can have ",
        Text.Bold("inline elements"),
        " too."
    },

    "Here's an image:",
    new Image("NuGet logo", "https://www.nuget.org/Content/gallery/img/logo-header.svg", "A description"),

    "And a link:",
    new Link("www.microsoft.com", "https://microsoft.com"),

    "And a horizontal rule.",
    new HorizontalRule(),
    
    new Header(2, "Lists"),
    
    new Paragraph("Here's an example bulleted list."),

    new BulletedList
    {
        new Paragraph { "Item #1 - ", Text.Link("google.com", "https://google.com"), "." },
        new Paragraph("Item #2"),
        {
            new Paragraph("Item #3"),
            new Paragraph("With some additional text"),
            new Image("and an image", "https://www.nuget.org/Content/gallery/img/logo-header.svg")
        }
    },

    new Paragraph("Here's a numbered list."),

    new NumberedList
    {
        "One",
        "Two",
        "Three"
    },

    "You can also start it at a specific number:",

    new NumberedList(5)
    {
        "Five",
        "Six",
        "Seven"
    },

    new Header(2, "Quotes"),

    "Some block quotes.",

    new BlockQuote("This is a quote."),
    new BlockQuote
    {
        "This is also a quote.",
        new Image("Image", "https://www.nuget.org/Content/gallery/img/logo-header.svg")
    },

    new Header(2, "Tables"),

    "And finally, tables.",

    new Table(3)
    {
        new()
        {
            "", new Paragraph { Text.Bold("Math") }, new Paragraph { Text.Bold("Science") },
        },
        new()
        {
            new Paragraph { Text.Bold("John Smith") },
            "A",
            "B"
        },
        new()
        {
            new Paragraph { Text.Bold("Susan Green") },
            "C",
            "A"
        }
    }
};

// Can use ToString
Console.WriteLine(doc.ToString());

// Or write it out with a stream
doc.Write(new StreamWriter(@"./out.md"))

Output

# Example title

This is some text with **some inline bold text** and _some inline italics_. There's an explicit converter from strings to create plain text.

Can also have a single paragraph as part of the constructor.

Or use the explicit Text objects to add plain text or **BoldText** or _ItalicText_ objects.

Can inline code with the Text.Code helper - for example: `Program` object.Or use the explicit `InlineCode` object.

## Headers can have **inline elements** too.

Here's an image:

![Nuget logo](https://www.nuget.org/Content/gallery/img/logo-header.svg "A description")

And a link:

[www.microsoft.com](https://microsoft.com)

And a horizontal rule.

---

## Lists

Here's an example bulleted list.

* Item #1 - [google.com](https://google.com).
* Item #2
* Item #3
  With some additional text
  ![and an image](https://www.nuget.org/Content/gallery/img/logo-header.svg)

Here's a numbered list.

1. One
2. Two
3. Three

You can also start it at a specific number:

5. Five
6. Six
7. Seven

## Quotes

Some block quotes.

> This is a quote.

> This is also a quote.
> ![Image](https://www.nuget.org/Content/gallery/img/logo-header.svg)

## Tables

And finally, tables.

| |**Math** |**Science** |
|-|-|-|
|**John Smith** |A |B |
|**Susan Green** |C |A |

Example title

This is some text with some inline bold text and some inline italics. There's an explicit converter from strings to create plain text.

Can also have a single paragraph as part of the constructor.

Or use the explicit Text objects to add plain text or BoldText or ItalicText objects.

Can inline code with the Text.Code helper - for example: Program object.Or use the explicit InlineCode object.

Headers can have inline elements too.

Here's an image:

Nuget logo

And a link:

www.microsoft.com

And a horizontal rule.


Lists

Here's an example bulleted list.

  • Item #1 - google.com.
  • Item #2
  • Item #3 With some additional text and an image

Here's a numbered list.

  1. One
  2. Two
  3. Three

You can also start it at a specific number:

  1. Five
  2. Six
  3. Seven

Quotes

Some block quotes.

This is a quote.

This is also a quote. Image

Tables

And finally, tables.

Math Science
John Smith A B
Susan Green C A
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.7 341 2/15/2023
1.0.6.2-preview 131 2/15/2023
1.0.6.1-preview 176 8/5/2022
1.0.6-preview 163 4/9/2022
1.0.5.5 934 2/18/2022
1.0.5.4 406 2/18/2022
1.0.5.3 387 2/18/2022
1.0.5.2 383 2/18/2022
1.0.5.1 413 2/18/2022
1.0.5 405 2/8/2022
1.0.4.2 386 2/8/2022
1.0.4.1 421 1/24/2022
1.0.4 410 1/21/2022
1.0.3.1 425 1/14/2022
1.0.3 265 1/1/2022
1.0.2 264 1/1/2022
1.0.1 263 1/1/2022
1.0.0 249 1/1/2022