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

https://github.com/jaywcjlove/HTMLToMarkdown

A Swift library based on JavaScriptCore for converting HTML to Markdown.
https://github.com/jaywcjlove/HTMLToMarkdown

html html-to-markdown swift swift-package-manager

Last synced: 23 days ago
JSON representation

A Swift library based on JavaScriptCore for converting HTML to Markdown.

Awesome Lists containing this project

README

          


Using my app is also a way to support me:


Scap: Screenshot & Markup Edit
Screen Test
Deskmark
Keyzer
Vidwall Hub
VidCrop
Vidwall
Mousio Hint
Mousio
Musicer
Audioer
FileSentinel
FocusCursor
Videoer
KeyClicker
DayBar
Iconed
Menuist
Quick RSS
Quick RSS
Web Serve
Copybook Generator
DevTutor for SwiftUI
RegexMate
Time Passage
Iconize Folder
Textsound Saver
Create Custom Symbols
DevHub
Resume Revise
Palette Genius
Symbol Scribe


HTML To Markdown
===

A Swift library based on JavaScriptCore for converting HTML to Markdown.

## Installation

### Swift Package Manager

Add CodeMirror to your project using Xcode:

1. In Xcode, go to `File` → `Add Package Dependencies...`
2. Enter the repository URL: `https://github.com/jaywcjlove/HTMLToMarkdown.git`
3. Click `Add Package`

Or add it to your `Package.swift` file:

```swift
dependencies: [
.package(url: "https://github.com/jaywcjlove/HTMLToMarkdown.git", from: "1.0.0")
]
```

## Usage

```swift
import HTMLToMarkdown

let toMarkdown = try HTMLToMarkdown()
let html = """

Here's an image:


Example Image

And another one without title:


Photo
"""

let markdown = try toMarkdown.conversion(html)
// Here's an image:
//
// ![Example Image](https://example.com/image.jpg "This is an example")
//
// And another one without title:
//
// ![Photo](https://example.com/photo.png)
```

## License

Licensed under the MIT License.