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 @@ -41,6 +41,15 @@ pub fn make_subcommand() -> Command {
41
41
. value_parser ( NonEmptyStringValueParser :: new ( ) )
42
42
. help ( "Port to use for HTTP connections" ) ,
43
43
)
44
+ . arg (
45
+ Arg :: new ( "renderer" )
46
+ . short ( 'r' )
47
+ . long ( "renderer" )
48
+ . num_args ( 1 )
49
+ . default_value ( "html" )
50
+ . value_parser ( NonEmptyStringValueParser :: new ( ) )
51
+ . help ( "Renderer to serve the output of" ) ,
52
+ )
44
53
. arg_open ( )
45
54
. arg_watcher ( )
46
55
}
@@ -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