fix
This commit is contained in:
parent
00f8fdc9e1
commit
c6f15577bb
|
@ -46,7 +46,7 @@ struct Options {
|
|||
hostname: String,
|
||||
|
||||
/// HTTP port
|
||||
#[structopt(long, default_value="34587")]
|
||||
#[structopt(long, default_value = "34587")]
|
||||
http_port: u16,
|
||||
}
|
||||
|
||||
|
@ -88,18 +88,12 @@ fn main() -> Result<(), maj::server::Error> {
|
|||
{
|
||||
let port = opts.http_port.clone();
|
||||
let h = h.clone();
|
||||
thread::spawn(move || http::run(h.clone(), port));
|
||||
}
|
||||
thread::spawn(move || http::run(h.clone(), port));
|
||||
}
|
||||
|
||||
task::block_on(maj::server::serve(
|
||||
h.clone(),
|
||||
config,
|
||||
opts.host,
|
||||
opts.port,
|
||||
))?;
|
||||
task::block_on(maj::server::serve(h.clone(), config, opts.host, opts.port))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// And finally, include the generated code for templates and static files.
|
||||
include!(concat!(env!("OUT_DIR"), "/templates.rs"));
|
||||
|
|
|
@ -62,8 +62,8 @@ pub fn render(nodes: Vec<Node>, out: &mut impl Write) -> io::Result<()> {
|
|||
match node {
|
||||
Text(body) => write!(out, "{}\n", body)?,
|
||||
Link { to, name } => match name {
|
||||
Some(name) => write!(out, "{} {}\n", to, name)?,
|
||||
None => write!(out, "{}\n", to)?,
|
||||
Some(name) => write!(out, "=> {} {}\n", to, name)?,
|
||||
None => write!(out, "=> {}\n", to)?,
|
||||
},
|
||||
Preformatted(body) => write!(out, "```\n{}\n```\n", body)?,
|
||||
Heading { level, body } => write!(out, "{} {}\n", "#".repeat(level as usize), body)?,
|
||||
|
|
Loading…
Reference in New Issue