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 @@ -43,6 +43,15 @@ pub fn make_subcommand() -> Command {
43
43
. value_parser ( NonEmptyStringValueParser :: new ( ) )
44
44
. help ( "Port to use for HTTP connections" ) ,
45
45
)
46
+ . arg (
47
+ Arg :: new ( "renderer" )
48
+ . short ( 'r' )
49
+ . long ( "renderer" )
50
+ . num_args ( 1 )
51
+ . default_value ( "html" )
52
+ . value_parser ( NonEmptyStringValueParser :: new ( ) )
53
+ . help ( "Renderer to serve the output of" ) ,
54
+ )
46
55
. arg_open ( )
47
56
. arg_watcher ( )
48
57
}
@@ -54,6 +63,7 @@ pub fn execute(args: &ArgMatches) -> Result<()> {
54
63
55
64
let port = args. get_one :: < String > ( "port" ) . unwrap ( ) ;
56
65
let hostname = args. get_one :: < String > ( "hostname" ) . unwrap ( ) ;
66
+ let renderer = args. get_one :: < String > ( "renderer" ) . unwrap ( ) ;
57
67
let open_browser = args. get_flag ( "open" ) ;
58
68
59
69
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 html_config = book. config . html_config ( ) ;
78
88
let input_404 = html_config. and_then ( |c| c. input_404 ) ;
79
89
let file_404 = get_404_output_file ( & input_404) ;
You can’t perform that action at this time.
0 commit comments