docs: fix links

This commit is contained in:
Sina Atalay 2024-05-19 13:10:41 +03:00
parent c64f658a65
commit 6d1224dafd
5 changed files with 30 additions and 28 deletions

View File

@ -346,4 +346,4 @@ if __name__ == "__main__":
generate_entry_figures() generate_entry_figures()
generate_examples() generate_examples()
generate_schema() generate_schema()
update_index() # update_index() # currently index.md should be updated manually

View File

@ -27,11 +27,11 @@ This command will create the following files:
This file will contain all the content and design options of your CV. 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. 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. 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 ## 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 ## 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 *)) ((* 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/). 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/).

View File

@ -269,7 +269,7 @@ Here is an example:
```yaml ```yaml
locale_catalog: locale_catalog:
abbreviations_for_months: abbreviations_for_months: # translation of the month abbreviations
- Jan - Jan
- Feb - Feb
- Mar - Mar
@ -282,10 +282,10 @@ locale_catalog:
- Oct - Oct
- Nov - Nov
- Dec - Dec
month: "month" month: month # translation of the word "month"
months: "months" months: months # translation of the word "months"
year: "year" year: year # translation of the word "year"
years: "years" years: years # translation of the word "years"
present: "present" present: present # translation of the word "present"
to: "to" to: to # translation of the word "to"
``` ```

View File

@ -1,9 +1,9 @@
""" """
This module contains all the necessary classes to store CV data. These classes are called 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., 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. the input file is read) with the
RenderCV utilizes these instances to generate a $\\LaTeX$ file which is then rendered [`read_input_file`][rendercv.data_models.read_input_file] function. RenderCV utilizes
into a PDF file. 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 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 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, file_path_or_contents: pathlib.Path | str,
) -> RenderCVDataModel: ) -> RenderCVDataModel:
"""Read the input file and return two instances of """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 the data model with $\\LaTeX$ strings and the second instance is the data model with
markdown strings. markdown strings.
Args: 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: Returns:
RenderCVDataModel: The data models with $\\LaTeX$ and markdown strings. RenderCVDataModel: The data models with $\\LaTeX$ and markdown strings.

View File

@ -184,7 +184,8 @@ class LaTeXFile(TemplatedFile):
unitalicize a bold or italicized text. unitalicize a bold or italicized text.
Args: 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: Returns:
str: The string with the reverted nested $\\LaTeX$ style commands. str: The string with the reverted nested $\\LaTeX$ style commands.
@ -215,7 +216,7 @@ class LaTeXFile(TemplatedFile):
return latex_string return latex_string
def get_latex_code(self): def get_latex_code(self) -> str:
"""Get the $\\LaTeX$ code of the file. """Get the $\\LaTeX$ code of the file.
Returns: Returns:
@ -242,7 +243,7 @@ class MarkdownFile(TemplatedFile):
[Grammarly](https://app.grammarly.com/) for proofreading. [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. """Render and return all the templates for the Markdown file.
Returns: Returns:
@ -299,7 +300,7 @@ class MarkdownFile(TemplatedFile):
) )
return result return result
def get_markdown_code(self): def get_markdown_code(self) -> str:
"""Get the Markdown code of the file. """Get the Markdown code of the file.
Returns: Returns:
@ -333,7 +334,7 @@ def escape_latex_characters(latex_string: str, strict: bool = True) -> str:
`#!python "This is a \\# string."` `#!python "This is a \\# string."`
Args: 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 strict (bool): Whether to escape all the special $\\LaTeX$ characters or not. If
you want to allow math input, set it to False. you want to allow math input, set it to False.
Returns: Returns:
@ -496,7 +497,7 @@ def replace_placeholders_with_actual_values(
This function can be used as a Jinja2 filter in templates. This function can be used as a Jinja2 filter in templates.
Args: Args:
string (str): The string with placeholders. text (str): The text with placeholders.
placeholders (dict[str, str]): The placeholders and their values. placeholders (dict[str, str]): The placeholders and their values.
Returns: Returns:
str: The string with actual values. str: The string with actual values.
@ -515,11 +516,11 @@ def make_matched_part_something(
Warning: Warning:
This function shouldn't be used directly. Use This function shouldn't be used directly. Use
[make_matched_part_bold](renderer.md#rendercv.rendering.make_matched_part_bold), [make_matched_part_bold][rendercv.renderer.make_matched_part_bold],
[make_matched_part_underlined](renderer.md#rendercv.rendering.make_matched_part_underlined), [make_matched_part_underlined][rendercv.renderer.make_matched_part_underlined],
[make_matched_part_italic](renderer.md#rendercv.rendering.make_matched_part_italic), [make_matched_part_italic][rendercv.renderer.make_matched_part_italic],
or 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. instead.
Args: Args:
@ -846,7 +847,7 @@ def copy_theme_files_to_output_directory(
Args: Args:
theme_name (str): The name of the theme. 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: if theme_name in dm.available_themes:
theme_directory_path = importlib.resources.files( theme_directory_path = importlib.resources.files(