Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
94b82ff
Update requirements and remove IDE configuration files; bump version …
JakubAndrysek Feb 17, 2025
e15df3b
Update pre-commit configuration, enhance README, and improve dark/lig…
JakubAndrysek Feb 18, 2025
4096836
Update to the new MkDoxy config
JakubAndrysek Feb 18, 2025
e2f8f29
Add Doxygen configuration file and enhance Doxygen integration tests
JakubAndrysek Feb 18, 2025
e18a8f3
Add CLI tool for MkDoxy configuration migration and update dependencies
JakubAndrysek Feb 19, 2025
0724cea
Update GitHub Actions workflow to clone specific branch and change cu…
JakubAndrysek Feb 19, 2025
c012a5c
Merge pull request #127 from JakubAndrysek/core-update-config
JakubAndrysek Feb 19, 2025
b6e46d8
Missing OVERLOAD_OPERATOR
EmilyBourne Mar 27, 2025
1732f2d
Strip more special characters. Convert spaces after stripping
EmilyBourne Mar 27, 2025
aea473f
Use a regex as suggested by sourcery
EmilyBourne Mar 27, 2025
5bc9bc4
Correct anchor for operators with -
EmilyBourne Mar 27, 2025
9b13883
Add suggested doc
EmilyBourne Mar 27, 2025
bc84c57
Exclude private children
EmilyBourne Mar 27, 2025
9b7d2f2
Create markdown classes for inline and block equations
EmilyBourne May 23, 2025
ef09a79
Create equation nodes for formula tag
EmilyBourne May 23, 2025
d12ac9b
Formatting
EmilyBourne May 23, 2025
46cb461
Add code to raise warnings about deprecated/unused options
EmilyBourne May 26, 2025
dcc1933
Remove TODO
EmilyBourne May 26, 2025
505faa1
Comments
EmilyBourne May 26, 2025
36ace60
Black formatting
EmilyBourne May 26, 2025
00c5fc9
Merge pull request #139 from EmilyBourne/config_warnings
JakubAndrysek Aug 29, 2025
b57fa90
Merge pull request #136 from EmilyBourne/ebourne-131-bad-anchors-v2
JakubAndrysek Aug 29, 2025
6c3b30b
Merge pull request #138 from EmilyBourne/ebourne-133-equation-renderi…
JakubAndrysek Aug 29, 2025
c44d3a7
Update development dependencies to latest versions
JakubAndrysek Aug 29, 2025
75c0b21
Refactor packaging setup: replace setup.py with pyproject.toml and up…
JakubAndrysek Aug 29, 2025
5012049
Refactor build and packaging process: migrate to Hatch and remove leg…
JakubAndrysek Aug 29, 2025
5bfcf95
Run Ruff lint-fix and format across the repository
JakubAndrysek Aug 29, 2025
0701a96
Apply Ruff --unsafe-fixes to resolve linting issues
JakubAndrysek Aug 29, 2025
0d910e7
Refactor variable names and method names for consistency and clarity …
JakubAndrysek Aug 29, 2025
087133a
Refactor logging statements for consistency and clarity in doxygen.py…
JakubAndrysek Aug 29, 2025
853d7ac
Fix formatting issues: ensure newline at end of file in multiple files
JakubAndrysek Aug 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mkdoxy-test-demos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
python -m pip install -e ".[dev]"
sudo apt-get install doxygen
- name: Clone test repo
run: git clone https://github.com/JakubAndrysek/MkDoxy-demo.git demo
run: git clone --branch core-update https://github.com/JakubAndrysek/MkDoxy-demo.git demo
- name: Build docs
run: |
cd demo
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,5 @@ tests/files/.mkdoxy
.mkdoxy/
temp/
local/

.idea/
5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

31 changes: 0 additions & 31 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/main-mkdoxy.iml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

653 changes: 0 additions & 653 deletions .idea/workspace.xml

This file was deleted.

