https://github.com/linkdd/easymd
Simple HTTP server to render markdown documents
https://github.com/linkdd/easymd
golang http-server markdown
Last synced: 9 months ago
JSON representation
Simple HTTP server to render markdown documents
- Host: GitHub
- URL: https://github.com/linkdd/easymd
- Owner: linkdd
- License: mit
- Created: 2022-11-02T03:52:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-03T18:12:15.000Z (over 3 years ago)
- Last Synced: 2025-03-20T17:05:21.220Z (about 1 year ago)
- Topics: golang, http-server, markdown
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# easymd
This program is a very simple HTTP server used to render Markdown documents to
HTML, to share easily some informations with others.
## Features
- parse frontmatter
- render Markdown documents to HTML using [Goldmark](https://github.com/yuin/goldmark)
- tables and syntax highlighting support
Frontmatter:
```yaml
---
title: "Hello world"
lang: en
meta:
- attribute: keywords
value: hello,world
css:
- https://url/to/style.css
js:
- https://url/to/script.js
---
```
## Build
Simply run:
```
$ go build
```
## Usage
```
easymd - a simple server rendering markdown documents to HTML
Usage:
easymd [flags]
Flags:
-b, --bind ip IP address to listen on (default 0.0.0.0)
-h, --help help for easymd
-p, --port int Port to listen on (default 8000)
-r, --root string Root directory to scan for markdown documents (default ".")
```
If you have the following structure:
```
|-+ docs/
|-- _index.md
|-- hello.md
|-- image.png
|-+ foo/
|-- bar.md
```
And run the command:
```
$ easymd -b 127.0.0.1 -p 8000 -r ./docs/
```
The following URLs will be available:
- http://127.0.0.1:8000/
- http://127.0.0.1:8000/image.png
- http://127.0.0.1:8000/hello/
- http://127.0.0.1:8000/hello
- http://127.0.0.1:8000/foo/bar/
- http://127.0.0.1:8000/foo/bar
## License
This project is released under the terms of the [MIT License](./LICENSE.txt).