Struct aurelius::Server [] [src]

pub struct Server { /* fields omitted */ }

An instance of the a markdown preview server.

The server will listen for HTTP and WebSocket connections on arbitrary ports.

Examples

use aurelius::Server;

let listening = Server::new()
    .initial_markdown("<h1>Hello, world</h1>")
    .start()
    .unwrap();

Methods

impl Server
[src]

[src]

Create a new markdown preview server.

[src]

Set the initial markdown to render when starting the server.

[src]

Set the directory that static files should be served out of.

Defaults to the process' current working directory.

[src]

Set the syntax highlighting theme to use.

Defaults to the "github" theme.

[src]

Set the CSS that should be used to style the markdown.

Defaults to github's CSS styles.

[src]

Set the port to listen for websocket connections on.

Defaults to an arbitrary port assigned by the OS.

[src]

Set the port to listen for HTTP connections on.

Defaults to an arbitrary port assigned by the OS.

[src]

Set an external command to use instead of the in-memory markdown renderer.

The command should read markdown from stdin, and output markdown on stdout.

[src]

Starts the server.

Returns a channel that can be used to send markdown to the server. The markdown will be sent as HTML to all clients of the websocket server.

Trait Implementations

impl Debug for Server
[src]

[src]

Formats the value using the given formatter.

impl Clone for Server
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Server
[src]

[src]

Returns the "default value" for a type. Read more