Skip to content

Commit

Permalink
Update code language filtering and version number
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubAndrysek committed Apr 2, 2024
1 parent 7a65af2 commit 1c0d2a4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions mkdoxy/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ def use_code_language(value, code_language: Optional[str]):
@param code_language (str|None): the code language to apply.
@return: The filtered value.
"""
if not code_language:
return value

return re.sub(PLAIN_CODE_BLOCK, lambda m: f"```{code_language}{m[1]}```", str(value))
return (
re.sub(
PLAIN_CODE_BLOCK,
lambda m: f"```{code_language}{m[1]}```",
str(value),
)
if code_language
else value
)
2 changes: 1 addition & 1 deletion mkdoxy/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def array(self, plain: bool = False, notype: bool = False) -> [str]:
declaration = self.parser.paras_as_str(type, plain=plain)
declname = param.find("declname")
if declname is not None:
declaration += " " + self.parser.paras_as_str(declname, plain=plain)
declaration += f" {self.parser.paras_as_str(declname, plain=plain)}"
ret.append(declaration)
return ret

Expand Down
2 changes: 1 addition & 1 deletion mkdoxy/xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, cache: Cache, debug: bool = False):
self.debug = debug

def anchor(self, name: str) -> str:
return '<a name="' + name + '"></a>'
return f'<a name="{name}"></a>'

def paras_as_str(self, p: Element, italic: bool = False, plain: bool = False) -> str:
if plain:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def requirements():
# https://pypi.org/project/mkdoxy/
setup(
name="mkdoxy",
version="1.1.7",
version="1.2.0",
description="MkDoxy → MkDocs + Doxygen = easy documentation generator with code snippets",
long_description=readme(),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 1c0d2a4

Please sign in to comment.