diff --git a/docs/conf.py b/docs/conf.py index c486042..a940be8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,7 +10,7 @@ project = "catleg" -copyright = "2023, the catala contributors" +copyright = "2024, the catala contributors" author = "the catala contributors" # -- General configuration --------------------------------------------------- diff --git a/src/catleg/skeleton.py b/src/catleg/skeleton.py index fc8c4c2..1dd9b26 100644 --- a/src/catleg/skeleton.py +++ b/src/catleg/skeleton.py @@ -28,7 +28,7 @@ async def markdown_skeleton(textid: str, sectionid: str) -> str: # If it is not a section, then it is an article parts.append(f"{'#' * (level + 1)} Article {node['num']} | {node['id']}") article = await back.article(node["id"]) - parts.append(_formatted_atricle(article)) + parts.append(_formatted_article(article)) else: parts.append(f"{'#' * level} {node['title']}") @@ -82,7 +82,7 @@ def _article_skeleton(raw_article_json, breadcrumbs: bool = True): # level: code (1) + length of section hierarchy + article (1) level = 1 + len(article_json["context"]["titresTM"]) + 1 parts.append(f"{'#' * level} Article {article_json['num']} | {article.id}") - parts.append(_formatted_atricle(article)) + parts.append(_formatted_article(article)) return "\n\n".join(parts) @@ -95,5 +95,5 @@ def _preorder(node, level=1): yield from _preorder(section, level + 1) -def _formatted_atricle(article): +def _formatted_article(article): return mdformat.text(article.to_markdown(), options={"wrap": 80, "number": True}) diff --git a/tests/test_skeleton.py b/tests/test_skeleton.py index bacb83e..e0a0379 100644 --- a/tests/test_skeleton.py +++ b/tests/test_skeleton.py @@ -4,7 +4,7 @@ from catleg.parse_catala_markdown import parse_catala_file from catleg.query import _article_from_legifrance_reply -from catleg.skeleton import _article_skeleton, _formatted_atricle +from catleg.skeleton import _article_skeleton, _formatted_article from .test_legifrance_queries import _json_from_test_file @@ -13,7 +13,7 @@ def test_no_article_renumbering(): article_json = _json_from_test_file("LEGIARTI000044983201.json") article = _article_from_legifrance_reply(article_json) - formatted_article_md = _formatted_atricle(article) + formatted_article_md = _formatted_article(article) assert "1. Le bénéfice ou revenu imposable est constitué" in formatted_article_md assert "2. Le revenu global net annuel" in formatted_article_md assert (