Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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#
- Host: GitHub
- URL: https://github.com/baynezy/html2markdown
- Owner: baynezy
- License: apache-2.0
- Created: 2013-07-03T06:06:50.000Z (over 11 years ago)
- Default Branch: develop
- Last Pushed: 2024-05-11T19:28:34.000Z (9 months ago)
- Last Synced: 2024-05-15T22:46:03.437Z (8 months ago)
- Topics: c-sharp, html, html2markdown, markdown, nuget
- Language: C#
- Size: 3.92 MB
- Stars: 265
- Watchers: 10
- Forks: 83
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
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).