Skip to content

Commit b70df7b

Browse files
committed
Routine chores
- Add new cli flag to control if one wants to have pretty_print output their HTML. - Bump version: 0.0.4 -> 0.0.5.
1 parent 64f9821 commit b70df7b

5 files changed

Lines changed: 424 additions & 318 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pyaether-cli"
3-
version = "0.0.4"
3+
version = "0.0.5"
44
description = "A CLI to build and run dev server for Aether apps."
55
authors = [{ name = "Saurabh Ghanekar", email = "ghanekarsaurabh8@gmail.com" }]
66
license = "BSD-2-Clause"

src/aether_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.4"
1+
__version__ = "0.0.5"

src/aether_cli/build_process.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def builder(
7474
static_assets_dir: Path,
7575
static_css_dir: Path,
7676
static_js_dir: Path,
77+
pretty_print_output: bool = False,
7778
verbose: bool = False,
7879
) -> None:
7980
if verbose:
@@ -109,4 +110,6 @@ def builder(
109110
console.print("Writing final HTML to file...")
110111

111112
with open(output_html_path, "w", encoding="utf-8") as file:
112-
file.write(updated_soup.decode(pretty_print=True, formatter="html5"))
113+
file.write(
114+
updated_soup.decode(pretty_print=pretty_print_output, formatter="html5")
115+
)

src/aether_cli/cli.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ def version():
3434
default="",
3535
help="Inject 'base_path' prefix in the generated HTML file.",
3636
)
37+
@click.option(
38+
"--pretty-print-output", is_flag=True, help="Enable pretty print output HTML."
39+
)
3740
@click.option("--verbose", is_flag=True, help="Enable verbose mode to echo steps.")
38-
def build(prefix: str, verbose: bool) -> None:
41+
def build(prefix: str, pretty_print_output: bool, verbose: bool) -> None:
3942
console = Console()
4043

4144
def _create_dir_if_not_exists(directory: Path) -> None:
@@ -88,6 +91,7 @@ def _copy_dir(src: Path | None, dest: Path, directory_name: str) -> None:
8891
static_assets_dir=static_assets_dir,
8992
static_css_dir=static_css_dir,
9093
static_js_dir=static_js_dir,
94+
pretty_print_output=pretty_print_output,
9195
verbose=verbose,
9296
)
9397

@@ -111,6 +115,7 @@ def _copy_dir(src: Path | None, dest: Path, directory_name: str) -> None:
111115
static_assets_dir=static_assets_dir,
112116
static_css_dir=static_css_dir,
113117
static_js_dir=static_js_dir,
118+
pretty_print_output=pretty_print_output,
114119
verbose=verbose,
115120
)
116121

0 commit comments

Comments
 (0)