crieur 1.0.2__py3-none-any.whl → 1.0.4__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  from pathlib import Path
2
2
 
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.4"
4
4
  ROOT_DIR = Path(__file__).parent
crieur/cli.py CHANGED
@@ -23,12 +23,14 @@ def version():
23
23
  @cli
24
24
  def generate(
25
25
  title="Crieur",
26
+ base_url="/",
26
27
  target_path: Path = Path() / "public",
27
28
  source_path: Path = Path() / "sources",
28
29
  ):
29
30
  """Generate a new revue website.
30
31
 
31
32
  :title: Title of the website (default: Crieur).
33
+ :base_url: Base URL of the website, ending with / (default: /).
32
34
  :target_path: Path where site is built (default: /public/).
33
35
  :source_path: Path where stylo source were downloaded (default: /sources/).
34
36
  """
@@ -39,7 +41,7 @@ def generate(
39
41
  numeros.append(numero)
40
42
 
41
43
  keywords = collect_keywords(numeros)
42
- generate_html(title, numeros, keywords, target_path)
44
+ generate_html(title, base_url, numeros, keywords, target_path)
43
45
 
44
46
  static_path_local = Path(__file__).parent / "statics"
45
47
  shutil.copytree(static_path_local, target_path / "statics", dirs_exist_ok=True)
crieur/generator.py CHANGED
@@ -29,11 +29,12 @@ def markdown(value):
29
29
  environment.filters["markdown"] = markdown
30
30
 
31
31
 
32
- def generate_html(title, numeros, keywords, target_path):
32
+ def generate_html(title, base_url, numeros, keywords, target_path):
33
33
  common_params = {
34
+ "title": title,
35
+ "base_url": base_url,
34
36
  "numeros": numeros,
35
37
  "keywords": keywords,
36
- "title": title,
37
38
  }
38
39
 
39
40
  template_homepage = environment.get_template("homepage.html")
@@ -1,7 +1,7 @@
1
1
  {% extends "base.html" %}
2
2
 
3
3
  {% block content %}
4
- <h2><a href="../..">{{ numero.name }}</a></h2>
4
+ <h2><a href="{{ base_url }}numeros/{{ numero.name }}">{{ numero.name }}</a></h2>
5
5
 
6
6
  <article>
7
7
  <header>
@@ -20,7 +20,7 @@
20
20
  {% endif %}
21
21
 
22
22
  {% for keyword in article.keywords %}
23
- <a href="/mot-clef/{{ keyword.slug }}/">#{{ keyword.name }}</a>({{ keyword.articles|length }}){%- if not loop.last -%}, {% endif %}
23
+ <a href="{{ base_url }}mot-clef/{{ keyword.slug }}/">#{{ keyword.name }}</a>({{ keyword.articles|length }}){%- if not loop.last -%}, {% endif %}
24
24
  {% endfor %}
25
25
  </header>
26
26
 
@@ -15,7 +15,7 @@
15
15
  <!-- Lightest blank gif, avoids an extra query to the server. -->
16
16
  <link rel="icon" href="data:;base64,iVBORw0KGgo=" />
17
17
  <link rel="stylesheet"
18
- href="/statics/pico.css" />
18
+ href="{{ base_url }}statics/pico.css" />
19
19
  <style>
20
20
  h1 {
21
21
  text-align: center;
@@ -27,7 +27,7 @@
27
27
  <body>
28
28
  <main class="container">
29
29
  <div class="content">
30
- <h1><a href="/">{{ title }}</a></h1>
30
+ <h1><a href="{{ base_url }}">{{ title }}</a></h1>
31
31
  {% block content %}
32
32
  {% endblock content %}
33
33
  </div>
@@ -59,14 +59,14 @@
59
59
  {% block content %}
60
60
  {% for slug, keyword in keywords.items() %}
61
61
  {% if loop.index < 20 %}
62
- <a href="/mot-clef/{{ keyword.slug }}/">#{{ keyword.name }}</a>({{ keyword.articles|length }}){%- if not loop.last -%}, {% endif %}
62
+ <a href="{{ base_url }}mot-clef/{{ keyword.slug }}/">#{{ keyword.name }}</a>({{ keyword.articles|length }}){%- if not loop.last -%}, {% endif %}
63
63
  {% endif %}
64
64
  {% endfor %}…
65
65
  <details>
66
66
  <summary role="button">Voir plus de mot-clés :</summary>
67
67
  {% for slug, keyword in keywords.items() %}
68
68
  {% if loop.index >= 20 %}
69
- <a href="/mot-clef/{{ keyword.slug }}/">#{{ keyword.name }}</a>({{ keyword.articles|length }}){%- if not loop.last -%}, {% endif %}
69
+ <a href="{{ base_url }}mot-clef/{{ keyword.slug }}/">#{{ keyword.name }}</a>({{ keyword.articles|length }}){%- if not loop.last -%}, {% endif %}
70
70
  {% endif %}
71
71
  {% endfor %}
72
72
  </details>
@@ -75,13 +75,13 @@
75
75
  <article>
76
76
  <header>
77
77
  <hgroup>
78
- <h2><a href="/numero/{{ numero.name }}/">{{ numero.name }}</a></h2>
78
+ <h2><a href="{{ base_url }}numero/{{ numero.name }}/">{{ 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="/numero/{{ numero.name }}/article/{{ article.id }}/">{{ article.title_f }}</a></li>
84
+ <li><a href="{{ base_url }}numero/{{ numero.name }}/article/{{ article.id }}/">{{ article.title_f }}</a></li>
85
85
  {% endfor %}
86
86
  </ul>
87
87
  </article>
@@ -9,7 +9,7 @@
9
9
  <div>
10
10
  <ul>
11
11
  {% for article in keyword.articles %}
12
- <li><a href="/numero/{{ article.numero.name }}/article/{{ article.id }}/">{{ article.title_f }}</a></li>
12
+ <li><a href="{{ base_url }}numero/{{ article.numero.name }}/article/{{ article.id }}/">{{ article.title_f }}</a></li>
13
13
  {% endfor %}
14
14
  </ul>
15
15
  </div>
@@ -59,7 +59,7 @@
59
59
  {% for article in numero.articles %}
60
60
  <article>
61
61
  <header>
62
- <h3><a href="/numero/{{ numero.name }}/article/{{ article.id }}/">{{ article.title_f }}</a></h3>
62
+ <h3><a href="{{ base_url }}numero/{{ numero.name }}/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.0.2
3
+ Version: 1.0.4
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
@@ -689,6 +689,7 @@ Requires-Dist: jinja2
689
689
  Requires-Dist: minicli
690
690
  Requires-Dist: mistune
691
691
  Requires-Dist: python-slugify
692
+ Requires-Dist: pytz>=2025.2
692
693
  Requires-Dist: pyyaml>=6.0.2
693
694
  Requires-Dist: tzdata>=2025.2
694
695
  Requires-Dist: unidecode
@@ -729,7 +730,7 @@ options:
729
730
  -h, --help Show this help message and exit
730
731
 
731
732
  Available commands:
732
-
733
+
733
734
  version Return the current version.
734
735
  generate Generate a new revue website.
735
736
  stylo Initialize a new revue to current directory from Stylo.
@@ -749,11 +750,12 @@ help = output.decode().split("\n", 1)[1] # Remove Pandoc version.
749
750
  cog.out(f"```\n{help}\n```")
750
751
  ]]] -->
751
752
  ```
752
- [--source-path SOURCE_PATH]
753
+ [--target-path TARGET_PATH] [--source-path SOURCE_PATH]
753
754
 
754
755
  options:
755
756
  -h, --help show this help message and exit
756
757
  --title, -t TITLE Title of the website (default: Crieur).
758
+ --base-url BASE_URL Base URL of the website, ending with / (default: /).
757
759
  --target-path TARGET_PATH
758
760
  Path where site is built (default: /public/).
759
761
  --source-path SOURCE_PATH
@@ -0,0 +1,17 @@
1
+ crieur/__init__.py,sha256=zlDH-Tc42iSvpV7K5YU5o4r3Ng239oxDEqBCZQDwN8Y,77
2
+ crieur/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
3
+ crieur/cli.py,sha256=-H9yMG0vT5pJXAL5GP7zf5qisi3KzoIhjG1LUXz9p10,4423
4
+ crieur/generator.py,sha256=LHFR93DYogcvfEoudnXn5BI7LiQ7M71VXE-Q4uWshOY,2501
5
+ crieur/models.py,sha256=C-eqCa5Ce1hNGv89Ta3ZhSixT06h0am_MG-mO7FNjjo,3658
6
+ crieur/utils.py,sha256=kIdxpd5LgVv13Lx2aEXzjQttBDtcppRlwNsH0vwX8f0,1566
7
+ crieur/statics/pico.css,sha256=VdrimW9PLcEIzqJ__s062OrwBj_Jb6jZIwbtdqOtM-w,93407
8
+ crieur/templates/article.html,sha256=9-5wfVvwyu-IRDB33TUjO2dwNDDTOdxr_Qw3RpwghvM,1149
9
+ crieur/templates/base.html,sha256=T1VALdpGLtG-tVYDcziLHQQbYWFvAs4FDRBL_olO2mc,1416
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.0.4.dist-info/METADATA,sha256=PE6rDQHSiEQ7FxRyzfSBSXCxQwU4gSXkLOmdltQz46M,44515
14
+ crieur-1.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ crieur-1.0.4.dist-info/entry_points.txt,sha256=edmbmPxs9QXyvSMpPJBDPGw3vZOJEKqXJhysYNx3QSM,43
16
+ crieur-1.0.4.dist-info/licenses/LICENSE,sha256=F5acw9_laHeyi4wPmQyf_ttyz81VqCIwScwO8C1FhXU,34519
17
+ crieur-1.0.4.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- crieur/__init__.py,sha256=HMxG5nf7uNZx331-If5lXq2iNdTjuQzRxqgfbZt_t68,77
2
- crieur/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
3
- crieur/cli.py,sha256=6hdYn48ASf5sPEPzWw2UUXpH48yD5IgU731mH714LRQ,4327
4
- crieur/generator.py,sha256=5VEwrDoMkYLM_pv5D-vBAjEYtIOgQXEtkLCLfazKZOE,2461
5
- crieur/models.py,sha256=C-eqCa5Ce1hNGv89Ta3ZhSixT06h0am_MG-mO7FNjjo,3658
6
- crieur/utils.py,sha256=kIdxpd5LgVv13Lx2aEXzjQttBDtcppRlwNsH0vwX8f0,1566
7
- crieur/statics/pico.css,sha256=VdrimW9PLcEIzqJ__s062OrwBj_Jb6jZIwbtdqOtM-w,93407
8
- crieur/templates/article.html,sha256=70lTPtK5JRSqEIw5cIrqQjZ4VfiagLBijUeKqRA8muk,1102
9
- crieur/templates/base.html,sha256=8rIb5CqfVLsY5lSCJe1kUb65k306QiQxlbxYAFgjJMc,1390
10
- crieur/templates/homepage.html,sha256=1MURsQucBzUd2WCSGoKnx50rRUofFxFcioljgj84rnE,2406
11
- crieur/templates/keyword.html,sha256=G-q2Hq3td0pSGfrVbOY3I85QVenwlczr5xBlSYjV-Fs,415
12
- crieur/templates/numero.html,sha256=U0rKS6Zl34-O8-IMi27pWtGyN7wZVtTEQMgsdx6RREM,1869
13
- crieur-1.0.2.dist-info/METADATA,sha256=gWHDIOeNY56ZSlPnYws418HvL3oxJpVB1-gqJRXxmAU,44380
14
- crieur-1.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- crieur-1.0.2.dist-info/entry_points.txt,sha256=edmbmPxs9QXyvSMpPJBDPGw3vZOJEKqXJhysYNx3QSM,43
16
- crieur-1.0.2.dist-info/licenses/LICENSE,sha256=F5acw9_laHeyi4wPmQyf_ttyz81VqCIwScwO8C1FhXU,34519
17
- crieur-1.0.2.dist-info/RECORD,,
File without changes