File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ pub fn make_subcommand() -> Command {
42
42
. value_parser ( NonEmptyStringValueParser :: new ( ) )
43
43
. help ( "Port to use for HTTP connections" ) ,
44
44
)
45
+ . arg (
46
+ Arg :: new ( "renderer" )
47
+ . short ( 'r' )
48
+ . long ( "renderer" )
49
+ . num_args ( 1 )
50
+ . default_value ( "html" )
51
+ . value_parser ( NonEmptyStringValueParser :: new ( ) )
52
+ . help ( "Renderer to serve the output of" ) ,
53
+ )
45
54
. arg_open ( )
46
55
}
47
56
@@ -52,6 +61,7 @@ pub fn execute(args: &ArgMatches) -> Result<()> {
52
61
53
62
let port = args. get_one :: < String > ( "port" ) . unwrap ( ) ;
54
63
let hostname = args. get_one :: < String > ( "hostname" ) . unwrap ( ) ;
64
+ let renderer = args. get_one :: < String > ( "renderer" ) . unwrap ( ) ;
55
65
let open_browser = args. get_flag ( "open" ) ;
56
66
57
67
let address = format ! ( "{}:{}" , hostname, port) ;
@@ -73,7 +83,7 @@ pub fn execute(args: &ArgMatches) -> Result<()> {
73
83
. to_socket_addrs ( ) ?
74
84
. next ( )
75
85
. ok_or_else ( || anyhow:: anyhow!( "no address found for {}" , address) ) ?;
76
- let build_dir = book. build_dir_for ( "html" ) ;
86
+ let build_dir = book. build_dir_for ( renderer ) ;
77
87
let input_404 = book
78
88
. config
79
89
. get ( "output.html.input-404" )
You can’t perform that action at this time.
0 commit comments