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]
fn new() -> Self
[src]
Create a new markdown preview server.
fn initial_markdown<S: Into<String>>(&mut self, markdown: S) -> &Self
[src]
Set the initial markdown to render when starting the server.
fn working_directory<D: Into<PathBuf>>(&mut self, directory: D) -> &Self
[src]
Set the directory that static files should be served out of.
Defaults to the process' current working directory.
fn highlight_theme<T: Into<String>>(&mut self, theme: T) -> &Self
[src]
Set the syntax highlighting theme to use.
Defaults to the "github" theme.
fn css<C: Into<String>>(&mut self, css: C) -> &Self
[src]
Set the CSS that should be used to style the markdown.
Defaults to github's CSS styles.
fn websocket_port(&mut self, port: u16) -> &Self
[src]
Set the port to listen for websocket connections on.
Defaults to an arbitrary port assigned by the OS.
fn http_port(&mut self, port: u16) -> &Self
[src]
Set the port to listen for HTTP connections on.
Defaults to an arbitrary port assigned by the OS.
fn external_renderer<C: Into<String>>(&mut self, command: C) -> &Self
[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.
fn start(&self) -> Result<Listening>
[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]
impl Clone for Server
[src]
fn clone(&self) -> Server
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more