20 changes: 16 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
---
repos:
- repo: https://github.com/sourcery-ai/sourcery
rev: v1.19.0
hooks:
- id: sourcery
# The best way to use Sourcery in a pre-commit hook:
# * review only changed lines:
# * omit the summary
args: [--diff=git diff HEAD, --no-summary]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.292'
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.6
hooks:
# Run the linter.
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [ --fix, --exit-non-zero-on-fix ]
# Run the formatter.
- id: ruff-format
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
# Packaging
package:
rm -f dist/*
python3 -m build --wheel # Updated to use python3 build tool for wheel
python3 setup.py sdist
hatch build

install: package
python3 -m pip install --no-deps --force dist/*.whl
hatch install

release: package
twine upload --repository pypi dist/*
hatch publish

release-test: package
twine upload --repository testpypi dist/*
hatch publish --index test

clean:
rm -rf dist build
hatch clean


# Testing
reviewCode:
sourcery review mkdoxy --in-place

install-dev:
python3 -m pip install --force --editable .
hatch env create

# Documentation
docs-serve:
Expand All @@ -35,3 +35,13 @@ docs-build: # results in site directory

pre-commit:
pre-commit run --show-diff-on-failure --color=always --all-files

# Linting
lint:
ruff check mkdoxy

format:
ruff format mkdoxy

lint-fix:
ruff check --fix mkdoxy
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pip install mkdoxy
```
Development version with all dependencies:
```bash
python -m venv .venv
python -m pip install mkdoxy ".[dev]"
```

Expand Down
9 changes: 0 additions & 9 deletions devdeps.txt

This file was deleted.

67 changes: 54 additions & 13 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,23 @@ theme:
repo: fontawesome/brands/github

palette:
- scheme: slate
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: orange
accent: orange
toggle:
icon: material/brightness-4
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: orange
accent: orange
toggle:
icon: material/brightness-7
name: Switch to dark mode

extra:
social:
Expand Down Expand Up @@ -64,29 +78,56 @@ plugins:
enabled: !ENV [ENABLE_MKDOXY, True]
projects:
mkdoxyApi:
src-dirs: mkdoxy
full-doc: True
template-dir: templates-custom
doxy-cfg-file: demo-projects/animal/Doxyfile
doxy-cfg:
src_dirs: mkdoxy
full_doc: True
template_dir: templates-custom
# doxy_config_file: demo-projects/animal/Doxyfile
doxy_config_dict:
FILE_PATTERNS: "*.py"
EXAMPLE_PATH: ""
RECURSIVE: True
OPTIMIZE_OUTPUT_JAVA: True
JAVADOC_AUTOBRIEF: True
EXTRACT_ALL: True
animal:
src-dirs: demo-projects/animal
full-doc: True
doxy-cfg:
src_dirs: demo-projects/animal
full_doc: True
doxy_config_dict:
FILE_PATTERNS: "*.cpp *.h*"
EXAMPLE_PATH: examples
RECURSIVE: True
save-api: .mkdoxy
full-doc: True
# save_api: .mkdoxy
full_doc: True
debug: False
ignore-errors: False
emojis-enabled: True
ignore_errors: False

# - mkdoxy:
# enabled: !ENV [ENABLE_MKDOXY, True]
# projects:
# mkdoxyApi:
# src-dirs: mkdoxy
# full-doc: True
# template-dir: templates-custom
# doxy-cfg-file: demo-projects/animal/Doxyfile
# doxy-cfg:
# FILE_PATTERNS: "*.py"
# EXAMPLE_PATH: ""
# RECURSIVE: True
# OPTIMIZE_OUTPUT_JAVA: True
# JAVADOC_AUTOBRIEF: True
# EXTRACT_ALL: True
# animal:
# src-dirs: demo-projects/animal
# full-doc: True
# doxy-cfg:
# FILE_PATTERNS: "*.cpp *.h*"
# EXAMPLE_PATH: examples
# RECURSIVE: True
# save-api: .mkdoxy
# full-doc: True
# debug: False
# ignore-errors: False
# emojis-enabled: True

markdown_extensions:
- pymdownx.highlight
Expand Down
30 changes: 15 additions & 15 deletions mkdoxy/DoxyTagParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,63 @@


class DoxyTagParser:
def __init__(self, markdown_page: str, debug: bool = False):
def __init__(self, markdown_page: str, debug: bool = False) -> None:
self.markdown_page = markdown_page
self.debug = debug
self.doxy_key = "::: doxy"
self.indent = "(?P<indent>[\t ]*)"
self.indent = "(?P<indent>[\\t ]*)"
self.project = "(?P<project>[a-zA-Z]+)"
self.key = "(?P<key>[a-zA-Z.-_]+)"
self.dot = "\."
self.dot = "\\."
self.optional_dot = "[.]?"
self.look_ahead = "(?=\n)" # it's a look ahead because we don't want to capture the newline
self.look_ahead = "(?=\\n)" # it's a look ahead because we don't want to capture the newline

def replaceMarkdown(self, start: int, end: int, replace_format: str, **kwargs):
def replace_markdown(self, start: int, end: int, replace_format: str, **kwargs) -> None:
self.markdown_page = self.markdown_page.replace(self.markdown_page[start:end], replace_format.format(**kwargs))

def returnMarkdown(self):
def return_markdown(self):
return self.markdown_page

def parseEmptyTag(self, replacement: str):
def parse_empty_tag(self, replacement: str) -> None:
empty_tag = (
rf"{self.indent}{self.doxy_key}{self.optional_dot}{self.look_ahead}" # https://regex101.com/r/Zh38uo/1
)
matches = re.finditer(empty_tag, self.markdown_page, re.MULTILINE)
for match in reversed(list(matches)):
self.replaceMarkdown(match.start(), match.end(), replacement, indent=match.group("indent"))
self.replace_markdown(match.start(), match.end(), replacement, indent=match.group("indent"))

def parseProject(self, replacement: str):
def parse_project(self, replacement: str) -> None:
project_tag = rf"{self.indent}{self.doxy_key}{self.dot}{self.project}{self.optional_dot}{self.look_ahead}" # https://regex101.com/r/TfAsmE/1
matches = re.finditer(project_tag, self.markdown_page, re.MULTILINE)
for match in reversed(list(matches)):
self.replaceMarkdown(
self.replace_markdown(
match.start(),
match.end(),
replacement,
indent=match.group("indent"),
project=match.group("project"),
)

def parseProjectTagSingle(self, replacement: str):
def parse_project_tag_single(self, replacement: str) -> None:
project_tag = (
rf"{self.indent}{self.doxy_key}{self.dot}{self.project}{self.dot}(?P<key>[a-zA-Z-_]+){self.look_ahead}"
)
matches = re.finditer(project_tag, self.markdown_page, re.MULTILINE)
for match in reversed(list(matches)):
self.replaceMarkdown(
self.replace_markdown(
match.start(),
match.end(),
replacement,
project=match.group("project"),
key=match.group("key"),
)

def parseProjectTagMulti(self, replacement: str):
project_tag = rf"{self.indent}{self.doxy_key}{self.dot}{self.project}{self.dot}(?P<key>[a-zA-Z-_]+)\s*\n(?:(?=\n)|(?=:::)|\Z)" # noqa: E501
def parse_project_tag_multi(self, replacement: str) -> None:
project_tag = rf"{self.indent}{self.doxy_key}{self.dot}{self.project}{self.dot}(?P<key>[a-zA-Z-_]+)\\s*\\n(?:(?=\\n)|(?=:::)|\\Z)" # noqa: E501
matches = re.finditer(project_tag, self.markdown_page, re.MULTILINE)
for match in reversed(list(matches)):
list_keys = match.group("key").split(".") # split keys by . to allow for nested keys
self.replaceMarkdown(
self.replace_markdown(
match.start(),
match.end(),
replacement,
Expand Down
5 changes: 5 additions & 0 deletions mkdoxy/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python
from mkdoxy.cli import main

if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions mkdoxy/cache.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Cache:
def __init__(self):
def __init__(self) -> None:
self.cache = {}

def add(self, key: str, value):
def add(self, key: str, value) -> None:
self.cache[key] = value

def get(self, key: str):
Expand Down
Loading
Loading