Skip to content

Commit

Permalink
fix(quality): apply git hooks to existing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts authored and florentfgrs committed Nov 18, 2024
1 parent 9c988bb commit c5940fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion website/docs/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ nav:
- Sponsors: sponsors.md
- Installation: installation.md
- Development: development.md
- Screencast: screencast.md
- Screencast: screencast.md
8 changes: 4 additions & 4 deletions website/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:root {
--md-primary-fg-color: #3a74acff;
--md-primary-bg-color: #ffffff;
--md-accent-fg-color: #ffff00ff;
--md-primary-fg-color: #3a74acff;
--md-primary-bg-color: #ffffff;
--md-accent-fg-color: #ffff00ff;
--md-accent-bg-color: #3a74acff;
}
}
17 changes: 9 additions & 8 deletions website/macros.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

def define_env(env):
"""Define variables, macros, and filters.
Expand All @@ -9,15 +7,16 @@ def define_env(env):
Returns:
None
"""

@env.macro
def include_file(filename: str) ->str:
def include_file(filename: str) -> str:
"""Include the contents of a file.
Args:
filename (str): The name of the file to include.
Returns:
str: The content of the file with specific replacements made,
str: The content of the file with specific replacements made,
or an error message if the file is not found.
Raises:
Expand All @@ -26,17 +25,19 @@ def include_file(filename: str) ->str:
try:
with open(filename, "r", encoding="utf-8") as file:
content = file.read().replace("website/docs/", "")
content = content.replace("[AUTHORS](AUTHORS)", "[AUTHORS](./authors.md)")
content = content.replace(
"[AUTHORS](AUTHORS)", "[AUTHORS](./authors.md)"
)
return content
except FileNotFoundError:
return f"File not found: {filename}"

@env.macro
def get_project_version() -> str:
"""Retrieve the project version from sonar-project.properties.
Returns:
str: The project version if found, or an error message if the file
str: The project version if found, or an error message if the file
cannot be read or the version is not specified.
"""
properties_file = "../sonar-project.properties"
Expand All @@ -48,4 +49,4 @@ def get_project_version() -> str:
return line.split("=", 1)[1].strip()
return "Version not found in the properties file."
except FileNotFoundError:
return f"File not found: {properties_file}"
return f"File not found: {properties_file}"
2 changes: 1 addition & 1 deletion website/templates-custom/annotated.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Here are the classes, structs, unions and interfaces with brief descriptions:
{{- loop(node.children)|indent(2, true) }}
{%- endif %}
{%- endif -%}
{%- endfor %}
{%- endfor %}

0 comments on commit c5940fe

Please sign in to comment.