diff --git a/README.md b/README.md index 4d0fa7d..741d03e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This installs the CLI command, `jinja2html`, which can be used to generate html ## Usage ``` -usage: __main__.py [-h] [-d] [-p port] [-i input_dir] [-o output_dir] [-t template_dir] [--blacklist ignored_dir [ignored_dir ...]] +usage: __main__.py [-h] [-d] [-p port] [-i input_dir] [-o output_dir] [-t template_dir] [--debug] [--ignore ignored_dir [ignored_dir ...]] Render jinja2 templates as html/css/js @@ -35,7 +35,8 @@ optional arguments: -i input_dir The input directory (contianing jinja templates) to use. Defaults to the current working directory. -o output_dir The output directory to write website output files to. Defaults to ./out -t template_dir Shared templates directory (relative path only, this must be a subfolder of the input directory). Defaults to templates - --blacklist ignored_dir [ignored_dir ...] + --debug Enables debug level logging + --ignore ignored_dir [ignored_dir ...] directories to ignore ``` @@ -48,11 +49,13 @@ jinja2html jinja2html -d # generate html files for use in prod and ignore folders Foo/ and Bar/ -jinja2html -d --blacklist Foo/ Bar/ +jinja2html -d --ignore Foo/ Bar/ # run in dev mode, on port 8080 and ignore folder hello/world/ -jinja2html -d -p 8080 --blacklist hello/world/ +jinja2html -d -p 8080 --ignore hello/world/ ``` +See [here](tests/resources/sample_project/) for an example project + ## Scope jinja2html is designed for small and simple static websites. If you're trying to do something big and complex, then you should stick with the tooling of a conventional front-end framework. \ No newline at end of file diff --git a/jinja2html/web_ui.py b/jinja2html/web_ui.py index b685e75..80d9512 100644 --- a/jinja2html/web_ui.py +++ b/jinja2html/web_ui.py @@ -6,7 +6,6 @@ from collections import defaultdict, Iterable from pathlib import Path -from shutil import rmtree from typing import Any from urllib.parse import urlparse from webbrowser import open_new_tab @@ -144,7 +143,6 @@ async def changed_files_handler(wm: WebsiteManager) -> None: # rebuild all if template/config changed or if it's a newly created content dir (watchfiles doesn't recursively report files in a new dir) elif wm.context.is_template(p) or wm.context.is_config_json(p) or (wm.context.is_content_dir(p) and change == Change.added): - # l = wm.find_acceptable_files() build_all = True break diff --git a/setup.py b/setup.py index 241845a..aea4928 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="jinja2html", - version="0.4.0", + version="0.5.0", author="Fastily", author_email="fastily@users.noreply.github.com", description="user-friendly generation of websites with jinja2 templates", diff --git a/tests/resources/expected_output/content1.html b/tests/resources/expected_output/content1.html index f7df773..5f4b9e2 100644 --- a/tests/resources/expected_output/content1.html +++ b/tests/resources/expected_output/content1.html @@ -6,7 +6,7 @@ - + jinja2html test - index @@ -41,7 +41,7 @@

Content 1

- +

testing

diff --git a/tests/resources/expected_output/content2.html b/tests/resources/expected_output/content2.html index ff6a8f7..cac3e19 100644 --- a/tests/resources/expected_output/content2.html +++ b/tests/resources/expected_output/content2.html @@ -6,7 +6,7 @@ - + @@ -52,7 +52,7 @@

Content 2

- + diff --git a/tests/resources/expected_output/index.html b/tests/resources/expected_output/index.html index ddd328e..b7d84a9 100644 --- a/tests/resources/expected_output/index.html +++ b/tests/resources/expected_output/index.html @@ -6,7 +6,7 @@ - + jinja2html test - index @@ -47,7 +47,7 @@

Hello, World! This is the index page.

- + diff --git a/tests/resources/expected_output/sub/index.html b/tests/resources/expected_output/sub/index.html index bacac30..d9a67e9 100644 --- a/tests/resources/expected_output/sub/index.html +++ b/tests/resources/expected_output/sub/index.html @@ -6,7 +6,7 @@ - + jinja2html test - subpage 1 @@ -42,7 +42,7 @@

this is a subpage!!!!!

- + diff --git a/tests/resources/sample_project/templates/base.html b/tests/resources/sample_project/templates/base.html index 2b224ce..28da3c4 100644 --- a/tests/resources/sample_project/templates/base.html +++ b/tests/resources/sample_project/templates/base.html @@ -6,7 +6,7 @@ - + {% block styles %}{% endblock %} jinja2html test - {{title}} @@ -34,7 +34,7 @@ {% block content %}{% endblock %} - + {% block scripts %}{% endblock %}