Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/baynezy/html2markdown

A library for converting HTML to markdown syntax in C#
https://github.com/baynezy/html2markdown

c-sharp html html2markdown markdown nuget

Last synced: about 14 hours ago
JSON representation

A library for converting HTML to markdown syntax in C#

Awesome Lists containing this project

README

        

# HTML2Markdown

Converts HTML to [Markdown](http://daringfireball.net/projects/markdown/syntax).

---

![Html2Markdown](https://cloud.githubusercontent.com/assets/1049999/11505182/0480ad76-9841-11e5-8a62-126d4b7c03be.png)

## Build Status

| Branch | Status |
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `master` | [![master](https://github.com/baynezy/Html2Markdown/actions/workflows/branch-master.yml/badge.svg?branch=master)](https://github.com/baynezy/Html2Markdown/actions/workflows/branch-master.yml) |
| `develop` | [![develop](https://github.com/baynezy/Html2Markdown/actions/workflows/branch-develop.yml/badge.svg?branch=develop)](https://github.com/baynezy/Html2Markdown/actions/workflows/branch-develop.yml) |

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=baynezy_Html2Markdown&metric=coverage)](https://sonarcloud.io/summary/new_code?id=baynezy_Html2Markdown)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=baynezy_Html2Markdown&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=baynezy_Html2Markdown)

## Support

This project will currently convert the following HTML tags:-

- ``
- ``
- ``
- ``
- ``
- `
`
- ``
- `

`
- `

`
- `

`
- `

`
- `

`
- `
`
- `
`
- ``
- `
`
- `

`
- `


`

- `

    `
    - `
      `

      ## Installing via NuGet

      [![NuGet version](https://badge.fury.io/nu/Html2Markdown.svg)](http://badge.fury.io/nu/Html2Markdown)

      ```pwsh
      Install-Package Html2Markdown
      ```

      ## Usage

      ### Strings

      ```csharp
      var html = "Something to convert";
      var converter = new Converter();
      var markdown = converter.Convert(html);
      ```

      ### Files

      ```csharp
      var path = "file.html";
      var converter = new Converter();
      var markdown = converter.ConvertFile(path);
      ```

      ### Documentation

      [Library Documentation](https://baynezy.github.io/Html2Markdown/)

      ## Customise

      ### Create new `IScheme` implementation

      Create your own implementation of `IScheme` and construct `Converter` with that.

      ```csharp
      var html = "Something to convert";
      var converter = new Converter(customConversionScheme);
      var markdown = converter.Convert(html);
      ```

      ## Try it

      This library is showcased at [http://html2markdown.bayn.es](http://html2markdown.bayn.es).

      ## Contributing

      [For those interested in contributing then please read the guidelines](CONTRIBUTING.md)

      ## License

      This project is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).