diff --git a/docs/api_reference_dynamic.html b/docs/api_reference_dynamic.html index 82c247d..c7656ba 100644 --- a/docs/api_reference_dynamic.html +++ b/docs/api_reference_dynamic.html @@ -108,7 +108,7 @@
Generated on 2025-07-15 21:28:24
+Generated on 2025-10-30 11:47:05
This documentation was dynamically generated from the compiled module.
compute_fovcompute_fov(x: int, y: int, radius: int = 0, light_walls: bool = True, algorithm: int = FOV_BASIC) -> NoneCompute field of view from a position.
+compute_fovcompute_fov(x: int, y: int, radius: int = 0, light_walls: bool = True, algorithm: int = FOV_BASIC) -> List[Tuple[int, int, bool, bool]]Compute field of view from a position and return visible cells.
Returns: List of tuples (x, y, visible, discovered) for all visible cells: - x, y: Grid coordinates - visible: True (all returned cells are visible) - discovered: True (FOV implies discovery)
angle(...)Return the angle in radians from the positive X axis
+angleangle() -> floatGet the angle of this vector in radians.
+Returns: float: Angle in radians from positive x-axis
copy(...)Return a copy of this vector
+copycopy() -> VectorCreate a copy of this vector.
+Returns: Vector: New Vector object with same x and y values
distance_to(...)Return the distance to another vector
+distance_todistance_to(other: Vector) -> floatCalculate the distance to another vector.
+Returns: float: Distance between the two vectors
dot(...)Return the dot product with another vector
+dotdot(other: Vector) -> floatCalculate the dot product with another vector.
+Returns: float: Dot product of the two vectors
magnitude(...)Return the length of the vector
+magnitudemagnitude() -> floatCalculate the length/magnitude of this vector.
+Returns: float: The magnitude of the vector
magnitude_squared(...)Return the squared length of the vector
+magnitude_squaredmagnitude_squared() -> floatCalculate the squared magnitude of this vector. + + + +Note:
+Returns: float: The squared magnitude (faster than magnitude()) Use this for comparisons to avoid expensive square root calculation.
normalize(...)Return a unit vector in the same direction
+normalizenormalize() -> VectorReturn a unit vector in the same direction. + + + +Note:
+Returns: Vector: New normalized vector with magnitude 1.0 For zero vectors (magnitude 0.0), returns a zero vector rather than raising an exception
See also: {text}
' + # Convert docs/foo.md → foo.html and escape for safe HTML + href = html.escape(ref.replace('docs/', '').replace('.md', '.html'), quote=True) + text_escaped = html.escape(text) + return f'See also: {text_escaped}
' elif format == 'web': - # Link to hosted docs + # Link to hosted docs and escape for safe HTML web_path = ref.replace('docs/', '').replace('.md', '') - return f'See also: {text}
' + href = html.escape(f"{base_url}/{web_path}", quote=True) + text_escaped = html.escape(text) + return f'See also: {text_escaped}
' elif format == 'markdown': # Markdown link @@ -44,7 +49,29 @@ def transform_doc_links(docstring, format='html', base_url=''): # Keep as plain text for Python docstrings return match.group(0) - return re.sub(link_pattern, replace_link, docstring) + # For HTML formats, escape the entire docstring first, then process links + if format in ('html', 'web'): + # Split by the link pattern, escape non-link parts, then reassemble + parts = [] + last_end = 0 + + for match in re.finditer(link_pattern, docstring): + # Escape the text before this match + if match.start() > last_end: + parts.append(html.escape(docstring[last_end:match.start()])) + + # Process the link (replace_link handles escaping internally) + parts.append(replace_link(match)) + last_end = match.end() + + # Escape any remaining text after the last match + if last_end < len(docstring): + parts.append(html.escape(docstring[last_end:])) + + return ''.join(parts) + else: + # For non-HTML formats, just do simple replacement + return re.sub(link_pattern, replace_link, docstring) # Must be run with McRogueFace as interpreter try: @@ -339,8 +366,9 @@ def generate_html_docs():{func_name}{parsed['signature'] if parsed['signature'] else '(...)'}{description}
\n" + if parsed['description']: + description = transform_doc_links(parsed['description'], format='html') + html_content += f"{description}
\n" if parsed['args']: html_content += "