update docstrings

This commit is contained in:
Sina Atalay 2023-10-20 20:29:44 +02:00
parent c73412d82d
commit 7ef7a60aef
3 changed files with 11 additions and 14 deletions

View File

@ -1,7 +1,7 @@
r"""RenderCV package. r"""RenderCV package.
It parses the user input YAML/JSON file and validates the data (checks spelling It parses the user input YAML/JSON file and validates the data (checking spelling
mistakes, checks if the dates are consistent, etc.). Then, with the data, it creates a mistakes, whether the dates are consistent, etc.). Then, with the data, it creates a
$\LaTeX$ file and renders it with [TinyTeX](https://yihui.org/tinytex/). $\LaTeX$ file and renders it with [TinyTeX](https://yihui.org/tinytex/).
""" """
import logging import logging
@ -9,10 +9,6 @@ import os
class LoggingFormatter(logging.Formatter): class LoggingFormatter(logging.Formatter):
"""
Logging formatter class
"""
grey = "\x1b[38;20m" # debug level grey = "\x1b[38;20m" # debug level
white = "\x1b[37;20m" # info level white = "\x1b[37;20m" # info level
yellow = "\x1b[33;20m" # warning level yellow = "\x1b[33;20m" # warning level
@ -36,6 +32,7 @@ class LoggingFormatter(logging.Formatter):
return formatter.format(record) return formatter.format(record)
# Initialize logger with colors
os.system("COLOR 0") # enable colors in Windows terminal os.system("COLOR 0") # enable colors in Windows terminal
logger = logging.getLogger() logger = logging.getLogger()
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)

View File

@ -2,7 +2,7 @@
This module contains classes and functions to parse and validate YAML or JSON input This module contains classes and functions to parse and validate YAML or JSON input
files. It uses [Pydantic](https://github.com/pydantic/pydantic) to achieve this goal. files. It uses [Pydantic](https://github.com/pydantic/pydantic) to achieve this goal.
All the data classes have `BaseModel` from Pydantic as a base class, and some data All the data classes have `BaseModel` from Pydantic as a base class, and some data
fields have advanced types like `HttpUrl`, `EmailStr`, or `PastDate` from the Pydnatic fields have advanced types like `HttpUrl`, `EmailStr`, or `PastDate` from the Pydantic
library for validation. library for validation.
""" """
@ -349,9 +349,9 @@ class ClassicThemeSectionTitleMargins(BaseModel):
class ClassicThemeEntryAreaMargins(BaseModel): class ClassicThemeEntryAreaMargins(BaseModel):
"""This class stores the margins of entry areas for the classic theme. """This class stores the margins of entry areas for the classic theme.
For the classic theme, entry areas are (OneLineEntry)[../index.md#onelineentry], For the classic theme, entry areas are [OneLineEntry](../index.md#onelineentry),
(NormalEntry)[../index.md#normalentry], and [NormalEntry](../index.md#normalentry), and
(ExperienceEntry)[../index.md#experienceentry]. [ExperienceEntry](../index.md#experienceentry).
""" """
left: LaTeXDimension = Field( left: LaTeXDimension = Field(
@ -944,7 +944,7 @@ class SocialNetwork(BaseModel):
class Connection(BaseModel): class Connection(BaseModel):
r"""This class stores a connection/communication information. """This class stores a connection/communication information.
Warning: Warning:
This class isn't designed for users to use, but it is used by RenderCV to make This class isn't designed for users to use, but it is used by RenderCV to make

View File

@ -118,9 +118,9 @@ def make_it_something(
Warning: Warning:
This function shouldn't be used directly. Use This function shouldn't be used directly. Use
(make_it_bold)[#rendercv.rendering.make_it_bold], [make_it_bold](rendering.md#rendercv.rendering.make_it_bold),
(make_it_underlined)[#rendercv.rendering.make_it_underlined], or [make_it_underlined](rendering.md#rendercv.rendering.make_it_underlined), or
(make_it_italic)[#rendercv.rendering.make_it_italic] instead. [make_it_italic](rendering.md#rendercv.rendering.make_it_italic) instead.
""" """
if not isinstance(value, str): if not isinstance(value, str):
raise ValueError(f"{something} should only be used on strings!") raise ValueError(f"{something} should only be used on strings!")