fix entry point

This commit is contained in:
Sina Atalay 2023-10-20 19:50:50 +02:00
parent 324bda2363
commit 842a749f08
2 changed files with 18 additions and 4 deletions

View File

@ -1,7 +1,7 @@
[project]
name = 'rendercv'
description = 'LaTeX CV generator from a YAML/JSON file'
version = '0.3'
version = '1.0'
authors = [{ name = 'Sina Atalay' }]
requires-python = '>=3.10'
readme = "README.md"
@ -23,7 +23,7 @@ classifiers = [
"Intended Audience :: Education",
"Topic :: Text Processing :: Markup :: LaTeX",
"Topic :: Printing",
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
@ -36,7 +36,7 @@ Documentation = 'https://sinaatalay.github.io/rendercv/'
Source = 'https://github.com/sinaatalay/rendercv'
[project.scripts]
rendercv = 'rendercv.__main__:main'
rendercv = 'rendercv.__main__:cli'
[project.optional-dependencies]
docs = ["mkdocs", "mkdocs-material", "mkdocstrings-python"]

View File

@ -25,6 +25,11 @@ def render(
typer.Argument(help="Name of the YAML input file"),
]
):
"""Generate a LaTeX CV from a YAML input file.
Args:
input_file (str): Name of the YAML input file
"""
try:
file_path = os.path.abspath(input_file)
data = read_input_file(file_path)
@ -37,6 +42,11 @@ def render(
@app.command(help="Generate a YAML input file to get started")
def new(name: Annotated[str, typer.Argument(help="Full name")]):
"""Generate a YAML input file to get started.
Args:
name (str): Full name
"""
try:
environment = Environment(
loader=PackageLoader("rendercv", os.path.join("templates")),
@ -58,5 +68,9 @@ def new(name: Annotated[str, typer.Argument(help="Full name")]):
typer.Abort()
if __name__ == "__main__":
def cli():
"""Start the CLI application.
This function is the entry point for RenderCV.
"""
app()