Skip to content

Commit c61fdbd

Browse files
committed
update readme, tag for release
1 parent 8126bab commit c61fdbd

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This installs the CLI command, `jinja2html`, which can be used to generate html
2424

2525
## Usage
2626
```
27-
usage: __main__.py [-h] [-d] [-p port] [-i input_dir] [-o output_dir] [-t template_dir] [--blacklist ignored_dir [ignored_dir ...]]
27+
usage: __main__.py [-h] [-d] [-p port] [-i input_dir] [-o output_dir] [-t template_dir] [--debug] [--ignore ignored_dir [ignored_dir ...]]
2828
2929
Render jinja2 templates as html/css/js
3030
@@ -35,7 +35,8 @@ optional arguments:
3535
-i input_dir The input directory (contianing jinja templates) to use. Defaults to the current working directory.
3636
-o output_dir The output directory to write website output files to. Defaults to ./out
3737
-t template_dir Shared templates directory (relative path only, this must be a subfolder of the input directory). Defaults to templates
38-
--blacklist ignored_dir [ignored_dir ...]
38+
--debug Enables debug level logging
39+
--ignore ignored_dir [ignored_dir ...]
3940
directories to ignore
4041
```
4142

@@ -48,11 +49,13 @@ jinja2html
4849
jinja2html -d
4950

5051
# generate html files for use in prod and ignore folders Foo/ and Bar/
51-
jinja2html -d --blacklist Foo/ Bar/
52+
jinja2html -d --ignore Foo/ Bar/
5253

5354
# run in dev mode, on port 8080 and ignore folder hello/world/
54-
jinja2html -d -p 8080 --blacklist hello/world/
55+
jinja2html -d -p 8080 --ignore hello/world/
5556
```
5657

58+
See [here](tests/resources/sample_project/) for an example project
59+
5760
## Scope
5861
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.

jinja2html/web_ui.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from collections import defaultdict, Iterable
88
from pathlib import Path
9-
from shutil import rmtree
109
from typing import Any
1110
from urllib.parse import urlparse
1211
from webbrowser import open_new_tab
@@ -144,7 +143,6 @@ async def changed_files_handler(wm: WebsiteManager) -> None:
144143

145144
# 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)
146145
elif wm.context.is_template(p) or wm.context.is_config_json(p) or (wm.context.is_content_dir(p) and change == Change.added):
147-
# l = wm.find_acceptable_files()
148146
build_all = True
149147
break
150148

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="jinja2html",
8-
version="0.4.0",
8+
version="0.5.0",
99
author="Fastily",
1010
author_email="[email protected]",
1111
description="user-friendly generation of websites with jinja2 templates",

tests/resources/expected_output/content1.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88

9-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
1010

1111

1212
<title>jinja2html test - index</title>
@@ -41,7 +41,7 @@ <h1>Content 1</h1>
4141

4242

4343

44-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
44+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
4545

4646

4747
<p>testing</p>

tests/resources/expected_output/content2.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88

9-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
1010

1111

1212
<link rel="stylesheet" href="shared.css">
@@ -52,7 +52,7 @@ <h1 class="display-2">Content 2</h1>
5252
</div>
5353

5454

55-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
55+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
5656

5757
</body>
5858

tests/resources/expected_output/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88

9-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
1010

1111

1212
<title>jinja2html test - index</title>
@@ -47,7 +47,7 @@ <h1>Hello, World! This is the index page.</h1>
4747

4848

4949

50-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
50+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
5151

5252
</body>
5353

tests/resources/expected_output/sub/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88

9-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
1010

1111

1212
<title>jinja2html test - subpage 1</title>
@@ -42,7 +42,7 @@ <h1>this is a subpage!!!!!</h1>
4242

4343

4444

45-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
45+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
4646

4747
</body>
4848

tests/resources/sample_project/templates/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88

9-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
1010
{% block styles %}{% endblock %}
1111

1212
<title>jinja2html test - {{title}}</title>
@@ -34,7 +34,7 @@
3434

3535
{% block content %}{% endblock %}
3636

37-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
37+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
3838
{% block scripts %}{% endblock %}
3939
</body>
4040

0 commit comments

Comments
 (0)