ws-markdown-server-1.0.0 is not a library.
Markdown server
A simple Markdown Websocket (and Unix socket) server backed by comrak and tokio-tungstenite.
Installation and Usage
Docker (recommended):
- Download the docker image.
- Start the container:
Note: The 9004 tcp port bind is optional and only required if you wish to expose a Unix socket server along with a WebSocket server (which runs on 9003).
Local
You can run a Markdown server on your local machine via ws-markdown-server:
- Install it with
cargo:
- Start the server:
RUST_LOG="ws_markdown_server=debug" \
MD_SERVER_WS_PORT=9003 \
MD_SERVER_TCP_PORT=9004 \
MD_SERVER_HOST="0.0.0.0" \
Testing it works
- You can test it works by opening a tcp connection at
0.0.0.0:9004and sending in some markdown text to be converted to html. For example:
# Start netcat once the markdown server is up and running.
# Send some markdown text to be converted to html.
> # Title
> This
> ...
> [Ctrl+D] ()
# You'll receive the html version of the sent markdown:
# <h1> Title </h1>
# <p>This is some text.</p>
# ...
- Alternatively, you can also run the sample
Svelteapp that sets up the client-side Websocket and uses thews-markdown-serverfor its backend.