Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/yuvix25/markdown2html-proxy

A simple web proxy converting Markdown to HTML, embeddable.
https://github.com/yuvix25/markdown2html-proxy

Last synced: about 1 month ago
JSON representation

A simple web proxy converting Markdown to HTML, embeddable.

Awesome Lists containing this project

README

        

# Markdown2HTML Proxy

## Usage
This proxy receives 2 query parameters, `url` and `style`. `url` should contain the URL to the raw markdown file. `style` should contain a URI encoded JSON representing the style to be applied on the `` tag. The default style is:
```css
body {
margin: 30px auto 30px auto;
max-width: 1000px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
background-color: #0d1117;
color: rgb(230, 237, 243);
}

a {
color: rgb(3, 102, 214);
text-decoration: none;
}
```

Example:
```js
const markdownUrl = "https://raw.githubusercontent.com/Yuvix25/markdown2html-proxy/main/README.md";

const style = {
"background-color": "white",
"color": "black",
}
const styleEncoded = encodeURIComponent(JSON.stringify(style));

const proxyUrl = `https://yuvix25.github.io/markdown2html-proxy?style=${styleEncoded}&url=${markdownUrl}`;
```

You can then embed the result in any of your web apps.