crieur 1.1.0__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of crieur might be problematic. Click here for more details.
- crieur/__init__.py +1 -1
- crieur/cli.py +7 -2
- crieur/generator.py +1 -1
- crieur/models.py +6 -0
- crieur/templates/article.html +1 -1
- crieur/templates/homepage.html +2 -2
- crieur/templates/keyword.html +1 -1
- crieur/templates/numero.html +1 -1
- {crieur-1.1.0.dist-info → crieur-1.2.0.dist-info}/METADATA +8 -2
- crieur-1.2.0.dist-info/RECORD +17 -0
- crieur-1.1.0.dist-info/RECORD +0 -17
- {crieur-1.1.0.dist-info → crieur-1.2.0.dist-info}/WHEEL +0 -0
- {crieur-1.1.0.dist-info → crieur-1.2.0.dist-info}/entry_points.txt +0 -0
- {crieur-1.1.0.dist-info → crieur-1.2.0.dist-info}/licenses/LICENSE +0 -0
crieur/__init__.py
CHANGED
crieur/cli.py
CHANGED
|
@@ -28,13 +28,17 @@ def generate(
|
|
|
28
28
|
target_path: Path = Path() / "public",
|
|
29
29
|
source_path: Path = Path() / "sources",
|
|
30
30
|
templates_path: Path = Path(__file__).parent / "templates",
|
|
31
|
+
without_statics: bool = False,
|
|
31
32
|
):
|
|
32
33
|
"""Generate a new revue website.
|
|
33
34
|
|
|
34
35
|
:title: Title of the website (default: Crieur).
|
|
35
36
|
:base_url: Base URL of the website, ending with / (default: /).
|
|
37
|
+
:extra_vars: stringified JSON extra vars passed to the templates.
|
|
36
38
|
:target_path: Path where site is built (default: /public/).
|
|
37
39
|
:source_path: Path where stylo source were downloaded (default: /sources/).
|
|
40
|
+
:template_path: Path where templates are located (default: @crieur/templates/).
|
|
41
|
+
:without_statics: Do not copy statics if True (default: False).
|
|
38
42
|
"""
|
|
39
43
|
numeros = []
|
|
40
44
|
for numero in each_folder_from(source_path):
|
|
@@ -47,8 +51,9 @@ def generate(
|
|
|
47
51
|
title, base_url, numeros, keywords, extra_vars, target_path, templates_path
|
|
48
52
|
)
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
if not without_statics:
|
|
55
|
+
static_path_local = Path(__file__).parent / "statics"
|
|
56
|
+
shutil.copytree(static_path_local, target_path / "statics", dirs_exist_ok=True)
|
|
52
57
|
|
|
53
58
|
|
|
54
59
|
@cli
|
crieur/generator.py
CHANGED
|
@@ -48,7 +48,7 @@ def generate_html(
|
|
|
48
48
|
for numero in numeros:
|
|
49
49
|
template_numero = environment.get_template("numero.html")
|
|
50
50
|
content = template_numero.render(numero=numero, **common_params)
|
|
51
|
-
numero_folder = target_path / "numero" / numero.
|
|
51
|
+
numero_folder = target_path / "numero" / numero.slug
|
|
52
52
|
numero_folder.mkdir(parents=True, exist_ok=True)
|
|
53
53
|
(numero_folder / "index.html").write_text(content)
|
|
54
54
|
|
crieur/models.py
CHANGED
|
@@ -14,6 +14,9 @@ class Numero(YAMLWizard):
|
|
|
14
14
|
metadata: str
|
|
15
15
|
articles: list
|
|
16
16
|
|
|
17
|
+
def __post_init__(self):
|
|
18
|
+
self.slug = slugify(self.name)
|
|
19
|
+
|
|
17
20
|
def configure_articles(self, yaml_path):
|
|
18
21
|
# Preserves abstract_fr key (vs. abstract-fr) when converting to_yaml()
|
|
19
22
|
DumpMeta(key_transform="SNAKE").bind_to(Article)
|
|
@@ -59,6 +62,9 @@ class Article(YAMLWizard):
|
|
|
59
62
|
abstract: list = None
|
|
60
63
|
keywords: list = None
|
|
61
64
|
|
|
65
|
+
def __post_init__(self):
|
|
66
|
+
self.slug = slugify(self.title)
|
|
67
|
+
|
|
62
68
|
|
|
63
69
|
def configure_numero(yaml_path):
|
|
64
70
|
# Preserves abstract_fr key (vs. abstract-fr) when converting to_yaml()
|
crieur/templates/article.html
CHANGED
crieur/templates/homepage.html
CHANGED
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
<article>
|
|
76
76
|
<header>
|
|
77
77
|
<hgroup>
|
|
78
|
-
<h2><a href="{{ base_url }}numero/{{ numero.
|
|
78
|
+
<h2><a href="{{ base_url }}numero/{{ numero.slug }}/">{{ numero.name }}</a></h2>
|
|
79
79
|
<p>Le {{ numero.articles.0.date.strftime('%d %B %Y') }}</p>
|
|
80
80
|
</hgroup>
|
|
81
81
|
</header>
|
|
82
82
|
<ul>
|
|
83
83
|
{% for article in numero.articles %}
|
|
84
|
-
<li><a href="{{ base_url }}numero/{{ numero.
|
|
84
|
+
<li><a href="{{ base_url }}numero/{{ numero.slug }}/article/{{ article.id }}/">{{ article.title_f }}</a></li>
|
|
85
85
|
{% endfor %}
|
|
86
86
|
</ul>
|
|
87
87
|
</article>
|
crieur/templates/keyword.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<div>
|
|
10
10
|
<ul>
|
|
11
11
|
{% for article in keyword.articles %}
|
|
12
|
-
<li><a href="{{ base_url }}numero/{{ article.numero.
|
|
12
|
+
<li><a href="{{ base_url }}numero/{{ article.numero.slug }}/article/{{ article.id }}/">{{ article.title_f }}</a></li>
|
|
13
13
|
{% endfor %}
|
|
14
14
|
</ul>
|
|
15
15
|
</div>
|
crieur/templates/numero.html
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
{% for article in numero.articles %}
|
|
60
60
|
<article>
|
|
61
61
|
<header>
|
|
62
|
-
<h3><a href="{{ base_url }}numero/{{ numero.
|
|
62
|
+
<h3><a href="{{ base_url }}numero/{{ numero.slug }}/article/{{ article.id }}/">{{ article.title_f }}</a></h3>
|
|
63
63
|
</header>
|
|
64
64
|
{{ article.subtitle_f|markdown }}
|
|
65
65
|
{% if article.authors %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crieur
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: A Static Revue Generator.
|
|
5
5
|
Project-URL: Homepage, https://gitlab.huma-num.fr/ecrinum/crieur
|
|
6
6
|
Project-URL: Issues, https://gitlab.huma-num.fr/ecrinum/crieur/-/issues
|
|
@@ -750,17 +750,23 @@ help = output.decode().split("\n", 1)[1] # Remove Pandoc version.
|
|
|
750
750
|
cog.out(f"```\n{help}\n```")
|
|
751
751
|
]]] -->
|
|
752
752
|
```
|
|
753
|
-
[--
|
|
753
|
+
[--extra-vars EXTRA_VARS] [--target-path TARGET_PATH]
|
|
754
|
+
[--source-path SOURCE_PATH]
|
|
755
|
+
[--templates-path TEMPLATES_PATH] [--without-statics]
|
|
754
756
|
|
|
755
757
|
options:
|
|
756
758
|
-h, --help show this help message and exit
|
|
757
759
|
--title, -t TITLE Title of the website (default: Crieur).
|
|
758
760
|
--base-url BASE_URL Base URL of the website, ending with / (default: /).
|
|
761
|
+
--extra-vars EXTRA_VARS
|
|
762
|
+
stringified JSON extra vars passed to the templates.
|
|
759
763
|
--target-path TARGET_PATH
|
|
760
764
|
Path where site is built (default: /public/).
|
|
761
765
|
--source-path SOURCE_PATH
|
|
762
766
|
Path where stylo source were downloaded (default:
|
|
763
767
|
/sources/).
|
|
768
|
+
--templates-path TEMPLATES_PATH
|
|
769
|
+
--without-statics Do not copy statics if True (default: False).
|
|
764
770
|
|
|
765
771
|
```
|
|
766
772
|
<!-- [[[end]]] -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
crieur/__init__.py,sha256=vS-uRjCVYd831WrrAwgUW3Tc3G_4y9BRca8t751Zuyg,77
|
|
2
|
+
crieur/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
|
|
3
|
+
crieur/cli.py,sha256=UZSfoKYQFmrWxZjbLJcGAcXZ6nW_B3FCZxbno4OwQ6A,4862
|
|
4
|
+
crieur/generator.py,sha256=8SZ3A1p3DFQoIg8qbKHF3sfvClI2_QhMAfBclNj0QTs,2651
|
|
5
|
+
crieur/models.py,sha256=5HHA9_e4ijdLTOrx8oKEKG1W8nYq5hnp64qrd8s2hC8,3899
|
|
6
|
+
crieur/utils.py,sha256=kIdxpd5LgVv13Lx2aEXzjQttBDtcppRlwNsH0vwX8f0,1566
|
|
7
|
+
crieur/statics/pico.css,sha256=VdrimW9PLcEIzqJ__s062OrwBj_Jb6jZIwbtdqOtM-w,93407
|
|
8
|
+
crieur/templates/article.html,sha256=BzTXmRxg3_SDSDzPIA_eOKGMa1o1wBAXzLvt3hWbv8w,1149
|
|
9
|
+
crieur/templates/base.html,sha256=PQcEuobOFH-WVJKoiZ97UxSqhkgt-Ey7lO44Z778R_U,1480
|
|
10
|
+
crieur/templates/homepage.html,sha256=NqKCwVcBesl43FKQWkKT4OV-vEnln_pWNVvi2nJD9fU,2458
|
|
11
|
+
crieur/templates/keyword.html,sha256=Hv3Ep3R6oN5pBw14gfQT-aeqEiuFiatmVZLWn5hR1e4,428
|
|
12
|
+
crieur/templates/numero.html,sha256=b9J6aW_h9ao7XlWA0Xc390ahOH5lHDI8A4iDq6tEZTo,1882
|
|
13
|
+
crieur-1.2.0.dist-info/METADATA,sha256=f16Cd73x1hf00qi4pUGbfE0JqE8zpJ0-heyzPR6OYYM,44848
|
|
14
|
+
crieur-1.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
+
crieur-1.2.0.dist-info/entry_points.txt,sha256=edmbmPxs9QXyvSMpPJBDPGw3vZOJEKqXJhysYNx3QSM,43
|
|
16
|
+
crieur-1.2.0.dist-info/licenses/LICENSE,sha256=F5acw9_laHeyi4wPmQyf_ttyz81VqCIwScwO8C1FhXU,34519
|
|
17
|
+
crieur-1.2.0.dist-info/RECORD,,
|
crieur-1.1.0.dist-info/RECORD
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
crieur/__init__.py,sha256=BMikC4L2BIrM8NdUYDW5AiBwdaigl96GdIqDk5a0N3A,77
|
|
2
|
-
crieur/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
|
|
3
|
-
crieur/cli.py,sha256=XOtUYvRKKOOJdJQXlVqG9o7LfVxahofLbQacYnrumIA,4569
|
|
4
|
-
crieur/generator.py,sha256=kOD3pql_esbjiI1YwT6ngrl-C4Dv8lju4HtY3XwK968,2651
|
|
5
|
-
crieur/models.py,sha256=l6ZARcmCNBvc2jdZ8TIrbqO7yeqqJKfePzDFDlT4Cl4,3760
|
|
6
|
-
crieur/utils.py,sha256=kIdxpd5LgVv13Lx2aEXzjQttBDtcppRlwNsH0vwX8f0,1566
|
|
7
|
-
crieur/statics/pico.css,sha256=VdrimW9PLcEIzqJ__s062OrwBj_Jb6jZIwbtdqOtM-w,93407
|
|
8
|
-
crieur/templates/article.html,sha256=KZuUxz1r2Wa1ehxD6zIt-jGeIt0QHX0lSTZCI4IzepQ,1149
|
|
9
|
-
crieur/templates/base.html,sha256=PQcEuobOFH-WVJKoiZ97UxSqhkgt-Ey7lO44Z778R_U,1480
|
|
10
|
-
crieur/templates/homepage.html,sha256=Z6ODT-FVLUT0BjpVNaIOqGp-8rrJYeKbJE37wsGapUU,2458
|
|
11
|
-
crieur/templates/keyword.html,sha256=dNcq8fxRG9tDIoTJnKfzlaukyr25gHBRDXauAe2qlI8,428
|
|
12
|
-
crieur/templates/numero.html,sha256=R_lBPiXMeSLGWCvy-4U4X1tJuNQHpK-dVVe3DaVtQ9o,1882
|
|
13
|
-
crieur-1.1.0.dist-info/METADATA,sha256=5VPEMNQjYISxJbIXULWo0zNgXStotdic6SlAKgaYaQo,44515
|
|
14
|
-
crieur-1.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
-
crieur-1.1.0.dist-info/entry_points.txt,sha256=edmbmPxs9QXyvSMpPJBDPGw3vZOJEKqXJhysYNx3QSM,43
|
|
16
|
-
crieur-1.1.0.dist-info/licenses/LICENSE,sha256=F5acw9_laHeyi4wPmQyf_ttyz81VqCIwScwO8C1FhXU,34519
|
|
17
|
-
crieur-1.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|