From 6d1224dafd2810df520a8998dbf66450852e339e Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sun, 19 May 2024 13:10:41 +0300 Subject: [PATCH] docs: fix links --- docs/update_rendercv_files.py | 2 +- docs/user_guide/index.md | 8 +++---- .../structure_of_the_yaml_input_file.md | 14 +++++------ rendercv/data_models.py | 11 +++++---- rendercv/renderer.py | 23 ++++++++++--------- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/docs/update_rendercv_files.py b/docs/update_rendercv_files.py index f0588d0..a9bc62b 100644 --- a/docs/update_rendercv_files.py +++ b/docs/update_rendercv_files.py @@ -346,4 +346,4 @@ if __name__ == "__main__": generate_entry_figures() generate_examples() generate_schema() - update_index() + # update_index() # currently index.md should be updated manually diff --git a/docs/user_guide/index.md b/docs/user_guide/index.md index 2ff7b7f..b506961 100644 --- a/docs/user_guide/index.md +++ b/docs/user_guide/index.md @@ -27,11 +27,11 @@ This command will create the following files: This file will contain all the content and design options of your CV. -- A directory called `classic`, which contains the $\LaTeX$ source code of the default built-in theme, "classic". +- A directory called `classic`. This directory contains the $\LaTeX$ source code of RenderCV's default built-in theme, `classic`. You can update its contents to tweak the appearance of the output PDF file. -- A directory called `markdown`, which contains the Markdown source code the CV. +- A directory called `markdown`. This directory contains the Markdown source code of RenderCV's default Markdown template. You can update its contents to tweak the Markdown output of the CV. @@ -56,7 +56,7 @@ rendercv new "Your Full Name" --dont-create-markdown-source-files ## Structure of the YAML input file -The YAML input file contains all the content and design options of your CV. A detailed explanation of the structure of the YAML input file is provided [here](input_file_structure.md). +The YAML input file contains all the content and design options of your CV. A detailed explanation of the structure of the YAML input file is provided [here](structure_of_the_yaml_input_file.md). ## Rendering the CV with the `render` command @@ -202,7 +202,7 @@ For example, the content of `ExperienceEntry.j2.tex` for the `moderncv` theme is ((* endfor *)) ``` -The values between `<<` and `>>` are the names of Python variables, allowing you to write a $\\LaTeX$ CV without writing any content. Those will be replaced with the values found in the YAML input. Also, the values between `((*` and `*))` are Python blocks, allowing you to use loops and conditional statements. +The values between `<<` and `>>` are the names of Python variables, allowing you to write a $\\LaTeX$ CV without writing any content. They will be replaced with the values found in the YAML input. Also, the values between `((*` and `*))` are Python blocks, allowing you to use loops and conditional statements. The process of generating $\\LaTeX$ files like this is called "templating," and it's achieved with a Python package called [Jinja](https://jinja.palletsprojects.com/en/3.1.x/). diff --git a/docs/user_guide/structure_of_the_yaml_input_file.md b/docs/user_guide/structure_of_the_yaml_input_file.md index fcb71bf..f324409 100644 --- a/docs/user_guide/structure_of_the_yaml_input_file.md +++ b/docs/user_guide/structure_of_the_yaml_input_file.md @@ -269,7 +269,7 @@ Here is an example: ```yaml locale_catalog: - abbreviations_for_months: + abbreviations_for_months: # translation of the month abbreviations - Jan - Feb - Mar @@ -282,10 +282,10 @@ locale_catalog: - Oct - Nov - Dec - month: "month" - months: "months" - year: "year" - years: "years" - present: "present" - to: "to" + month: month # translation of the word "month" + months: months # translation of the word "months" + year: year # translation of the word "year" + years: years # translation of the word "years" + present: present # translation of the word "present" + to: to # translation of the word "to" ``` \ No newline at end of file diff --git a/rendercv/data_models.py b/rendercv/data_models.py index c2ee9a1..8bad4c8 100644 --- a/rendercv/data_models.py +++ b/rendercv/data_models.py @@ -1,9 +1,9 @@ """ This module contains all the necessary classes to store CV data. These classes are called data models. The YAML input file is transformed into instances of these classes (i.e., -the input file is read) with the [`read_input_file`](#read_input_file) function. -RenderCV utilizes these instances to generate a $\\LaTeX$ file which is then rendered -into a PDF file. +the input file is read) with the +[`read_input_file`][rendercv.data_models.read_input_file] function. RenderCV utilizes +these instances to generate a $\\LaTeX$ file which is then rendered into a PDF file. The data models are initialized with data validation to prevent unexpected bugs. During the initialization, we ensure that everything is in the correct place and that the user @@ -1292,12 +1292,13 @@ def read_input_file( file_path_or_contents: pathlib.Path | str, ) -> RenderCVDataModel: """Read the input file and return two instances of - [RenderCVDataModel](#rendercv.data_models.RenderCVDataModel). The first instance is + [RenderCVDataModel][rendercv.data_models.RenderCVDataModel]. The first instance is the data model with $\\LaTeX$ strings and the second instance is the data model with markdown strings. Args: - file_path (str): The path to the input file. + file_path_or_contents (str): The path to the input file or the contents of the + input file as a string. Returns: RenderCVDataModel: The data models with $\\LaTeX$ and markdown strings. diff --git a/rendercv/renderer.py b/rendercv/renderer.py index 3af8e5f..247c8b5 100644 --- a/rendercv/renderer.py +++ b/rendercv/renderer.py @@ -184,7 +184,8 @@ class LaTeXFile(TemplatedFile): unitalicize a bold or italicized text. Args: - string (str): The string to revert the nested $\\LaTeX$ style commands. + latex_string (str): The string to revert the nested $\\LaTeX$ style + commands. Returns: str: The string with the reverted nested $\\LaTeX$ style commands. @@ -215,7 +216,7 @@ class LaTeXFile(TemplatedFile): return latex_string - def get_latex_code(self): + def get_latex_code(self) -> str: """Get the $\\LaTeX$ code of the file. Returns: @@ -242,7 +243,7 @@ class MarkdownFile(TemplatedFile): [Grammarly](https://app.grammarly.com/) for proofreading. """ - def render_templates(self): + def render_templates(self) -> tuple[str, list[tuple[str, list[str]]]]: """Render and return all the templates for the Markdown file. Returns: @@ -299,7 +300,7 @@ class MarkdownFile(TemplatedFile): ) return result - def get_markdown_code(self): + def get_markdown_code(self) -> str: """Get the Markdown code of the file. Returns: @@ -333,7 +334,7 @@ def escape_latex_characters(latex_string: str, strict: bool = True) -> str: `#!python "This is a \\# string."` Args: - string (str): The string to escape. + latex_string (str): The string to escape. strict (bool): Whether to escape all the special $\\LaTeX$ characters or not. If you want to allow math input, set it to False. Returns: @@ -496,7 +497,7 @@ def replace_placeholders_with_actual_values( This function can be used as a Jinja2 filter in templates. Args: - string (str): The string with placeholders. + text (str): The text with placeholders. placeholders (dict[str, str]): The placeholders and their values. Returns: str: The string with actual values. @@ -515,11 +516,11 @@ def make_matched_part_something( Warning: This function shouldn't be used directly. Use - [make_matched_part_bold](renderer.md#rendercv.rendering.make_matched_part_bold), - [make_matched_part_underlined](renderer.md#rendercv.rendering.make_matched_part_underlined), - [make_matched_part_italic](renderer.md#rendercv.rendering.make_matched_part_italic), + [make_matched_part_bold][rendercv.renderer.make_matched_part_bold], + [make_matched_part_underlined][rendercv.renderer.make_matched_part_underlined], + [make_matched_part_italic][rendercv.renderer.make_matched_part_italic], or - [make_matched_part_non_line_breakable](renderer.md#rendercv.rendering.make_matched_part_non_line_breakable) + [make_matched_part_non_line_breakable][rendercv.renderer.make_matched_part_non_line_breakable] instead. Args: @@ -846,7 +847,7 @@ def copy_theme_files_to_output_directory( Args: theme_name (str): The name of the theme. - output_directory (pathlib.Path): Path to the output directory. + output_directory_path (pathlib.Path): Path to the output directory. """ if theme_name in dm.available_themes: theme_directory_path = importlib.resources.files(