Skip to content

Commit

Permalink
Merge pull request #97 from rprimet/small_fixes
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
denismerigoux authored Jun 19, 2024
2 parents 06d1ead + 8588b12 commit 720b7b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


project = "catleg"
copyright = "2023, the catala contributors"
copyright = "2024, the catala contributors"
author = "the catala contributors"

# -- General configuration ---------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/catleg/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']}")

Expand Down Expand Up @@ -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)


Expand All @@ -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})
4 changes: 2 additions & 2 deletions tests/test_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 (
Expand Down

0 comments on commit 720b7b3

Please sign in to comment.