M serve_options.go => serve_options.go +6 -0
@@ 20,6 20,12 @@ type ServeOptions struct {
ConvertOptions
+ // If true, the serve command generate index.html automatically if its
+ // not exist in the directory.
+ // The index.html contains the list of files inside the requested
+ // path.
+ EnableIndexHTML bool
+
// IsDevelopment if set to true, it will serve the ConvertOptions.Root
// directory directly and watch all asciidoc files for changes and
// convert it.
M server.go => server.go +3 -2
@@ 47,8 47,9 @@ func newServer(opts *ServeOptions) (srv *server, err error) {
}
var httpdOpts = libhttp.ServerOptions{
- Memfs: opts.Mfs,
- Address: opts.Address,
+ Memfs: opts.Mfs,
+ Address: opts.Address,
+ EnableIndexHTML: opts.EnableIndexHTML,
}
srv.http, err = libhttp.NewServer(httpdOpts)