You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cli_parser.add_argument("-p", type=int, metavar="port", default=8000, help="serve website on this port")
134
141
cli_parser.add_argument("-i", type=Path, metavar="input_dir", default=Path("."), help="The input directory (contianing jinja templates) to use. Defaults to the current working directory.")
135
142
cli_parser.add_argument("-o", type=Path, metavar="output_dir", default=Path("out"), help="The output directory to write website output files to. Defaults to ./out")
136
-
cli_parser.add_argument("-t", type=Path, metavar="template_dir", default=Path("templates"), help="Shared templates directory (this must be a subfolder of the input directory). Defaults to ./templates")
143
+
cli_parser.add_argument("-t", type=str, metavar="template_dir", default="templates", help="Shared templates directory (relative path only, this must be a subfolder of the input directory). Defaults to templates")
137
144
cli_parser.add_argument("--blacklist", nargs="+", type=Path, metavar="ignored_dir", default=set(), help="directories to ignore")
"""Initializer, creates a new `Context`. For best results, all `Path` type arguments should be absolute (this is automatically done in the initializer, but if you want to change the properties after initializing, make sure you do this).
31
31
32
32
Args:
33
33
input_dir (Path, optional): The directory to watch for changes. Defaults to Path(".").
34
34
output_dir (Path, optional): The directory to save generated files. Defaults to Path("out").
35
-
template_dir (Path, optional): The directory containing jinja2 mixin-type templates. Defaults to Path("./templates").
35
+
template_dir (str, optional): The directory containing jinja2 mixin-type templates. If it exists, this is the name of a folder under `input_dir`. Defaults to "templates".
36
36
ignore_list (set[Path], optional): The set of directories to ignore (will not be watched, even if `input_dir` is a parent folder). Defaults to set().
37
37
dev_mode (bool, optional): Flag which turns on development mode (i.e. livereload server). Defaults to False.
(output_path:=self.context.output_dir/ (stub:=self.context.stub_of(f))).parent.mkdir(parents=True, exist_ok=True) # create dir structure if it doesn't exist
0 commit comments